Subject Re: [IBO] Re: TIBODataset and EXECUTE PROCEDURE with output parameters
Author Martijn Tonies
Jason,


> > > If it were a TIB_Query you would not find the output from an
> > > executable procedure in Params, but in Fields. Have you checked to
> > > see whether this is the case with TIBOQuery? I'd have to set up a
> > > test app myself to answer that question...
> >
> > Fields stay empty, only Params gets filled.
>
> I setup a sample of how TIBOQuery is supposed to work using the sample
> database indicated below. Anyone can try this at home...
>
> object IBOQuery2: TIBOQuery
> Params = <
> item
> DataType = ftString
> Name = 'head_dept'
> ParamType = ptInput
> end
> item
> DataType = ftFloat
> Name = 'TOT_BUDGET'
> ParamType = ptOutput
> end
> item
> DataType = ftFloat
> Name = 'AVG_BUDGET'
> ParamType = ptOutput
> end
> item
> DataType = ftFloat
> Name = 'MIN_BUDGET'
> ParamType = ptOutput
> end
> item
> DataType = ftFloat
> Name = 'MAX_BUDGET'
> ParamType = ptOutput
> end>
> DatabaseName = 'C:\Program Files\Common Files\Borland
> Shared\Data\employee.gdb'
> IB_Connection = IB_Database1
> SQL.Strings = (
> 'execute procedure SUB_TOT_BUDGET( :head_dept )')
> end

You're creating the params yourself? Cause I haven't. IBO creates them for
me
when I do a "Prepare". It also detects "input/output", but I just cannot get
a result.

> procedure TForm1.Button2Click(Sender: TObject);
> begin
> IBOQuery2.ParamByName( 'head_dept' ).AsInteger := 100;
> IBOQuery2.ExecSQL;
> ShowMessage( IBOQuery2.ParamByName( 'TOT_BUDGET' ).AsString );
> end;
>
>
> When I ran this it worked exactly as I suspected. It executed the
procedure
> and the answer was available in the parameter.
>
>
> Not sure what more I can do to help as it appears IBO does just what I
> expect it should.

In other news, did you get my test project about re-using the same TIBOQuery
with different (or the same!) statements and the error that you get then?

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com