Subject Re: RES: RES: RES: [firebird-support] Null and parameters
Author Adam
--- In, 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?

Yes, but as was advised to you before, there is no generic
substitutable variable for a portion of SQL statement. Paramaters may
look like it at first are but they are very different. Parameters only
represent a value that will be placed in the query. You can not use a
parameter in place of a field name as you have tried to do, which is
why your code did not work.

You have decided you can not use stored procedures, and there is no
other mechanism for dynamically building a query on the server side
apart from execute statement, so I can not see any other way of
achieving what you are after.


<trimming post>