How to pass a variable to SQL query on AppMaker?

断了今生、忘了曾经 提交于 2019-12-24 19:28:58

问题


I have to query some data from BigQuery. The code looks like this:

function GetQuery(employeeId) {
 var projectId = 'xxxx-xx-xxx';
   var request = {
     query: 'SELECT HOD_Email ' +
            'FROM [xxxx-xx-xxx.table_name.dataset] ' +
            'WHERE EmployeeId = employeeId'
   };
 }

And I don't think it works 😅


回答1:


Instead of

'WHERE EmployeeId = employeeId'   

try

'WHERE EmployeeId = "' + employeeId + '"'   


来源:https://stackoverflow.com/questions/53862192/how-to-pass-a-variable-to-sql-query-on-appmaker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!