Subject | Re: Re[2]: [Firebird-Architect] RFC: Please unify stored procedure execution |
---|---|
Author | Martijn Tonies |
Post date | 2004-12-21T10:48:58Z |
> MT> if there's more than 1 row. With Firebird, you don't know IF thisactually
> MT> happens because you don't know if you should call it with SELECT orNo, you're wrong. Let me tell you why...
> MT> EXEC.
>
> There is only one call type of stored procedures. EXECUTE PROCEDURE.
>
> SELECT * from StoredProc is not a "stored procedure call". It is
> a select statement that uses output from stored procedure to return
> it as a result set. Ability to select from SP is just IB/FB feature,
> and feature of SELECT statement.
In IB/Fb, there is only 1 type of call to a procedure. But, in Java speak,
when you "call" a procedure, it can be a procedure on any database engine.
Next, this procedure can return output parameters OR it can return a
resultset. (eg: a MS SQL procedure). So, Java has a facility to return a
resultset from a stored procedure call.
To convert this generic Java-calling mechanism to Firebird, you should use
either EXEC or SELECT (when you want to return a resultset). The problem
is, that with Firebird, you cannot really know if it returns a resultset.
That is
the problem.
Don't think "I know how to use my stored procedure", but think "inside a
driver, with a specification from someone else, how do I know to return
a resultset and not a single set of output parameters".
Hope this helps.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com