Subject | RE: [IBO] DSQL and EXECUTE PROCEDURE |
---|---|
Author | Roger Vellacott |
Post date | 2006-03-06T09:35:25Z |
Why can't you just select it and display it in the grid?
SELECT * FROM PROC_NAME(:PARAM_1,:PARAM_2)
It then behaves just like any other dataset.
You can join it to another query like this:
SELECT A.*,B.* FROM TABLE_A A
LEFT OUTER JOIN PROC_NAME(A.FLD_1,A.FLD_2) B
ON 1 = 1
I don't think you should do this if the procedure makes any data
modifications in the process of returning its values. I seem to
remember that Helen says you shouldn't do so in her book, and in case
you need any further reason, It seems to screw up IBOs automatic
transaction handling and the modified records remain busy for ever.
Roger Vellacott
-----Original Message-----
From: Martijn Tonies [mailto:m.tonies@...]
Sent: 06 March 2006 09:02
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] DSQL and EXECUTE PROCEDURE
Hello Helen,
in the .Params property? .Fields? How would this be visible
in a grid, if at all?
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS
SQL
Server
Upscene Productions
http://www.upscene.com <http://www.upscene.com>
My thoughts:
http://blog.upscene.com/martijn/ <http://blog.upscene.com/martijn/>
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
<http://www.databasedevelopmentforum.com>
________________________________________________________________________
___
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.
________________________________________________________________________
___
http://www.ibobjects.com <http://www.ibobjects.com> - your IBO
community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
SPONSORED LINKS
Oracle database software Database management software Database
design software
Database development software Resume database software
Membership database software
_____
YAHOO! GROUPS LINKS
* Visit your group " IBObjects
<http://groups.yahoo.com/group/IBObjects> " on the web.
* To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com
<mailto:IBObjects-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
_____
SELECT * FROM PROC_NAME(:PARAM_1,:PARAM_2)
It then behaves just like any other dataset.
You can join it to another query like this:
SELECT A.*,B.* FROM TABLE_A A
LEFT OUTER JOIN PROC_NAME(A.FLD_1,A.FLD_2) B
ON 1 = 1
I don't think you should do this if the procedure makes any data
modifications in the process of returning its values. I seem to
remember that Helen says you shouldn't do so in her book, and in case
you need any further reason, It seems to screw up IBOs automatic
transaction handling and the modified records remain busy for ever.
Roger Vellacott
-----Original Message-----
From: Martijn Tonies [mailto:m.tonies@...]
Sent: 06 March 2006 09:02
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] DSQL and EXECUTE PROCEDURE
Hello Helen,
> >I should have explained better...So, this won't return a resultset, but will create, what? Objects
> >
> >
> >In Database Workbench, someone wants to execute a procedure and
> >see the results. Now, this can be done via "Run" on a procedure, but
> >this customers says that this is supported in DSQL, so it should work
> >from the SQL Editor. The SQL Editor has a grid in which it can
> >display result sets.
> >
> >But as far as I can see, EXECUTE PROCEDURE ...
> >RETURNING_VALUES doesn't do a resultset.
>
> That's the wrong syntax for DSQL. That's PSQL you are quoting there.
>
>
> >If I would be writing this:
> >EXECUTE PROCEDURE FOO (:p1) RETURNING_VALUES :p2
> >
> >would that work? Would "p2" get the value?
>
> No. PSQL doesn't work in DSQL.
>
> EXECUTE PROCEDURE FOO (:p1);
>
> When it's prepared, the server will send the description of the
> xsqlvar back in the xsqlda structure; then the dataset will know to
> anticipate the return value.
in the .Params property? .Fields? How would this be visible
in a grid, if at all?
> > > TIBOStoredProc is also a TIBODataset descendant. Use ExecProcthere.
> > >use
> > > But why would you use a dataset component at all, when you could
> >TIB_DSQL?*g* ... it is :)
> >
> >Because it's linked to a 3rd party grid via the "dataset" property :)
>
> Weird grid. Should be linked via the datasource property. :-)
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS
SQL
Server
Upscene Productions
http://www.upscene.com <http://www.upscene.com>
My thoughts:
http://blog.upscene.com/martijn/ <http://blog.upscene.com/martijn/>
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
<http://www.databasedevelopmentforum.com>
________________________________________________________________________
___
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.
________________________________________________________________________
___
http://www.ibobjects.com <http://www.ibobjects.com> - your IBO
community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
SPONSORED LINKS
Oracle database software Database management software Database
design software
Database development software Resume database software
Membership database software
_____
YAHOO! GROUPS LINKS
* Visit your group " IBObjects
<http://groups.yahoo.com/group/IBObjects> " on the web.
* To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com
<mailto:IBObjects-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
_____