If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
What is wrong with this SQL?
I am trying to delete all the data from 3 tables using this SQL in a query:
DELETE WBS_List_PRPS.* FROM WBS_List_PRPS DELETE WBS_Dates_PRTE.* FROM WBS_Dates_PRTE DELETE MWO_Header_ZIW39.* FROM MWO_Header_ZIW39; When I try to save I get syntax error in FROM clause. If I only try to delete from one table: DELETE MWO_Header_ZIW39.* FROM MWO_Header_ZIW39; Then it works fine. What am I missing? Thanks! Joe M. |
#2
|
|||
|
|||
What is wrong with this SQL?
You can only delete records from one table at a time. You can run the three
delete queries separately. -- Daryl S "Joe M." wrote: I am trying to delete all the data from 3 tables using this SQL in a query: DELETE WBS_List_PRPS.* FROM WBS_List_PRPS DELETE WBS_Dates_PRTE.* FROM WBS_Dates_PRTE DELETE MWO_Header_ZIW39.* FROM MWO_Header_ZIW39; When I try to save I get syntax error in FROM clause. If I only try to delete from one table: DELETE MWO_Header_ZIW39.* FROM MWO_Header_ZIW39; Then it works fine. What am I missing? Thanks! Joe M. |
#3
|
|||
|
|||
What is wrong with this SQL?
individual statements should be terminated by a semi-colon.
DELETE * FROM WBS_List_PRPS; DELETE * FROM WBS_Dates_PRTE; etc. if you're doing this in code, you could simply do something like this: DBEngine(0)(0).Execute "DELETE * FROM WBS_List_PRPS;", dbFailOnError DBEngine(0)(0).Execute "DELETE * FROM WBS_Dates_PRTE;", dbFailOnError DBEngine(0)(0).Execute "DELETE * FROM FROM MWO_Header_ZIW39;", dbFailOnError Joe M. wrote: I am trying to delete all the data from 3 tables using this SQL in a query: DELETE WBS_List_PRPS.* FROM WBS_List_PRPS DELETE WBS_Dates_PRTE.* FROM WBS_Dates_PRTE DELETE MWO_Header_ZIW39.* FROM MWO_Header_ZIW39; When I try to save I get syntax error in FROM clause. If I only try to delete from one table: DELETE MWO_Header_ZIW39.* FROM MWO_Header_ZIW39; Then it works fine. What am I missing? Thanks! Joe M. -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|