Board index » delphi » check object existence

check object existence

How can I check a stored procedure/UDF/Table exist or not in Interbase 6.0
database?
E.g.
Stored procedure name=Update_Invoice
UDF=substr
Table=InvoiceHeader

Pls. give the related codes!

Thanks.
Benson
Delphi5.0, Interbase 6.0, Win2000

 

Re:check object existence


Hi!
I think the best way is with a query on this system tables:

RDB$PROCEDURE for stores procedures.
e.g:
SELECT 1 FROM RDB$PROCEDURE WHERE RDB$PROCEDURE_NAME = 'UPDATE_INVOICE'

RDB$FUNCTIONS for UDF:
e.g:
SELECT 1 FROM RDB$FUNCTIONS WHERE RDB$FUNCTION_NAME = 'SUBSTR'

RDB$RELATIONS for tables:
e.g:
SELECT 1 FROM RDB$FUNCTIONS WHERE RDB$RELATION_NAME = 'INVOICEHEADER'

Regards!

Ariel.

--
_______________________________
Ariel E. Carn
Buenos Aires - ARGENTINA
e-mail: aca...@ciudad.com.ar

"Benson" <ben...@matrixlink.net> escribi en el mensaje
news:3ceefcdc_1@dnews...

Quote
> How can I check a stored procedure/UDF/Table exist or not in Interbase 6.0
> database?
> E.g.
> Stored procedure name=Update_Invoice
> UDF=substr
> Table=InvoiceHeader

> Pls. give the related codes!

> Thanks.
> Benson
> Delphi5.0, Interbase 6.0, Win2000

Re:check object existence


Query the appropriate system table. See chapter 7 of the Language
Reference manual for a description of the system tables.

On Sat, 25 May 2002 10:45:45 +0800, "Benson" <ben...@matrixlink.net>
wrote:

Quote
>How can I check a stored procedure/UDF/Table exist or not in Interbase 6.0
>database?
>E.g.
>Stored procedure name=Update_Invoice
>UDF=substr
>Table=InvoiceHeader

>Pls. give the related codes!

>Thanks.
>Benson
>Delphi5.0, Interbase 6.0, Win2000

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads