bug with variables, link & stored procedures ?

Steven Ophalvens silversoft at skynet.be
Thu Mar 27 07:59:12 CDT 2008


I got more problems using this workaround. At first this workaround seems to
work, but
upon subsequent calls of this stored procedure, using the declared variables
with a
'select' causes the original value to be used, not the value that it is
supposed to be :

Just a part of my stored procedure :
---
	print 'idtestresult = ';
	print idtestresult;
	print ' select idtestresult =';
	print (select idtestresult);
---
When I have run this stored procedure 3 times, I get the following in my
warnings log file:
---
Print : idtestresult = 
Print : 1
Print :  select idtestresult =
Print : 1
Print : idtestresult = 
Print : 2
Print :  select idtestresult =
Print : 1
Print : idtestresult = 
Print : 3
Print :  select idtestresult =
Print : 1
Print : idtestresult = 
Print : 4
Print :  select idtestresult =
Print : 1
---

So the variables themselves contain the correct value, but when called with
select, they don't
give the correct result. BUT I have to use it with a select to be able to
use the link statement,
because the link statement fails without the select keyword.

This is a real showtopper for me.

Any ideas?

Greetings,

Steven Ophalvens

-----Oorspronkelijk bericht-----
Van: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] Namens Steven Ophalvens
Verzonden: dinsdag 25 maart 2008 16:38
Aan: 'Valentina Developers'
Onderwerp: RE: link & stored procedures problem

Hello Ivan,

your workaround seems to work, thanks !

Greetings,

Steven Ophalvens

-----Oorspronkelijk bericht-----
Van: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] Namens Ivan Smahin
Verzonden: dinsdag 25 maart 2008 15:31
Aan: Valentina Developers
Onderwerp: Re: link & stored procedures problem

Hello Steven,

Tuesday, March 25, 2008, 12:25:27 PM, you wrote:

> Hello all,

> I am having some problems with a stored procedure that needs to link some
> records.
> It fails on the line with the link statement, telling me that the closing
> bracket ')'
> after 'idtestresult' in the first link statement is an unexpected token :

> 11:18:58: Error: Kernel error: 0x71000. line 18:27: unexpected token: )


> ----------
> Create or replace procedure [sp_answer_question](
>         IN correct boolean, 
>         IN testId long, 
>         IN VraagID long, 
>         IN IdStudentTest long,
>         in gebruikerID long)

> BEGIN

>         declare idtestresult long;
>         declare idtestvraag long;

>         insert into test_resultaten (juist) values (correct);

>         set idtestresult = SELECT Last_RecID('lpserver') as id;
>         set idtestvraag = select id from testVragen where test_id=testId
and
> vraag_id =VraagID;

>         link record (idtestresult) of test_resultaten 
>                 with record idtestvraag of testVragen 
>                 using link_test_resultaat_vraag;

>         link record (idtestresult) of test_resultaten 
>                 with record (IdStudentTest) of studenten_testen 
>                 using link_stud_test_resultaten;

> END
> ----------

> Am I doing something wrong, if so, what would that be?

Seems to be a bug - but you can try this workaround:

link record (select idtestresult) ...


-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com

_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina

__________ NOD32 2277 (20070518) Informatie __________

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl


_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina

__________ NOD32 2277 (20070518) Informatie __________

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl




More information about the Valentina mailing list