Subject | Re: FW: ===Problem in creating stored procedure=== |
---|---|
Author | Adam |
Post date | 2006-07-26T06:31:23Z |
--- In firebird-support@yahoogroups.com, <rambabu.piridi@...> wrote:
parameters to it you would need a space between First and the colon).
You do have the option of using a variable to count what row you are
up to and only calling suspend if the counter > n, and calling leave
if the counter > m.
But again, what is the point of skipping records? You do not have an
order by clause, so you have no guarantee that it is records 21
through 40.
Adam
>Yes, but you can not feed parameters to it (and even if you could feed
>
>
>
> I am trying to create a stored procedure with the following
> information , But it is showing exception at first key word.
>
> Here is the structute
>
> CREATE PROCEDURE GetUserInfo(i_first integer, i_skip integer)
> RETURNS (usr_id VARCHAR(80), usr_name VARCHAR(80), usr_pwd
> VARCHAR(80), role_id VARCHAR(1), usr_code VARCHAR(20), email_id VARCHAR
> 256), description VARCHAR(300)
> )
> AS
> BEGIN
> for select first:i_first, skip :i_skip usr_id, usr_name, usr_pwd,
> role_id, usr_code, email_id, description
> FROM usr_basic_info
> INTO :usr_id, :usr_name, :usr_pwd, :role_id, :usr_code, :email_id,
> :description
> DO
> BEGIN
> SUSPEND;
> END
> END
>
> ERROR
> ======
> 10:46:50 [CREATE - 0 row(s), 0.000 secs] [Error Code: 335544569, SQL
> State: HY000] GDS Exception. 335544569. Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 7, char 18
> :
> ... 1 statement(s) executed, 0 row(s) affected, execution time 0.000 sec
>
> Can we use FIRST/SKIP inside a StoredProcedure.
parameters to it you would need a space between First and the colon).
You do have the option of using a variable to count what row you are
up to and only calling suspend if the counter > n, and calling leave
if the counter > m.
But again, what is the point of skipping records? You do not have an
order by clause, so you have no guarantee that it is records 21
through 40.
Adam