Re: DROP TABLE Problem
Posted in 1998
Yes! you can't use vars for this sort of statements, and of course, neither
can you prepare them. I'm afraid your only option is to use SYSTEM to
fire dbaccess, passing it a "DROP TABLE "|| qqqq (actual details left as an
exercise for the reader :-)
Ciao,
Marco
______________________________________________________________________________
Marco Greco <marco@informix.com> Standard disclaimers apply!
Informix faq http://www.iiug.org/techinfo/faq/informix.htm
4glworks http://www.ctonline.it/~marcog
Informix on Linux http://www.ctonline.it/~marcog/ifmxlinux.htm
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