You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "agharta (JIRA)" <ib...@incubator.apache.org> on 2005/04/30 11:46:05 UTC

[jira] Created: (IBATIS-117) Ibatis sql interpreter and firebird rdb$ problem

Ibatis sql interpreter and firebird rdb$ problem
------------------------------------------------

         Key: IBATIS-117
         URL: http://issues.apache.org/jira/browse/IBATIS-117
     Project: iBatis for Java
        Type: Bug
  Components: SQL Maps  
    Versions: 2.0.9b    
 Environment: All Operative systems, last release ibatis version. The problem is with firebird databases
    Reporter: agharta
    Priority: Blocker


Hi all!
I suppose that the problem is very serious:

I need to query the system tables of firebird database (rdb$ like tables).

example, get the next table id:

<statement id="getNextBookId" 
        resultClass="java.lang.Integer" >
        <![CDATA[
            SELECT GEN_ID(seq_book,1) from RDB$DATABASE
        ]]>
</statement>
    

This query should return the nezt id available for an associated table (in this case, my BOOK table).

Problem: the character '$' is interpreted by ibatis like a parameter.

Result: 

Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in Book.xml.  
--- The error occurred while preparing the mapped statement for execution.  
--- Check the Book.getNextBookId.  
--- Check the SQL statement.  
--- Cause: java.util.NoSuchElementException
Caused by: java.util.NoSuchElementException


Ibatis does not read correctly the query and query fails!

I've used the #value# to substitute with 'RDB$DATABASE', but nothing!



Any idea??

My work will stops....



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-117) Ibatis sql interpreter and firebird rdb$ problem

Posted by "agharta (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-117?page=comments#action_64187 ]
     
agharta commented on IBATIS-117:
--------------------------------

Hi all,
Thanks for the suggestion.

I'm sorry, but i've not read the faq.

Sorry again.


> Ibatis sql interpreter and firebird rdb$ problem
> ------------------------------------------------
>
>          Key: IBATIS-117
>          URL: http://issues.apache.org/jira/browse/IBATIS-117
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9b
>  Environment: All Operative systems, last release ibatis version. The problem is with firebird databases
>     Reporter: agharta
>     Assignee: Clinton Begin
>     Priority: Blocker

>
> Hi all!
> I suppose that the problem is very serious:
> I need to query the system tables of firebird database (rdb$ like tables).
> example, get the next table id:
> <statement id="getNextBookId" 
>         resultClass="java.lang.Integer" >
>         <![CDATA[
>             SELECT GEN_ID(seq_book,1) from RDB$DATABASE
>         ]]>
> </statement>
>     
> This query should return the nezt id available for an associated table (in this case, my BOOK table).
> Problem: the character '$' is interpreted by ibatis like a parameter.
> Result: 
> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
> --- The error occurred in Book.xml.  
> --- The error occurred while preparing the mapped statement for execution.  
> --- Check the Book.getNextBookId.  
> --- Check the SQL statement.  
> --- Cause: java.util.NoSuchElementException
> Caused by: java.util.NoSuchElementException
> Ibatis does not read correctly the query and query fails!
> I've used the #value# to substitute with 'RDB$DATABASE', but nothing!
> Any idea??
> My work will stops....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-117) Ibatis sql interpreter and firebird rdb$ problem

Posted by "agharta (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-117?page=comments#action_64148 ]
     
agharta commented on IBATIS-117:
--------------------------------

Hi, 
I've resolved the problem:

I've passed the $operator$ value contains the table name:

<statement id="getNextBookId" 
        resultClass="java.lang.Integer" parameterClass="java.lang.String">
        <![CDATA[
            SELECT GEN_ID(seq_book,1) from $db$
        ]]>
</statement>

where $db$ is 'RDB$DATABASE'.


It is a temporary solution, but work.


I hope to another solution (pass a table name into query is not a best pratice).


Bye!

> Ibatis sql interpreter and firebird rdb$ problem
> ------------------------------------------------
>
>          Key: IBATIS-117
>          URL: http://issues.apache.org/jira/browse/IBATIS-117
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9b
>  Environment: All Operative systems, last release ibatis version. The problem is with firebird databases
>     Reporter: agharta
>     Priority: Blocker

>
> Hi all!
> I suppose that the problem is very serious:
> I need to query the system tables of firebird database (rdb$ like tables).
> example, get the next table id:
> <statement id="getNextBookId" 
>         resultClass="java.lang.Integer" >
>         <![CDATA[
>             SELECT GEN_ID(seq_book,1) from RDB$DATABASE
>         ]]>
> </statement>
>     
> This query should return the nezt id available for an associated table (in this case, my BOOK table).
> Problem: the character '$' is interpreted by ibatis like a parameter.
> Result: 
> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
> --- The error occurred in Book.xml.  
> --- The error occurred while preparing the mapped statement for execution.  
> --- Check the Book.getNextBookId.  
> --- Check the SQL statement.  
> --- Cause: java.util.NoSuchElementException
> Caused by: java.util.NoSuchElementException
> Ibatis does not read correctly the query and query fails!
> I've used the #value# to substitute with 'RDB$DATABASE', but nothing!
> Any idea??
> My work will stops....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-117) Ibatis sql interpreter and firebird rdb$ problem

Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-117?page=comments#action_64157 ]
     
Brandon Goodin commented on IBATIS-117:
---------------------------------------

you can escape the $ character by typing it twice back to back $$. So your first comment example should be...


<statement id="getNextBookId"
        resultClass="java.lang.Integer" >
        <![CDATA[
            SELECT GEN_ID(seq_book,1) from RDB$$DATABASE
        ]]>
</statement> 

> Ibatis sql interpreter and firebird rdb$ problem
> ------------------------------------------------
>
>          Key: IBATIS-117
>          URL: http://issues.apache.org/jira/browse/IBATIS-117
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9b
>  Environment: All Operative systems, last release ibatis version. The problem is with firebird databases
>     Reporter: agharta
>     Priority: Blocker

>
> Hi all!
> I suppose that the problem is very serious:
> I need to query the system tables of firebird database (rdb$ like tables).
> example, get the next table id:
> <statement id="getNextBookId" 
>         resultClass="java.lang.Integer" >
>         <![CDATA[
>             SELECT GEN_ID(seq_book,1) from RDB$DATABASE
>         ]]>
> </statement>
>     
> This query should return the nezt id available for an associated table (in this case, my BOOK table).
> Problem: the character '$' is interpreted by ibatis like a parameter.
> Result: 
> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
> --- The error occurred in Book.xml.  
> --- The error occurred while preparing the mapped statement for execution.  
> --- Check the Book.getNextBookId.  
> --- Check the SQL statement.  
> --- Cause: java.util.NoSuchElementException
> Caused by: java.util.NoSuchElementException
> Ibatis does not read correctly the query and query fails!
> I've used the #value# to substitute with 'RDB$DATABASE', but nothing!
> Any idea??
> My work will stops....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (IBATIS-117) Ibatis sql interpreter and firebird rdb$ problem

Posted by "Clinton Begin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-117?page=all ]
     
Clinton Begin closed IBATIS-117:
--------------------------------

     Assign To: Clinton Begin
    Resolution: Invalid

See the FAQ.

> Ibatis sql interpreter and firebird rdb$ problem
> ------------------------------------------------
>
>          Key: IBATIS-117
>          URL: http://issues.apache.org/jira/browse/IBATIS-117
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9b
>  Environment: All Operative systems, last release ibatis version. The problem is with firebird databases
>     Reporter: agharta
>     Assignee: Clinton Begin
>     Priority: Blocker

>
> Hi all!
> I suppose that the problem is very serious:
> I need to query the system tables of firebird database (rdb$ like tables).
> example, get the next table id:
> <statement id="getNextBookId" 
>         resultClass="java.lang.Integer" >
>         <![CDATA[
>             SELECT GEN_ID(seq_book,1) from RDB$DATABASE
>         ]]>
> </statement>
>     
> This query should return the nezt id available for an associated table (in this case, my BOOK table).
> Problem: the character '$' is interpreted by ibatis like a parameter.
> Result: 
> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
> --- The error occurred in Book.xml.  
> --- The error occurred while preparing the mapped statement for execution.  
> --- Check the Book.getNextBookId.  
> --- Check the SQL statement.  
> --- Cause: java.util.NoSuchElementException
> Caused by: java.util.NoSuchElementException
> Ibatis does not read correctly the query and query fails!
> I've used the #value# to substitute with 'RDB$DATABASE', but nothing!
> Any idea??
> My work will stops....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira