Subject Re: [ib-support] Stored Procedure question
Author Nicorici Marcel
--- "chris_michalec <Cmich22@...>"
<Cmich22@...> wrote:
> This may be easy, but I haven't found anything in
> the documentation
> to point me in the right direction.
>
> How could I pass a tablename in through a stored
> procedure?
>
> Ie
>
> Create Procedure Delete_From_Table( ATableName
> Char(20)) as
> begin
> Delete from :ATableName;
> end;
Hi,
You can try this( in firebird 1.5)
Create Procedure Delete_From_Table( TABLE_NAME
Char(20))
AS
declare variable SQL_TXT varchar(300);
begin
SQL_TXT = 'Delete from ' || :TABLE_NAME;
execute varchar SQL_TXT;
END

REMEMBER YOU CANNOT RETURN VALUES, SO YOU CANNOT
EXECUTE SELECT STATEMENTS!

Ciao
>
> I know the above doesn't work because that is what I
> tried, but I
> think you get the idea of what I am trying to do.
>
> Thanks,
>
> Chris Michalec
>
>


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com