Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8551351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:10:38+00:00 2026-06-11T14:10:38+00:00

Context We’re changing our install scripts to use ant’s sql task and jdbc rather

  • 0

Context

We’re changing our install scripts to use ant’s “sql” task and jdbc rather than proprietary sql clients sqlplus (oracle) and osql (msft).

Updated: added more context. Our “base data” (seed data) consists of a collection of .sql files containing “vendor-neutral”(i.e. works both in oracle and mssql) sql statements.

The Problem

The scripts run fine, with one exception:

This sql fails in Oracle. Specifically, something (ant or jdbc driver) treats the dashes/hyphens as “beginning of a comment”–even though they are embedded in a string. Note that the same sql works fine with ant/sql and microsoft’s jdbc driver.

INSERT INTO email_client (email_client_id,generated_reply_text) VALUES(100002,'----- Original Message -----');

Related Bug

This ant bug appears to identify the problem. As it’s still open (after 8 years), I’m not hoping for a fix soon. However, because the problem appears only in oracle, it may lie with the driver.

The oracle driver: jdbc thin driver, version 10.2.0.1.0

The Question

Does anyone have a workaround which works in both mssql and oracle? (e.g. changing the offending lines to define an escape character? I don’t see an ‘escape’ on the ‘insert’ sql92 syntax)

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:10:39+00:00Added an answer on June 11, 2026 at 2:10 pm

    After viewing the ‘SQLExec’ source and turning on verbose logging, I found a workaround:

    Workaround

    if the sql statement includes a string containing ‘–‘, place the delimiter (semi-colon) on the next line.

    This Fails

    INSERT INTO email_client (email_client_id,generated_reply_text) VALUES(100002,'----- Original Message -----');
    

    This Succeeds

    Note that semi-colon is on a separate line

    INSERT INTO email_client (email_client_id,generated_reply_text) VALUES(100002,'----- Original Message -----')
    ;
    

    Details

    Turning on verbose logging, I saw that when Ant came across the offending sql statement, it actually passed three sql statements in at once to the jdbc driver. The offending statement, the next statement (which also included an embedded ‘–‘), and the subsequent statement (which did not include an embedded ‘–‘).

    I gave the Ant code a quick glance and didn’t see any obvious errors. Since I wasn’t planning to patch Ant, I looked for a workaround.

    Tweaking with it I found that if I simply moved the delimiter (semicolon) to the next line for the statements with embedded ‘–‘, the scripts executed successfully.

    thanks everyone for weighing in

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context Sometimes, I like reading code on paper rather than on screen (so I
Context I want to use JavaFx with clojure. I am aware of http://nailthatbug.net/2011/06/clojure-javafx-2-0-simple-app/ Question:
Context I use FINDSTR /C:portid= scanports.xml to extract theses lines from a file: <port
Context I use jQuery UI autocomplete with a remote datasource. The source send data
Context: I want to use log4j to write audit-related logs to a specific log
Context: I have an application that makes heavy use of the GSL library and
Context: I am trying to use the same set of models for both XML
Context: I'm in charge of running a service written in .NET. Proprietary application. It
Context Say, we want to use the Box-Muller algorithm. Starting from a couple of
Context (doc count) ------------------------- clojure.core/count ([coll]) Returns the number of items in the collection.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.