Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
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);
> foreach select tabname into qqqq from systables where tabname like "r_%"
> drop table qqqq;> end foreach
> end procedure;
>
> but I received the following report:
> SQL error = -206 ISAM error = -111 error string = = "qqqq"-206: no such table or words to that effect
> Am I missing something?
Yup -- what you're trying to do is called Dynamic SQL,
and you cannot do Dynamic SQL in SPL (Stored Procedure Language).
The table names in SPL are fixed when the SP is created.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix -- see http://www.perl.com/CPAN
#include <disclaimer.h>
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.