Subject Re: [firebird-support] token unknown in stored procedure
Author Alexandre Benson Smith
newgen_315 wrote:

>
>hi all,
>
>could someone please, spot why I'm getting an error at line 16,
>
>; token unknown
>
>
>it's probably obvious but I just do not see it. everything I try
>gives that error.
>
>thanks
>Daniel
>
>SET TERM ^;
>CREATE PROCEDURE COUNTVEHTIRES
>( AX_LES INTEGER,
> IDVEH INTEGER )
>RETURNS ( ALLCOUNT INTEGER
> , SPARECOUNT INTEGER)
>AS
>DECLARE VARIABLE AX INTEGER;
>BEGIN
> AX = 0;
> ALLCOUNT = 0;
> SPARECOUNT = 0;
>
>/* WHILE ( AX <= :AX_LES ) DO */
>/* BEGIN */
>
>
> SELECT * FROM AXLES
> WHERE AXPOS = :AX
> AND IDVEH = :IDVEH
>error ==> ORDER BY AXPOS;
>
>BEGIN
> IF (AXPOS = 0) THEN
>
>

for SELECT field1, field2, .... FROM AXLES
WHERE AXPOS = :AX
AND IDVEH = :IDVEH
ORDER BY AXPOS
into :var1, :var2,....
do BEGIN
IF (AXPOS = 0) THEN

You should use "for select" to loop trough a resultset in the "for
select " you put a "into :var1, var2" that will be your storage for the
fields values.

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/03/2005