ARGH - stored procedures
Posted in 1997
Message is sent with MIME. Attachments are base64 encoded --TFS-with-MIME-and-DIME Content-Type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: quoted-printable Hi, =20 Is there any way of writing a stored procedure that will drop a table=20 based on a parameter passed into that procedure? What I want is =20 CREATE PROCEDURE drop_table(tabname CHAR(18)) DEFINE drop_str CHAR(80); =20 LET drop_str =3D 'DROP TABLE ', drop_str; EXECUTE IMMEDIATE drop_str; END PROCEDURE; =20 except that EXECUTE is not allowed in a stored procedure=2E =20 Any suggestions anyone? =20 Ta Davin ********************************************************************** DST International Tel:+44 181 390 5000 www=2Edstinternational=2Eco=2Eu= k=20 This message and any attachments to it is intended only for the=20 individual or company to which it is addressed and may contain=20 information which is privileged, confidential or prohibited from=20 disclosure or unauthorised use=2E If the recipient of this=20 transmission is not the intended recipient, or the employee or agent=20 responsible for delivering such materials to the intended recipient,=20 you are hereby notified that any use, any form of reproduction,=20 dissemination, copying, disclosure, modification, distribution and/or=20 publication of this e-mail message or its attachments other than by=20 its intended recipient is strictly prohibited by the sender=2E =20 If you have received it in error, please notify us immediately by=20 telephone on the number above and destroy the message and all copies=20 in your possession=2E ********************************************************************** --TFS-with-MIME-and-DIME Content-Type: text/rtf; name="MSGCC.RTF" Content-transfer-encoding: base64 {\\rtf1\\ansi \\deff0\\deflang1024{\\fonttbl{\\f0\\froman Tms Rmn;}{\\f1\\froman Symbol;}{\\f2\\fswiss Helv;}} {\\colortbl;\\red0\\green0\\blue127;\\red0\\green127\\blue0;\\red0\\green127\\blue127;\\red127\\green0\\blue0; \\red127\\green0\\blue127;\\red127\\green127\\blue0;\\red127\\green127\\blue127;;\\red0\\green0\\blue255; \\red0\\green255\\blue0;\\red0\\green255\\blue255;\\red255\\green0\\blue0;\\red255\\green0\\blue255; \\red255\\green255\\blue0;\\red255\\green255\\blue255;}\\paperw12240\\paperh15840\\margl1800\\margr1800\\margt1440\\margb1440 \\gutter0 \\defformat\\sectd \\pard\\plain {\\plain \\f0 \\cb7 \\cf0 \\cb1 \\cf14 \\cb1 \\cf14 Hi,\\ \\cb1 \\cf14 \\ \\cb1 \\cf14 \\cb1 \\cf14 Is there any way of writing a stored procedure that will drop a table \\ \\cb1 \\cf14 \\cb1 \\cf14 based on a parameter passed into that procedure? What I want is\\ \\cb1 \\cf14 \\ \\cb1 \\cf14 \\cb1 \\cf14 CREATE PROCEDURE drop_table(tabname CHAR(18))\\ \\cb1 \\cf14 \\cb1 \\cf14 DEFINE drop_str CHAR(80);\\ \\cb1 \\cf14 \\ \\cb1 \\cf14 \\cb1 \\cf14 LET drop_str = 'DROP TABLE ', drop_str;\\ \\cb1 \\cf14 \\cb1 \\cf14 EXECUTE IMMEDIATE drop_str;\\ \\cb1 \\cf14 \\cb1 \\cf14 END PROCEDURE;\\ \\cb1 \\cf14 \\ \\cb1 \\cf14 \\cb1 \\cf14 except that EXECUTE is not allowed in a stored procedure.\\ \\cb1 \\cf14 \\ \\cb1 \\cf14 \\cb1 \\cf14 Any suggestions anyone?\\ \\cb1 \\cf14 \\ \\cb1 \\cf14 \\cb1 \\cf14 Ta\\ \\cb1 \\cf14 \\cb1 \\cf14 Davin\\ \\par }}) --TFS-with-MIME-and-DIME--