Subject | Re: [Firebird-Java] return value |
---|---|
Author | Helen Borrie |
Post date | 2002-07-12T10:19:03Z |
At 05:52 PM 12-07-02 +0800, you wrote:
If you want to return a value from a SP, you need to define it using the
RETURNS clause:
CREATE PROCEDURE MERGE_CONTENT (SRC INTEGER, DST INTEGER)
RETURNS (OK VARCHAR(1))
AS
BEGIN
OK = 'F'; /* initialise return value */
....
Two requests:
1. read the manuals
2. take SQL and server programming questions to the proper forum
(ib-support). This forum here is specifically for Java issues.
heLen
All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________
>Dear All,No; an EXIT statement does nothing except return control to the client.
>
>I have make a store procedure :
>
>"SET TERM ##;
>CREATE PROCEDURE MERGE_CONTENT (SRC INTEGER, DST INTEGER)
>AS
> BEGIN
> UPDATE REF_MASTER SET CATEGORY_ID = :DST WHERE CONTENT_ID IN
>(SELECT DISTINCT CONTENT_ID
> FROM REF_MASTER WHERE CATEGORY_ID = :SRC AND CONTENT_ID NOT IN (
> SELECT CONTENT_ID FROM REF_MASTER WHERE CATEGORY_ID = :DST)) AND
>CATEGORY_ID = :SRC;
> DELETE FROM M_CATEGORIES WHERE CATEGORY_ID = :SRC;
> EXIT;
> END ## "
>
>Then how to return value if i call from java with
>"preparedStatement.ExecuteUpdate()"
>
>Are with this "EXIT;" statement, this store procedure will return value if
>succes or not ?
If you want to return a value from a SP, you need to define it using the
RETURNS clause:
CREATE PROCEDURE MERGE_CONTENT (SRC INTEGER, DST INTEGER)
RETURNS (OK VARCHAR(1))
AS
BEGIN
OK = 'F'; /* initialise return value */
....
Two requests:
1. read the manuals
2. take SQL and server programming questions to the proper forum
(ib-support). This forum here is specifically for Java issues.
heLen
All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________