![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am running pervasive 2000i. I have problem with this procedure create procedure del_table (in :wtable char(10)) as begin delete from :wtable; end; i get this errror: [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager][SPEng][Pervasive][ODBC Engine Interface]Syntax Error: DELETE FROM << ??? >>? Thank you all, |
#3
| |||
| |||
|
|
"Bre-x" <cholotron (AT) hotmail (DOT) com> wrote in message news:eWmXc.211588$M95.70625 (AT) pd7tw1no (DOT) .. Hi, I am running pervasive 2000i. I have problem with this procedure create procedure del_table (in :wtable char(10)) as begin delete from :wtable; end; i get this errror: [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager][SPEng][Pervasive][ODBC Engine Interface]Syntax Error: DELETE FROM << ??? >>? Thank you all, I'm no pervasive expert, but I don't think you can do that. Procedure parameters can only be compared to fields etc. not used to dynamically build SQL. ie You could say delete from myTable where myKey = :keyValue but not what you are trying to do. I guess you could do somthing like: CREATE PROCEDURE del_table (in :wtable char(10)) AS BEGIN if :wtable = 'Table1' then delete from Table1; end if if :wtable = 'Table2' then delete from Table2; end if END; Depends on how many tables you have... Regards, Chris. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. |
#4
| |||
| |||
|
|
"Bre-x" <cholotron (AT) hotmail (DOT) com> wrote in message news:eWmXc.211588$M95.70625 (AT) pd7tw1no (DOT) .. Hi, I am running pervasive 2000i. I have problem with this procedure create procedure del_table (in :wtable char(10)) as begin delete from :wtable; end; i get this errror: [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager][SPEng][Pervasive][ODBC Engine Interface]Syntax Error: DELETE FROM << ??? >>? Thank you all, I'm no pervasive expert, but I don't think you can do that. Procedure parameters can only be compared to fields etc. not used to dynamically build SQL. ie You could say delete from myTable where myKey = :keyValue but not what you are trying to do. I guess you could do somthing like: CREATE PROCEDURE del_table (in :wtable char(10)) AS BEGIN if :wtable = 'Table1' then delete from Table1; end if if :wtable = 'Table2' then delete from Table2; end if END; Depends on how many tables you have... Regards, Chris. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. |
#5
| |||
| |||
|
|
ChirsM Thanks for you help. Your script/procedure works very well CREATE PROCEDURE del_table (in :wtable char(10)) AS BEGIN if :wtable = 'SO_Desc' then delete from SO_Desc; end if if :wtable = 'SO_Inv' then delete from SO_Inv; end if END; thnks!! |
![]() |
| Thread Tools | |
| Display Modes | |
| |