Re: Anyone writing stored procs
Posted in 1996
Brian Weedman <brianw@flood.xnet.com> wrote in article
<569u62$t7u@flood.xnet.com>...
> How do you know if your proc exists in informix so you can drop it
> before trying to re-restore it. In SqlServer you can do this
>
> If (Exists (Select * from sysobjects where name = 'procname' and type =
'P'))
> Drop proc procname
> go
>
> I would like to do this for tables too.
>
> sqlserver syntax:
> If (Exists (Select * from sysobjects where name = 'tablename' and type
= 'U'))
> Drop table tablename>
>
> Is there anything like it in informix? Or is there a way to get
> the informix sql editor to continue on even if theres an error.
>
>
If you want to check existence of table or procedure just for dropping it,
try to drop it and ignore error. I use dbaccess for dropping and creating
tables and procedures and this method works very well for me.
For other purposes there is table systables for tables, views, synonyms and
table sysprocedures for procedures.
Example:
select * from systables where tabname = "your_table" and tabtype = "T";
select * from sysprocedures where procname = "your_proc";--
Zdeno Miklas SOFTEC spol. s r. o.
e-mail: ash@softec.sk Kutuzovova 23
phone : 42-7-273805 ext.128 831 03 Bratislava
fax : 42-7-272537 SLOVAKIA