Advertisement
shakirsamoon

TypeScript to pass JSON array to MySQL

Nov 24th, 2019
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let value = ["ela", "bye", "jayawewa"];
  2.  
  3. let _query: string = `CALL testing('[`;
  4. for (let i = 0; i < value.length; i++) {
  5.     _query += `"${value[i]}"`;
  6.     if (i != value.length - 1) {
  7.         _query += ",";
  8.     }
  9. }
  10. _query += `]')`;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement