Subject Re: [IBO] Unidirectional Cursor
Author Helen Borrie (TeamIBO)
At 03:35 PM 10-01-02 -0800, you wrote:
>What would be the best IBO component/settings to do something like :
>
>prepare;
>first;
>while not eof do
>{read field values, and store elsewhere}
>next;
>close;

Bill,
TIB_Cursor is the obvious choice for doing this task if has to be done client side...but if it's not needed in the GUI, why not do it in the database in a SP? The processing is identical but there is no fetching and sending back.

create procedure rollthru (input1, input2, ...)
as
declare variable v1 integer;
declare variable v2 char(8);
declare variable ....
begin
for select <the stuff that would have been in your SQL property>
where columna = :input1
and columnb = :input2
and...
into :v1, :v2, ...
do begin
do stuff
....
end
end

Using an IB_DSQL, with SQL:

execute procedure rollthru (:arg1, :arg2, ...)

Pass the parameter values to the IB_DSQL in BeforeExecute and there you have it - untouched outside of the database.


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at www.ibobjects.com