You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on an SQL parser based on Apache ShardingSphere. I have encountered a problem. I have implemented support for CREATE USER. The syntax for this statement looks like this:
This query does not pass the parser and returns an error: You have an error in your SQL syntax: CREATE TABLE PersonsNew (PersonID intLastName varchar(255)FirstName varchar(255)Country varchar(255)City varchar(255)Primary key(PersonID)) null.
The query tree looks like this:
line1:30 no viable alternative at input '(PersonID, LastName'
(insert Insert into (tableName (name (identifier Persons))) ( PersonID , LastName , FirstName , Country , City ) values (4, 'Claus', 'Jorgingston', 'USA', 'Chicago'))
Question: How can I resolve this error if LastName and FirstName are used as keywords?
Please provide answers in a basic format, as I have only recently started programming. Any advice would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone,
I am working on an SQL parser based on Apache ShardingSphere. I have encountered a problem. I have implemented support for CREATE USER. The syntax for this statement looks like this:
In the syntax, we use keywords such as: LASTNAME, MIDDLENAME, FIRSTNAME. As a result, we encounter an error in the following query:
This query does not pass the parser and returns an error: You have an error in your SQL syntax: CREATE TABLE PersonsNew (PersonID intLastName varchar(255)FirstName varchar(255)Country varchar(255)City varchar(255)Primary key(PersonID)) null.
The query tree looks like this:
Question: How can I resolve this error if LastName and FirstName are used as keywords?
Please provide answers in a basic format, as I have only recently started programming. Any advice would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions