Version = TypeError: Sql is not a function

Hi, I have just updated to and now I get an “Sql is not a function” error when I call the SQLImport function.

The console.log directs the error to line 314 in the appstudioFunctions.js file which equates to this code line.

 314: Sql(db, s);

Are you running as a web app, or compiled with VoltBuilder?

How are you calling SQLImport?

I run in Android / iOS (cordova-sqlite-evcore-extbuild-free) built with VoltBuilder and in the browser i get the same error in both platforms (not tested iOS yet) It’s been working fine for months until i updated just now.

SQLImport(importMeData, null, importCompleted, NSB.overwriteAlways);

At what point are you calling SQLImport? Is it right at the beginning, before everything is loaded?

What happens if you enter the same command into the Console while the app is running?

I call the SQL Import on a button click after a filePicker.onChange

 var filePicker_input = "<input id='UploadFilePicker' type='file' accept='*' name=' ' />"
 NSB.MsgBox(filePicker_input,"CANCEL","Select File")

Sub UploadFilePicker.onchange()
///cordova-file plugin code to read the file THEN
SQLImport(importMeData, null, importCompleted, NSB.overwriteAlways);

If I paste the SQLImport code directly into the console i get the same error.
Can you post a link so I can download the previous AppStudio version to double check it?

Ok I found the issue.

We use a global variable as below. I comment it out it now it works, however it’s likley to stop some of our other functions from working properly which uses our Sql function / var

var Sql =""

This was not an issue in the previous versions of App Studio. I’ll carry out some further testing and will let you know if we have any resulting further issues. So far so good.

Yup - that will do it. Keywords should not be redefined.

Yes it seems to be working now with no further issues yet.

Thank you for your guidance.