ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 13196] New: - SqlExec does not correctly insert strings with '--' in ORACLE
Date Wed, 02 Oct 2002 09:36:51 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13196>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13196

SqlExec does not correctly insert strings with '--' in ORACLE

           Summary: SqlExec does not correctly insert strings with '--' in
                    ORACLE
           Product: Ant
           Version: 1.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: pete.cant@digitalbridges.com


Running this target,

<project name="UnityJ2MEAntBasedTools" default="init">

  <target name="dbtest">
    <sql driver="oracle.jdbc.driver.OracleDriver" url="${db.ip}" 
userid="${uname}" password="${passw}" onerror="continue" encoding="UTF-8">
      <transaction src="${basedir}/trans.sql"/>
        <classpath>
          <fileset dir="${basedir}/lib">
            <include name="classes12.jar"/>
          </fileset>
        </classpath>
    </sql>
  </target>
</project>

with contents of trans.sql of ,

INSERT INTO TB_J2ME_TRANSLATIONS_REF (TEXT_ID, VIEW_NAME, SERVICE_ID,PORTAL_ID, 
CHAR_SET_ID, LANG_ID,TEXT)
VALUES (410050,'SYSTEM',10000,-1,1,25,'------');


produces

dbtest:
      [sql] Executing file: C:\stuff\trans.sql
      [sql] Failed to execute: INSERT INTO TB_J2ME_TRANSLATIONS_REF (TEXT_ID, 
VIEW_NAME, SERVICE_ID,PORTAL_ID, CHAR_SET_ID, LANG_ID,TEXT) VALUES 
(410050,'SYSTEM
',10000,-1,1,25,'------');
      [sql] java.sql.SQLException: ORA-00911: invalid character
      [sql] 0 of 1 SQL statements executed successfully


This is due to the way SqlExec parses the statements it thinks anything 
starting -- is a database comment.

This effectively means I cannot use ANT's sql task with an ORACLE database.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message