Ken33:
Your original question . . . where you said:
Ken33 wrote:SELECT *
INTO Persons_Backup
FROM Persons;
has a syntax error: "Syntax error in SQL expression".
The above, would be accurate ( error ), as you have entered it.
What I mean is, it WILL return an error, BUT, yes, it is 'easy' to correct.
Just for others reading this . . . one can 'easily' create a 'backup' table . . . or . . . part of a table . . . by using the SELECT FIELD_NAME INTO NEW_TABLE FROM OLD_TABLE syntax . . . when . . . the above is 'executed' from either, a macro, OR, the menu, Tools -> SQL...
The above is 'documented' in HSQL documentation at:
http://www.hsqldb.org/doc/guide/ch09.ht ... ct-section .
BUT, I suspect, your 'problem' / 'solution' is this little 'footnote' in the documentation:
A unquoted identifier (name) starts with a letter and is followed by any number of ASCII letters or digits. When an SQL statement is issued, any lowercase characters in unquoted identifiers are converted to uppercase. Because of this, unquoted names are in fact ALL UPPERCASE when used in SQL statements.
What this means is . . . because your Table Name is defined as:
Persons . . . ( mixed case, using both
UPPER CASE and
lower case letters ) . . . you MUST wrap your column and table names in double quotes.
So, by entering the command as:
Code: Select all
SELECT *
INTO "Persons_Backup"
FROM "Persons";
should work. You should see the message . . . Command successfully executed.
To view the 'new' table in the Table section . . . you will also have to issue the command . . . from the Menu:
View ->
Refresh Tables
I hope that is clear', and, it helps. Please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your first post title (edit button) if your issue has been fixed / resolved.