Subject | Re: [firebird-support] psql question about declare variable |
---|---|
Author | Helen Borrie |
Post date | 2005-02-17T23:08:04Z |
At 09:51 PM 17/02/2005 +0000, you wrote:
don't declare other things in PSQL.
With Fb 2, you can declare a cursor. This doesn't affect the optionality of
DECLARE [VARIABLE]. Example from the release notes:
DECLARE RNAME CHAR(31);
DECLARE C CURSOR FOR ( SELECT RDB$RELATION_NAME
FROM RDB$RELATIONS );
BEGIN
OPEN C;
WHILE (1 = 1) DO
BEGIN
FETCH C INTO :RNAME;
IF (ROW_COUNT = 0) THEN
LEAVE;
SUSPEND;
END
CLOSE C;
END
./hb
>when creating a stored procedure why is it that sometimes you writeVARIABLE is an optional keyword when declaring variables. Currently you
>
>AS
>DECLARE VAR1 INTEGER;
>BEGIN
>
>and other times you write it
>
>AS
>DECLARE VARIABLE VAR1 INTEGER;
>BEGIN
don't declare other things in PSQL.
With Fb 2, you can declare a cursor. This doesn't affect the optionality of
DECLARE [VARIABLE]. Example from the release notes:
DECLARE RNAME CHAR(31);
DECLARE C CURSOR FOR ( SELECT RDB$RELATION_NAME
FROM RDB$RELATIONS );
BEGIN
OPEN C;
WHILE (1 = 1) DO
BEGIN
FETCH C INTO :RNAME;
IF (ROW_COUNT = 0) THEN
LEAVE;
SUSPEND;
END
CLOSE C;
END
./hb