Subject Re: RES: RES: RES: [firebird-support] Null and parameters
Author pi3k14
--- In firebird-support@yahoogroups.com, Fabrício Fadel Kammer
<ffkammer@c...> wrote:
>
> OK Alam,
>
> But the problem is the follow: I'm working in a module that export
the
> registers from the database to ascii files. This module works in
Oracle
> today. This solution is for optional parameters where the user can
fill
> or not it.
> The SQL that will recover the registers from the database is in a
file,
> than I open this file on my module, get the sql instruction and
recover
> the parameters than I show a grid with preformated fields to the
user
> fill the parameters.
> Then the stored procedures is not the ideal solution because I've
the
> leave free the tables that I'll use in the sql instruction.
> Some customers mine have the necessity to export data to predefined
> layouts that are used to do the integration with another softwares
and
> with this module I'll be able to create the ascii file layouts
without
> modify my software.
>
> Because this I need to create a form to have optional parameters on
the
> query... but the parameter must have on the query, because my system
> don't know how query it will have to run... I can have any query on
the
> text file.
>
> Did you understand my question?
>
> Regards
>
> Fabrício F. Kammer
>

Here is one strange ting you might try, it have helped in our cases:

/* declared as varchar, not cstring ! */
DECLARE EXTERNAL FUNCTION ib_strlen
varchar(32765) CHARACTER SET WIN1252
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';

SELECT C.NOME FROM CUSTOMERS AS C WHERE ib_strlen( :pCode ) = 0 OR C.
CODIGO = :pCode;

it seems like this does some runtime type checking and does the right
ting,

hth