Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
173
rated 0 times [  178] [ 5]  / answers: 1 / hits: 5434  / 4 Years ago, fri, september 18, 2020, 12:00:00

I'm trying to use Google's BigQuery NodeJs library, however, I keep getting this error.


Input example:


{"name": "John Doe", "gameid": "048.611"}

And here is an example of my query.


const query = 'select * from gametag_ae.users where GAMEID like %' + gameid + '% where NAME like %' + name + '% LIMIT 1';

And this is the error that I'm getting:


(node:6802) UnhandledPromiseRejectionWarning: Error: Syntax error: Illegal input character "%" at [1:64]

I can't use the operator % in this case, but it's necessary for this query.


What would be a better approach to get it working?


More From » node.js

 Answers
7

use below


const query = 'select * from gametag_ae.users where GAMEID like "%' + gameid + '%" AND NAME like "%' + name + '%" LIMIT 1';

[#2656] Monday, September 14, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
clarkulisesa

Total Points: 422
Total Questions: 93
Total Answers: 112

Location: Austria
Member since Thu, Jan 7, 2021
3 Years ago
clarkulisesa questions
Mon, Feb 24, 20, 00:00, 4 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
Wed, Mar 27, 19, 00:00, 5 Years ago
;