Subject Re: [IBO] TIBOQuery and selectable SP
Author Paul Vinkenoog
Hello Ronan,

> I am having problems retrieving a dataset with my TIBOQuery.
>
> My SQL looks like: EXECUTE PROCEDURE
> SP_GET_MY_PROJECTS(:I_CST_CON_ID) SP_MY_PROJECTS can return
> multiple records in the dataset, when I call the SP from IBExpert.

Then it's a selectable stored procedure, but you are calling it like
an executable SP. Change your query's SQL to:

select <field list> from sp_get_my_projects( :i_cst_con_id )
[where... ]
[order by...]

If the procedure were executable and it returned values, you should
add "...returning_values :outputfield1 :outputfield2..." to your
original SQL, and use a TIB_DSQL instead of a query.

> I am using the following code to retieve the dataset.
>
> with IBO_QRY_MY_PROJECT do begin
> Close;
> if not prepared then prepare;
> ParamByName('i_CST_CON_ID').Value :=
> pWebApp.Literal['CST_CON_ID'];
> IBO_QRY_MY_PROJECT.Active := true;
> end;

You don't need the Close; if RefreshOnParamChange is true (the
default) assigning the parameter value will automatically refresh
the query.


Hope this helps,
Paul Vinkenoog