|Subject||RE: [firebird-support] Dynamic Query in Firebird|
> CREATE PROCEDURE SPDYNAMICQUERY (sqlquery varchar(1024))if your framework used, for example, an IBOBjects query component, then the
> returns (outputvalue varchar(1024)) <= how to make this
> parameter dynamic?
> declare variable sql varchar(1024);
> execute statement :sqlquery into :outputvalue; <= this valid for
> 1 return value only
> The main purpose of the stored procedure is execute a SQL query.
> We have several stored procedures and our framework will execute
> them by passing into SPDYNAMICQUERY.
> Query 1 : Select users.userid, users.username from users
> Query 2 : Select accounts.accountid, accounts.balance,
> accounts.isexpired from accounts
> NOTE that query1 returns 2 values (int, string) and query 2
> returns 3 values (int, money, boolean). SPDYNAMICQUERY doesn't
> know how many input parameter and its datatypes.
> Are there any approach for this problem using Firebird Stored Procedure?
SQL could be placed in the SQL property, and the query would parse it,
execute it and you would have a set of fields back as you woulkd expect