You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by German Gonzalez <ge...@gmail.com> on 2005/07/11 16:24:52 UTC

Re: Auto-generated keys using Sybase

I have a similar problem, but with firebird db.

I use the following query to get a key from a trigger.

SELECT gen_id(GEN_SOLICITUDCERTIFICADO, 1) FROM rdb$database

but I get:
 com.ibatis.common.beans.BeanException: There is no READABLE property
named 'database   ' in class

that it seems ibatis parses "$database" as a property, and the problem
is that query is the only way to call that generator.

regards,

German Gonzalez





On 6/14/05, Engel, Gregory A <GA...@tribune.com> wrote:
> I'm using Sybase here and it is the same as MS SQL Server
> I do this inside the insert.
> 
>         <selectKey resultClass="long" keyProperty="id">
>                 SELECT @@identity as id
>         </selectKey>
> 
> Straight from the help files....
> 
> 
> 
> 
> 
> 
> 
>

Re: Auto-generated keys using Sybase

Posted by Daniel Henrique Ferreira e Silva <dh...@gmail.com>.
Hi German,

The $ character is a special character to iBATIS.
I guess you have to escape it, using $$.
That should work.

Cheers,
Daniel Silva.

On 7/11/05, German Gonzalez <ge...@gmail.com> wrote:
> I have a similar problem, but with firebird db.
> 
> I use the following query to get a key from a trigger.
> 
> SELECT gen_id(GEN_SOLICITUDCERTIFICADO, 1) FROM rdb$database
> 
> but I get:
>  com.ibatis.common.beans.BeanException: There is no READABLE property
> named 'database   ' in class
> 
> that it seems ibatis parses "$database" as a property, and the problem
> is that query is the only way to call that generator.
> 
> regards,
> 
> German Gonzalez
> 
> 
> 
> 
> 
> On 6/14/05, Engel, Gregory A <GA...@tribune.com> wrote:
> > I'm using Sybase here and it is the same as MS SQL Server
> > I do this inside the insert.
> >
> >         <selectKey resultClass="long" keyProperty="id">
> >                 SELECT @@identity as id
> >         </selectKey>
> >
> > Straight from the help files....
> >
> >
> >
> >
> >
> >
> >
> >
>