db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fox (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TORQUE-70) Escape Text in DBOracle not correct when using columns of type NVARCHAR2
Date Tue, 17 Apr 2012 09:53:18 GMT

    [ https://issues.apache.org/jira/browse/TORQUE-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13255437#comment-13255437
] 

Thomas Fox commented on TORQUE-70:
----------------------------------

I cannot reproduce this on Oracle Express 10 on Windows.

After running the test project on in maven (thus creating all tables), I changed the table
author as follows:
alter table author modify (name nvarchar2(200));
Then I re-ran the org.apache.torque.DataTest.testLikeClauseEscaping() test with no errors.

Are there any special database settigns which make this error occur ?
Or perhaps this was fixed on oracle-side in oracle 10 ?

                
> Escape Text in DBOracle not correct when using columns of type NVARCHAR2
> ------------------------------------------------------------------------
>
>                 Key: TORQUE-70
>                 URL: https://issues.apache.org/jira/browse/TORQUE-70
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 3.3
>         Environment: Oracle 9
>            Reporter: Tobias Hilka
>
> The default escape string for DBOracle is '\'. This works fine for VARCHAR2 columns.
This statement is correct in these cases:
> SELECT * FROM MYTABLE WHERE MYCOLUMN LIKE 'TEST\_%' ESCAPE '\'
> This escape string does not work for columns of type NVARCHAR2. Using this escape character
brings up the following error:
> ORA-01425: escape character must be character string of length 1 
> In case of columns of type NVARCHAR2 the correct escape character is N'\'. So the query
above has to be written as follows:
> SELECT * FROM MYTABLE WHERE MYCOLUMN LIKE 'TEST\_%' ESCAPE N'\'
> We need some kind of mechanism to switch the escape string depending on the column used
in the like statement. The problem is that at this point of execution, we don't have column
objects but just plain strings representing the column names.  (SQLExpression.buildLike(...))

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message