Re: Basic SPL Questions
Posted in 2000
Welcome Gary,
Solution may depend on version of Informix you are running !
Gary Smith wrote:
> So, consider the following SPL:
>
> CONNECT TO 'ext@fv';
> --DROP PROCEDURE DropAllTables;
>
> CREATE PROCEDURE DropAllTables()
> DEFINE TableName LIKE systables.tabname;>
> FOREACH SELECT tabname INTO TableName FROM systables WHERE tabname LIKE
> 'fw_%' OR tabname LIKE 'FW_%'
> DROP TABLE TableName;
Running IDS 7.xx, you can't make 'dynamic' SQL within SPL. It seems to be
possible with IDS.2000 (refer to www.iiug.org repository). Otherwise, a 'dirty'
workaound may be to create your DDL order in a varchar variable and pass it to
DBACCESS via a call by SYSTEM command (I think it may work...).
> Also, how can I check if the procedure has already been defined and thus
> drop the old DropAllTables() before defining the new one ?
I don't know how to manage exceptions in SQL blocs but I am interrrested in !...
> Also, are there any sites out there with common SPL examples that I can blag
> ?
Have a look at http://www.iiug.org or
http://members.tripod.com/markscranton/informix/informix.htm
Hope this helps
--
- ------------------------------------------------------------------ -
- Arnaud ANDRIEUX tel direct : 02.99.12.52.22 -
- Alliance Qualite Logiciel http://www.aql.fr -
- GROUPE SILICOMP http://www.silicomp.fr -
- Rue de la Chataigneraie - B.P. 127 -
- 35513 CESSON SEVIGNE - FRANCE -
- tel : (33) (0)2.99.12.50.00 fax : (33) (0)2.99.63.70.40 -
- ------------------------------------------------------------------ -