🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
3 messages
3 total messages Started by Gon�alo Martins Tue, 17 Dec 2002 17:10
Problem with procedure
#11046
Author: Gon�alo Martins
Date: Tue, 17 Dec 2002 17:10
35 lines
1913 bytes
Hello all. I've create the following procedure in IBConsole and runned ok.
Here's the procedure

SET TERM !!;
CREATE PROCEDURE UPDATE_TARAMEDIA
AS
DECLARE VARIABLE CHAVE INTEGER;
DECLARE VARIABLE TARA NUMERIC(8,2);
BEGIN
FOR
SELECT TARAMEDIA,CHAVE_LOTE FROM LOTE INTO :TARA, :CHAVE
DO
UPDATE AMOSTRA SET TARAMEDIA=(:TARA) WHERE CHAVE_LOTE_TME=(:CHAVE);
EXIT;
END !!
SET TERM !!;

This works fine.
I'm trying to do this in Delphi running an IBSQL query.
First, the
SELECT TARAMEDIA,CHAVE_LOTE FROM LOTE INTO :TARA, :CHAVE
gives an error on the INTO. If I take the : before the variables it runs
fine.
Second I run the query and it's ok, but when commit the transaction I get
this error:
invalid request BLR at offset 99 undefined message number

Any tips? I'm kind of lost here...

Ah, one last thing. If I replace the SET TARAMEDIA=(:TARA) with SET
TARAMEDIA=10 it works!!! the problem is in the variables.

Thanks

Goncalo
Re: Problem with procedure
#11048
Author: Martijn Tonies
Date: Tue, 17 Dec 2002 17:27
56 lines
2562 bytes
Hi,

> Hello all. I've create the following procedure in IBConsole and runned ok.
> Here's the procedure
>
> SET TERM !!;
> CREATE PROCEDURE UPDATE_TARAMEDIA
> AS
> DECLARE VARIABLE CHAVE INTEGER;
> DECLARE VARIABLE TARA NUMERIC(8,2);
> BEGIN
> FOR
> SELECT TARAMEDIA,CHAVE_LOTE FROM LOTE INTO :TARA, :CHAVE
> DO
> UPDATE AMOSTRA SET TARAMEDIA=(:TARA) WHERE CHAVE_LOTE_TME=(:CHAVE);

Where did you read the (:variable) syntax? Simple using :varname would do it.

> EXIT;
> END !!
> SET TERM !!;
>
> This works fine.
> I'm trying to do this in Delphi running an IBSQL query.
> First, the
> SELECT TARAMEDIA,CHAVE_LOTE FROM LOTE INTO :TARA, :CHAVE
> gives an error on the INTO. If I take the : before the variables it runs
> fine.

What are you running, the CREATE PROCEDURE? If so, do you set
ParamCheck to False?

> Second I run the query and it's ok, but when commit the transaction I get
> this error:
> invalid request BLR at offset 99 undefined message number
>
> Any tips? I'm kind of lost here...
>
> Ah, one last thing. If I replace the SET TARAMEDIA=(:TARA) with SET
> TARAMEDIA=10 it works!!! the problem is in the variables.

There's no problem with variables - there's a problem with your code.


--

With regards,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase & Firebird
Firebird Workbench - the developer tool for Firebird
Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."
Re: Problem with procedure
#11049
Author: Gon�alo Martins
Date: Tue, 17 Dec 2002 17:31
70 lines
2978 bytes
Martijn, thanks. It was a problem with the checkParam (never thought of
that).
Thanks a lot.
Best Regards

Goncalo

"Martijn Tonies" <m.tonies@upscene_remove.com> wrote in message
news:3dff5dc1@newsgroups.borland.com...
> Hi,
>
> > Hello all. I've create the following procedure in IBConsole and runned
ok.
> > Here's the procedure
> >
> > SET TERM !!;
> > CREATE PROCEDURE UPDATE_TARAMEDIA
> > AS
> > DECLARE VARIABLE CHAVE INTEGER;
> > DECLARE VARIABLE TARA NUMERIC(8,2);
> > BEGIN
> > FOR
> > SELECT TARAMEDIA,CHAVE_LOTE FROM LOTE INTO :TARA, :CHAVE
> > DO
> > UPDATE AMOSTRA SET TARAMEDIA=(:TARA) WHERE CHAVE_LOTE_TME=(:CHAVE);
>
> Where did you read the (:variable) syntax? Simple using :varname would do
it.
>
> > EXIT;
> > END !!
> > SET TERM !!;
> >
> > This works fine.
> > I'm trying to do this in Delphi running an IBSQL query.
> > First, the
> > SELECT TARAMEDIA,CHAVE_LOTE FROM LOTE INTO :TARA, :CHAVE
> > gives an error on the INTO. If I take the : before the variables it runs
> > fine.
>
> What are you running, the CREATE PROCEDURE? If so, do you set
> ParamCheck to False?
>
> > Second I run the query and it's ok, but when commit the transaction I
get
> > this error:
> > invalid request BLR at offset 99 undefined message number
> >
> > Any tips? I'm kind of lost here...
> >
> > Ah, one last thing. If I replace the SET TARAMEDIA=(:TARA) with SET
> > TARAMEDIA=10 it works!!! the problem is in the variables.
>
> There's no problem with variables - there's a problem with your code.
>
>
> --
>
> With regards,
>
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase & Firebird
> Firebird Workbench - the developer tool for Firebird
> Upscene Productions
> http://www.upscene.com
>
> "This is an object-oriented system.
> If we change anything, the users object."
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads