Subject Re: [ib-support] Procedure problem
Author Milan Babuskov
The DeerBear wrote:
> Hello,
>
> Here it is my SP:
>
> ---------- STATEMENT ----------
>
> CREATE PROCEDURE FIND_USER (
> USR_NAME VARCHAR(10),
> PWD VARCHAR(20))
> AS
> SELECT * FROM accounts WHERE "USER_NAME"=:usr_name AND "password"=:pwd
>
>
>
> ---------- ERROR MESSAGE ----------
>
> Invalid token.
> Dynamic SQL Error.
> SQL error code = -104.
> Token unknown - line 5, char -1.
> SELECT.
>
> What's the correct way to write an SP that returns a result set?

CREATE PROCEDURE FIND_USER (
USR_NAME VARCHAR(10),
PWD VARCHAR(20))
AS
BEGIN
SELECT * FROM accounts WHERE "USER_NAME"=:usr_name AND "password"=:pwd
...
END

And some other things too... depending on what should your procedure do.

Please take a look at Interbase Data Definiton Guide for complete syntax.

Milan.