Subject Re: [firebird-support] "Unknown token" error on semicolon on FB1.5.1
Author Helen Borrie
At 07:51 AM 10/08/2004 +0000, you wrote:
>When I try to create a stored procedure:
>CREATE PROCEDURE mysp as
>begin
> select DisplayName from QuestionCategory;
>end
>where both table and field exist, I get an error:
>Dynamic SQL Error
>Dynamic SQL Error
>SQL error code = -104
>Token unknown - line 3, char 25
>;
>This happens on FB1.5.1 on Windows, through ODBC and SQL Explorer
>(Delphi 5 version). This problem also shows when connecting with ODBC
>to a Linux server version.
>
>In Database WorkBench, I tried to create a stored procedure through
>the interface:
>SET TERM ^^ ;
>CREATE PROCEDURE P_
>AS
>begin
> select DisplayName from QuestionCategory;
>end
>^^
>SET TERM ; ^^
>and I get the following error:
>"into expected but ; found". Previously, creating other stored
>procedures within the same database did work. I don't know if any of
>the metadata was damaged or anything; at the moment I'm all out of
>options and wondering if anyone has seen this error before..

It's all part of the same syntax problem. A SELECT statement in PSQL is
not valid unless there is an INTO clause. The parser is expecting INTO and
encounters a semicolon - hence the Unknown Token error.

You need sthg like this:

CREATE PROCEDURE mysp as
declare dname varchar(35);
begin
select DisplayName from QuestionCategory
into :dname;
end

/heLen