Subject RE: [firebird-support] Stored Procedure ??
Author Steffen Heil
Hi

> I'm a SQL Server guy so forgive the ignorance here. I'm trying to embed a
SELECT statement into a Stored Procedure, but it won't compile. If I take
the SELECT statement out it compiles no problem. Can one of you folks
please help? Thanks.

> ALTER PROCEDURE "TEST"
> AS
> BEGIN
> SELECT * FROM IPCSENSOR;
> EXIT; END

What shall this do? Do a select and forget it? This makes no sence. Hence it
is forbidden.
You need to specify what to do with the result:

SELECT MAX(FIELD) FROM TABLENAME INTO :VARIABLE;

If there is more then one result, do:

FOR SELECT FIELD FROM TABLENAME INTO :VARIABLE DO BEGIN
...
(maybe SUSPEND;)
END

Regards,
Steffen



------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/67folB/TM
--------------------------------------------------------------------~->


Yahoo! Groups Links