Closed ralphtq closed 3 months ago
I just discovered I could use single quotes ` for reserved name such as 'Order'.
So that part of the issue is solved for table names also.
Only remaining issue is CHARACTER SET 'UTF8'
@ralphtq Yes, you are correct. You should enclose the reserved name in ` when using it as a table or column name. By the way, I resolved the character set issue.
Good
Describe the bug Using a script generated by MDM ACCDB Viewer I encountered parsing failures on what are likely to be reserved tokens. For example a field called 'Order' , or 'Table' or 'Row'. In the examples attached the fields have been appended with 'Fix'. With these edits the parse of ~580 lines of SQL was successful.
I also had to place single quotes around a CREATE TABLE for 'Table':
CREATE TABLE 'Table' ( TableID INTEGER PRIMARY KEY, IsAbstract BOOLEAN, HasOpenColumns BOOLEAN, HasOpenRows BOOLEAN, HasOpenSheets BOOLEAN, IsNormalised BOOLEAN, IsFlat BOOLEAN, RowGUID VARCHAR(16) ) ;
The original code generated from MDB ACCDB for the above was:
CREATE TABLE "Table" ( "TableID" INTEGER PRIMARY KEY, "IsAbstract" BOOLEAN, "HasOpenColumns" BOOLEAN, "HasOpenRows" BOOLEAN, "HasOpenSheets" BOOLEAN, "IsNormalised" BOOLEAN, "IsFlat" BOOLEAN, "RowGUID" VARCHAR(16) ) CHARACTER SET 'UTF8';
I had to remove all quotes and use single quote for 'Table'
One final issue CHARACTER SET 'UTF8'; failed to parse.
Database Engine mySQL
To Reproduce
Remove 'Fix' on this CREATE TABLE
CREATE TABLE OperandReferenceLocation ( OperandReferenceID INTEGER PRIMARY KEY, CellID INTEGER, TableFix VARCHAR(255), RowFix VARCHAR(255), Column VARCHAR(255), Sheet VARCHAR(255) ) ;