Subject Re: [IBO] DSQL and EXECUTE PROCEDURE
Author Martijn Tonies
Hello Helen,

> > > 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.
> >
> >So, this won't return a resultset, but will create, what? Objects
> >in the .Params property? .Fields? How would this be visible
> >in a grid, if at all?
>
> In native IBO, Params are inputs and Fields are outputs. In TDataset,
> Params are both input and output, and determined by ParamType
> (ptInput, ptOutput). You'll need to test what you're getting in
> TIBODataset but it's possibly surfacing the TDataset behaviour.
>
> Why would you use a grid for a single row of output? Grids are for
> SELECT statements.

I know. The grid is just always visible -- when you do an "insert",
"update" or "delete", it just doesn't display anything. Same for DDL.

The thing is, that this customer expects being able to run the EXECUTE
in this SQL Editor.

> Yes, I know you said you were using TIBODataset because you had some
> spiffy grid you wanted to use...but you don't get rows as output to
> an executable procedure, you get a single set of values (one for each
> output arg).

See above.

> The only way I know of that you're going to get "griddable" output is
> to put a SUSPEND statement in the SP and select from it. But that's
> doesn't work with your data interface, which is designed to work with
> multi-row output.

Yep. That's why I have a "run procedure" under the right mouse
click or in the Procedure Editor -> depending on whether the
procedure is an "executable" or "selectable", it displays a different
result window -> either a grid, or a param=value kind of grid-like
output.

> You could have a look at how Lorenzo does it in IBOConsole. He has a
> separate interface for executable DSQL and delivers the result into
> fields. Or look at the DSQL tab of Jason's IB_SQL.
>
> I'm wondering how you cope with interactive DDL in DBW....do you
> display an empty grid afterwards, or what?

See above, yes -> just no display linked to the grid. The interface is
always the same.

Anyway, the documentation (IB) says that EXECUTE PROCEDURE
is available in DSQL, is that incorrect:

DSQL form:
EXECUTE PROCEDURE name [param [, param .]]
[RETURNING_VALUES param [, param .]]

I guess that some people could think that you could return a single
non-editable row from an EXECUTE as well.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, 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