Subject | Re: incorrect results, still :-( |
---|---|
Author | martinknappe |
Post date | 2006-10-17T08:59:37Z |
Now, this is REALLY WEIRD and seems to be the reason for my incorrect
result set:
CREATE TEST (
asterm_in varchar(240),
id_in bigint)
returns (
asterm_temp varchar(240),
number integer)
as
declare variable id_prior bigint;
begin
for select first 20 distinct ASTERM from dicentries where ASTERM =
:ASTERM_in and id >= :id_in or ASTERM > :ASTERM_in order by ASTERM
ascending into :ASTERM_temp do
begin
if (asterm_temp = asterm_in) then
id_prior = id_in;
else
id_prior = 0;
select count(id) from dicentries where asterm = :asterm_temp
into :number;
suspend;
end
end
with select * from test('Lackreiniger, m', 34) I get the following
result set:
asterm_temp number
Lackreiniger, m 2
Lager, n sg=pl (1) 1
Lager, n sg=pl (2) 1
Lager, n sg=pl (3) 1
Leitung, f (1) 0 //what? how can this be zero
Leitung, f (2) 0 //when we just selected it?
Luft-Steuerventil, n 1
Luftumleitventil, n 1
lackieren, vt 1
Microsoft-Sound, m 1
Modul, m 1
Modul, n 1
Mustereintrag, m 0 //the same: how can this be zero? see below
Nacktschnecke, f 0
Oben-ohne-Auto, n 1
offenes Auto, n 0
opfern, sich (für) 1
Roadster-Cabriolet, n 1
Roadster, m 1
Rohrleitung, f 1
now, when i execute a simple
select count(id) from dicentries where asterm = 'Mustereintrag, m'
I get the correct result (which is 4)
Does anyone have an explanation for this behavior?
thanx
martin
result set:
CREATE TEST (
asterm_in varchar(240),
id_in bigint)
returns (
asterm_temp varchar(240),
number integer)
as
declare variable id_prior bigint;
begin
for select first 20 distinct ASTERM from dicentries where ASTERM =
:ASTERM_in and id >= :id_in or ASTERM > :ASTERM_in order by ASTERM
ascending into :ASTERM_temp do
begin
if (asterm_temp = asterm_in) then
id_prior = id_in;
else
id_prior = 0;
select count(id) from dicentries where asterm = :asterm_temp
into :number;
suspend;
end
end
with select * from test('Lackreiniger, m', 34) I get the following
result set:
asterm_temp number
Lackreiniger, m 2
Lager, n sg=pl (1) 1
Lager, n sg=pl (2) 1
Lager, n sg=pl (3) 1
Leitung, f (1) 0 //what? how can this be zero
Leitung, f (2) 0 //when we just selected it?
Luft-Steuerventil, n 1
Luftumleitventil, n 1
lackieren, vt 1
Microsoft-Sound, m 1
Modul, m 1
Modul, n 1
Mustereintrag, m 0 //the same: how can this be zero? see below
Nacktschnecke, f 0
Oben-ohne-Auto, n 1
offenes Auto, n 0
opfern, sich (für) 1
Roadster-Cabriolet, n 1
Roadster, m 1
Rohrleitung, f 1
now, when i execute a simple
select count(id) from dicentries where asterm = 'Mustereintrag, m'
I get the correct result (which is 4)
Does anyone have an explanation for this behavior?
thanx
martin