Subject | [firebird-support] Re: still incorrect results ? |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2006-10-17T13:23:41Z |
No Martin, I have no good explanation. The thought that came to mind,
though, was that maybe it is related to character set or collation
trouble. I don't know if it is possible to specify character set and
collation for parameters, but try to do something like
CREATE TEST (
asterm_in varchar(240) character set unicode_fss collate de_de,
id_in bigint)
returns (
asterm_temp varchar(240) character set unicode_fss collate de_de,
number integer)
HTH,
Set
martinknappe wrote:
though, was that maybe it is related to character set or collation
trouble. I don't know if it is possible to specify character set and
collation for parameters, but try to do something like
CREATE TEST (
asterm_in varchar(240) character set unicode_fss collate de_de,
id_in bigint)
returns (
asterm_temp varchar(240) character set unicode_fss collate de_de,
number integer)
HTH,
Set
martinknappe wrote:
> 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 =3D
> :ASTERM_in and id >=3D :id_in or ASTERM > :ASTERM_in order by ASTERM
> ascending into :ASTERM_temp do
> begin
> if (asterm_temp =3D asterm_in) then
> id_prior =3D id_in;
> else
> id_prior =3D 0;
> select count(id) from dicentries where asterm =3D :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=3Dpl (1) 1
> Lager, n sg=3Dpl (2) 1
> Lager, n sg=3Dpl (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=FCr) 1
> Roadster-Cabriolet, n 1
> Roadster, m 1
> Rohrleitung, f 1
>
> now, when i execute a simple
>
> select count(id) from dicentries where asterm =3D 'Mustereintrag, m'
>
> I get the correct result (which is 4)
>
> Does anyone have an explanation for this behavior?
>
>
> thanx
>
> martin