ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Using a stored proc in selectKey?
Date Wed, 06 Apr 2005 16:46:52 GMT
AFAIK we don't support CallableStatement in the selectKey. If you
would like it to be, go ahead and place an enhancement  request in
JIRA. But, i would think that if you are doing something like you are
describing, you would simply make your inserts all store procedures
and handle the increment internally. You can then set an OUT parameter
for the ID to pass back into your object.

BTW, Isn't a stored proc a proprietary approach?

Brandon

On Apr 6, 2005 10:35 AM, Adriano Labate <adriano.labate@sportaccess.com> wrote:
> Hi,
> 
> Is it possible to call an Oracle stored procedure in order to get the id
> in the selectKey tag?
> 
> My stored proc is defined as :
> 
> CREATE OR REPLACE PROCEDURE SP_GET_NEXT_ID(nIDTYPE IN NUMBER, nNEXTID
> OUT NUMBER) as
> nIDTYPEBUF NUMBER;
> nTheNewId NUMBER;
> ...
> 
> Where
> 
> IN : The idtype to be generated
>         1,PERSONID
>         2,PERSONTYPEID
>         3,CATEGORYID
>         ...
> OUT : The next id for the type input (nIDTYPE)
>       -1 (Error in the IDTYPE input)
> 
> I know I can use an Oracle sequence, but the reason we are using a
> stored proc is because we don't want the DB client has to deal with a
> proprietary sequence.
> 
> So, is it possible to call that stored proc in the <selectKey> section?
> 
> Thanks,
> Adriano
>

Mime
View raw message