M MichaelTJ Member Licensed User Longtime User Apr 23, 2013 #1 Cursor1 = SQL1.ExecQuery("CREATE Table DataTable_backup As Select * FROM DataTable") the above gives an error if the "DataTable_backup" already exists and no error if the "DataTable_backup" does not exist however, it will not create the "DataTable_backup" nunder any circumstances..... is my syntax incorrect?
Cursor1 = SQL1.ExecQuery("CREATE Table DataTable_backup As Select * FROM DataTable") the above gives an error if the "DataTable_backup" already exists and no error if the "DataTable_backup" does not exist however, it will not create the "DataTable_backup" nunder any circumstances..... is my syntax incorrect?
barx Well-Known Member Licensed User Longtime User Apr 23, 2013 #2 The SQL statements, looks ok to me. Although I have never used that type of statement, though a CREATE statement should be used with sql.ExecNonQuery() Upvote 0
The SQL statements, looks ok to me. Although I have never used that type of statement, though a CREATE statement should be used with sql.ExecNonQuery()
M MichaelTJ Member Licensed User Longtime User Apr 23, 2013 #3 gave it a try but.... it pops back with something about not assigning a void value.... really i just want to do a table backup so a delete followed by a create will do me.... could you please give me the minimalist query for moving all records from one table to a second and completely identical table..... thank you Upvote 0
gave it a try but.... it pops back with something about not assigning a void value.... really i just want to do a table backup so a delete followed by a create will do me.... could you please give me the minimalist query for moving all records from one table to a second and completely identical table..... thank you
mc73 Well-Known Member Licensed User Longtime User Apr 23, 2013 #4 1) Check if the new tables already exists and if so, drop it Code: Copy SQL1.execNonQuery("DROP TABLE IF EXISTS DataTable_Backup") 2) Follow the change proposed by Barx. Code: Copy SQL1.execNonQuery("CREATE Table DataTable_backup As Select * FROM DataTable") Upvote 0
1) Check if the new tables already exists and if so, drop it Code: Copy SQL1.execNonQuery("DROP TABLE IF EXISTS DataTable_Backup") 2) Follow the change proposed by Barx. Code: Copy SQL1.execNonQuery("CREATE Table DataTable_backup As Select * FROM DataTable")