Subject Re: [firebird-support] Declare External Function and Stored Procedure
Author Helen Borrie
At 08:31 AM 11/10/2004 +0000, you wrote:

>Hi all!
>My problem is the following: I need to use SUBSTR function in a
>Stored Procedure already written inside the database (i.e. not by
>Dynamic SQL).
>Is it possible to call the DECLARE EXTERNAL FUNCTION from inside a
>Stored Procedure?

DECLARE EXTERNAL FUNCTION is not a procedure call, it is a data definition
statement. You do it only once in the life of the database and it becomes
part of the metadata of the database.

>I don't want to call this statement from the client or via isql.

You have to define metadata somewhere. Procedural SQL (PSQL), the language
of stored procedures, by design, does not support metadata definition

You *can* get at DDL by the highly risky use of EXECUTE STATEMENT but it
doesn't make sense, since uncommitted metadata either is not available, or
becomes partly available and gives you opportunities to store corrupt

Perhaps you need to explain further what you think you would achieve if it
was sensible to do what you say you want to do.