Re: DROP TABLE Problem
Posted in 1998
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting
Paolo Agati wrote:
> I'm running Informix SE 7.22 on SCO OpenServer 5.0.4. I want to remove
> a set of table from a database and I want to use a stored procedure.
> All the tables have names starting with "r_". I wrote the following
> procedure:
>
> create procedure rm_rel()>
> define qqqq char(255);
>
> trace on;
>
> foreach select tabname into qqqq from systables where tabname like "r_%"
>
> trace qqqq;
> drop table qqqq;> end foreach
>
> end procedure;
>
> but I received the following report:
>
> trace on
>
> start select cursor.
> select tabname
> from systables
> where (like tabname, "r_%")> select cursor iteration.
> select cursor returns r_121_76_01
> trace expression :r_121_76_01
>
> drop table qqqq;> exception : looking for handler
> SQL error = -206 ISAM error = -111 error string = = "qqqq"> exception : no appropriate handler
>
> Am I missing something? I looked into the manuals (RTFM) but I found no
> (significative) help.
>
> Any idea?
>
> TIA
>
> Paolo Agati
>
> -----------------------------------------------------------
> Paolo Agati CO.R.EL. Italiana S.r.l.
> Via Tavagnacco, 91
> pagati@nyx.nyx.net I-33100 UDINE
> pagati@eurocube.it +39 432 479291
You can't do this in SPL. Convert your procedure to a script and call the
script via the SPL.
--
Paul Watson #
WF Software Ltd # I don't suffer from stress -
Tel: +44 1436 674729 # I'm a carrier.
Fax: +44 1436 678693 #
www.wfsoftware.co.uk #