Subject | RE: [firebird-support] COALESCE with parameters (IBPP, IBEXPERT or Firebird?) |
---|---|
Author | mimmo.masotti@tin.it |
Post date | 2004-08-26T09:28:31Z |
Hi, all.
I made some cut-and-paste errors; maybe this morning I'd be in-line with
brain.
Environment: Firebird 1.5.1 running in a Win2K virtual machine (VKware).
Original database with all char and varchar fields defined with charset
WIN_1252.
Original statement (working with various ODBC drivers):
is really WIN_1252;
anyway then IBPP::Status.ErrorMessage() is not very precise (IMMHO).
The same statement in last version of IBEXPERT
test parameter passing in COALESCE to Firebird?
TIA to all.
Ciao.
Mimmo.
I made some cut-and-paste errors; maybe this morning I'd be in-line with
brain.
Environment: Firebird 1.5.1 running in a Win2K virtual machine (VKware).
Original database with all char and varchar fields defined with charset
WIN_1252.
Original statement (working with various ODBC drivers):
>SELECT FIELD_1, FIELD_2, FIELD_3, FIELD_4When I do Statement.Prepare()
> FROM TABLE_1
> WHERE ( FIELD_2 LIKE COALESCE ( ?, '' ) || '%' )
> AND (FIELD_4 <> 'P')
>
>... results in "feature not supported" error with IBPP.Anyway, ASAP (maybe tomorrow), I'll control if Database charset connection
is really WIN_1252;
anyway then IBPP::Status.ErrorMessage() is not very precise (IMMHO).
The same statement in last version of IBEXPERT
>SELECT FIELD_1, FIELD_2, FIELD_3, FIELD_4(parameters are written differently ;-) )
> FROM TABLE_1
> WHERE ( FIELD_2 LIKE COALESCE ( :pippo, '' ) || '%' )
> AND (FIELD_4 <> 'P')
>
> ... when the parameter is NULL, there is no error...and result set is as expected...
> , viceversa <BR>the above<BR>
>giving the parameter any not null value IBEXPERT complain with a <BR>
>"...truncation or transliteration error"
><BR>
>OK: maybe COALESCE is not well understood by interfaces in WHERE clause.<BR>
>Then I created a NEW blank database, charset NONE, and tested<BR>
><BR>
>SELECT COALESCE ( :pippo, '' ) || '%' FROM RDB$DATABASE<BR>
><BR>
>As expected if the parameter is null, statement works, otherwise gives
>error.<BR>This demonstrates that IBEXPERT has a little glitch, but how I can really
test parameter passing in COALESCE to Firebird?
TIA to all.
Ciao.
Mimmo.