MySQL Keyword problem
Posted: Mon Apr 15, 2019 7:44 pm
Using Servoy Version: 8.4.0.3402 on Windows 10.
I'm generating Servoy forms using the Solution Model.
When I make a text field using code like this:
If the value of sTblFldName is a MySQL keyword, such as Security or Status for example, there is no problem. The screen is generated and properly populated.
But when I add a JavaScript variable like:
When the form is displayed the following truncated error trace is seen:
It is hard for me to understand why the TextField is fine but the JavaScript variable has a problem.
I see that there is an option when importing a solution called:
Is there a way to apply that to a solution being developed?
thanks,
Terry
I'm generating Servoy forms using the Solution Model.
When I make a text field using code like this:
- Code: Select all
var oTextField = goJSForm.newTextField( sTblFldName, oCoords.iFieldX, oCoords.iFieldY, giFieldW, giFieldH );
If the value of sTblFldName is a MySQL keyword, such as Security or Status for example, there is no problem. The screen is generated and properly populated.
But when I add a JavaScript variable like:
- Code: Select all
var oJSVar = goJSForm.newVariable( sTblFldName, JSVariable.TEXT );
When the form is displayed the following truncated error trace is seen:
- Code: Select all
ERROR com.servoy.j2db.util.Debug - there is a keyword with name Security (Form Context: main), JSEvent(type = action, source = Component: <'svy_1073742067' of parent FormUI for FormController[form: main, fs size:0, selected record: null,destroyed:false]>, formName = main, elementName = <no name>, timestamp = 2019-04-15 09:13:13.408,modifiers = 0,x =146,y = 37,data = null)
at C:\Users\terry.QUANTECH\servoy_workspace\quantech\SnappMXStuff.js:370 (addTextField)
It is hard for me to understand why the TextField is fine but the JavaScript variable has a problem.
I see that there is an option when importing a solution called:
Allow reserved SQL keywords - This option will allow reserved SQL keywords to be used for names in the database
Is there a way to apply that to a solution being developed?
thanks,
Terry