Subject Re: [IBO] TIBOQuery and selectable SP
Author Lucas Franzen
Ronan,


Ronan van Riet schrieb:

> Hello Paul,
>
> I appreciate your helping me with this problem!
>
> I have not quite "got it" yet. Here is my SQL which is in my TIBQuery ( I
> have removed the parameter to simplify my problem )
>
> SELECT o_ROW_ID, o_created, o_last_upd, o_Last_Upd_by, o_projecttype,
^^^^^^^^^^^^^
I don't see that one in the ret urn params list.

> o_desc_text, o_Calcdate
> FROM SP_GET_MY_PROJECTS
>
> And here is my SP
>
> CREATE PROCEDURE SP_GET_MY_PROJECTS
> RETURNS (
> O_ROW_ID INTEGER,
> O_CREATED DATE,
> O_LAST_UPD DATE,
> O_PROJECTTYPE VARCHAR(30),
> O_DESC_TEXT VARCHAR(10),
> O_CALCDATE INTEGER)
> AS
> begin
> FOR
> SELECT prj.ROW_ID row_id, prj.created, prj.last_upd,
> prj.projecttype, prj.desc_text, prj.stage, prj.calcdate
> FROM E_PROJECT prj
> into :o_ROW_ID, :o_created, :o_last_upd,:o_projecttype, :o_desc_text,
> :o_stage, :o_Calcdate
> DO
> SUSPEND;

^^^change that to:
DO BEGIN
SUSPEND;
END

You'll appreciate this as soon as you're going to extend it.

> When I call
>
> with IBO_QRY_MY_PROJECT do begin
> if not prepared then prepare;
> IBO_QRY_MY_PROJECT.Active := true;
> end;
>
> the error message is 'Invalid request handle'.
>
> Again, what is causing this?

Do you have KEyLinks defined for the query?
Don't do that when selecting from StoredProcs.

Do you have RequestLive set to true?

Does it make a difference when you open your query instead of setting
ACTIVE := TRUE (though I doubt that one; it's just an old habit of mine,
opening a dataset ;-))

Take a new query and enter the SQL and see what happens (I'm quite sure
there's something).

Maybe you can post the query settings from the dfm

Luc.