Article View: borland.public.interbase.sql
Article #11048Re: Problem with procedure
From: Martijn Tonies
Date: Tue, 17 Dec 2002 17:27
Date: Tue, 17 Dec 2002 17:27
56 lines
2562 bytes
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."
Technical Details
Message-ID:
<3dff5dc1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3dff5a70$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114a0e,6a55799dfde6a31c X-Google-Attributes: gid114a0e,public X-Google-ArrivalTime: 2002-12-17 09:42:10 PST From: "Martijn Tonies" <m.tonies@upscene_remove.com> Newsgroups: borland.public.interbase.sql References: <3dff5a70$1@newsgroups.borland.com> Subject: Re: Problem with procedure Date: Tue, 17 Dec 2002 18:27:20 +0100 Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 212.238.179.102 Message-ID: <3dff5dc1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1040145857 212.238.179.102 (17 Dec 2002 09:24:17 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail