Subject Re: [firebird-support] Re: Corrupt database
Author Helen Borrie
At 12:01 PM 2/05/2004 +0000, you wrote:
>Pardon my stupidity, but this is all new to me.
>Why is the following stored procedure failing to compile?
>
>declare variable fkvalue varchar(11) character set ASCII;
>declare variable x integer;
>
>for select PERSON_ID FROM PERSONS
>for update
>into :fkvalue
>as cursor mycursor
>do
>begin
> /* Procedure Text */
> x = 1
>end;
>when GDSCode transliteration_failed do
>begin
> update persons
> set PERSON_ID = 'XXX'
> where current of mycursor;
>end;
>
>It tells me that PERSON_ID doesn't exists (while it is a column in
>the table).

I) Is this all of your stored procedure? Or did you just omit the CREATE
PROCEDURE <procedure-name> AS clause to save bandwidth?
2) Probably you created your table and/or its columns with quoted
identifiers - in which case you must refer to the objects with quoted
identifiers and in the same character case as they were declared in.

>If I use PK_PERSONS I get the same error.

You can't select an index or constraint name in a query.

/heLen