Subject | Problem with parameters of FOR SELECT cycle |
---|---|
Author | tomkrej |
Post date | 2008-09-03T08:03:58Z |
Hi, I have very interesting results of FOR SELECT cycle.
I'm using FB1.5.5 on WinXP.
I have two tables
RECORDS - name, id_rec, tridnaz (<- uppercase NAME)
VAZBY (relations) - id_nad, id_pod, typ_nadr
table of relations between records id_nad - master, id_pod - slave,
typ_nadr - type of relation - master/slave(0) or equality(1)
I have procedure that returns record ID by its name, and then all
related IDs from VAZBY table with typ_nadr = 1
output parameter is ID_ZAZ
for select id_rec from records where tridnaz starting with :text
into :id_zaz
do begin
suspend; // return master record
for select cis_pod from vazby where cis_nad = :id_zaz and typ_nadr = 1
into :id_zaz
do begin
suspend; // return slave record
end
end
When I debug this procedure in IBExpert, everything works fine, but
when I run this procedure - Select * from ... it returns only 2
records, master and 1st slave.
I have to alter procedure with new variable - id_aux
id_aux = id_zaz;
for select cis_pod from vazby where cis_nad = :id_aux ...
Now it works fine, but is this expected result ??
Tom
I'm using FB1.5.5 on WinXP.
I have two tables
RECORDS - name, id_rec, tridnaz (<- uppercase NAME)
VAZBY (relations) - id_nad, id_pod, typ_nadr
table of relations between records id_nad - master, id_pod - slave,
typ_nadr - type of relation - master/slave(0) or equality(1)
I have procedure that returns record ID by its name, and then all
related IDs from VAZBY table with typ_nadr = 1
output parameter is ID_ZAZ
for select id_rec from records where tridnaz starting with :text
into :id_zaz
do begin
suspend; // return master record
for select cis_pod from vazby where cis_nad = :id_zaz and typ_nadr = 1
into :id_zaz
do begin
suspend; // return slave record
end
end
When I debug this procedure in IBExpert, everything works fine, but
when I run this procedure - Select * from ... it returns only 2
records, master and 1st slave.
I have to alter procedure with new variable - id_aux
id_aux = id_zaz;
for select cis_pod from vazby where cis_nad = :id_aux ...
Now it works fine, but is this expected result ??
Tom