ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject SOLVED Re: oracle sequence trouble
Date Wed, 05 Jan 2005 22:02:23 GMT
Well I found the error but I wonder if it could be solved for others in 
the future.

I was missing the "as value" in the sqlmap.

<select id="getNextId" resultClass="string">
         select CurrentId.NextVal as value from dual
</select>

Is there anyway that sqlmaps could check if there is only one column 
coming back and assume that this is the value for implicit resultmaps?

Nathan
On Jan 5, 2005, at 2:58 PM, Nathan Maves wrote:

> That is nice but I want to use it as its own select statement so that 
> it can be re-used for other things.
>
> Nathan
>
> On Jan 5, 2005, at 2:54 PM, Brandon Goodin wrote:
>
>> see page 14 of the SQLMaps manual.
>>
>>
>> On Wed, 05 Jan 2005 14:45:21 -0700, Nathan Maves 
>> <Nathan.Maves@sun.com> wrote:
>>> This one is really stumping me.  Anyone else ever had such a problem?
>>> This seems so trivial but it is hold up a ton of development :)
>>>
>>>
>>> On Jan 5, 2005, at 12:24 PM, Nathan Maves wrote:
>>>
>>>> I jest created this sequence today and I works fine from the command
>>>> line but it returns null from ibatis.  Are there any tricks when 
>>>> using
>>>> sequences?
>>>>
>>>> Here are the logs...
>>>>
>>>> DEBUG 01-05 12:21:56 Checked out connection 10110166 from pool.
>>>> (SimpleDataSource.java:563)
>>>> DEBUG 01-05 12:21:56 {conn-100087} Connection
>>>> (ConnectionLogProxy.java:42)
>>>> DEBUG 01-05 12:21:56 {pstm-100088} PreparedStatement:          
>>>> select
>>>> CurrentId.NextVal from dual       
>>>> (PreparedStatementLogProxy.java:48)
>>>> DEBUG 01-05 12:21:56 {pstm-100088} Parameters: []
>>>> (PreparedStatementLogProxy.java:49)
>>>> DEBUG 01-05 12:21:56 {pstm-100088} Types: []
>>>> (PreparedStatementLogProxy.java:50)
>>>> DEBUG 01-05 12:21:56 {rset-100089} ResultSet
>>>> (ResultSetLogProxy.java:41)
>>>> DEBUG 01-05 12:21:56 Returned connection 10110166 to pool.
>>>> (SimpleDataSource.java:527)
>>>>
>>>> Here is from the command line...
>>>>
>>>> Connected to:
>>>> Oracle9i Enterprise Edition Release 9.2.0.2.0 - Production
>>>> With the Partitioning and Oracle Data Mining options
>>>> JServer Release 9.2.0.2.0 - Production
>>>>
>>>> SQL> select CurrentId.NextVal from dual;
>>>>
>>>>    NEXTVAL
>>>> ----------
>>>>      20025
>>>>
>>>> SQL> exit
>>>>
>>>> They are both using the same user/passwd.
>>>>
>>>
>>>
>


Mime
View raw message