Parsing problem when launching SQL files with Ant (through JDBC driver) - Mailing list pgsql-jdbc

From Olivier Hubaut
Subject Parsing problem when launching SQL files with Ant (through JDBC driver)
Date
Msg-id opr7698vz71vnsxw@olivier.amaze.ulb.ac.be
Whole thread Raw
Responses Re: Parsing problem when launching SQL files with Ant (through
List pgsql-jdbc
Using
- Ant 1.6.1
- PostgreSQL 7.4.2
- PostgreSQL 7.4.2 JDBC Driver

We detected that when launching SQL script files with Ant (using the sql
task), a parsing problem occurs when those files contain comments.

We found a VERY ugly workaround: positionning the semi-colons at the
beginnig of the lines instead of the end.

[snippet]
--
-- This code does NOT work with this comment
--
CREATE FUNCTION foo.bar (VARCHAR(256))
    RETURNS integer
    LANGUAGE SQL
    AS '
        DELETE FROM foo.bar_table WHERE field = $1;
        SELECT 1
    '
;


[snippet]
--
-- This code works with this comment
--
CREATE FUNCTION foo.bar (VARCHAR(256))
    RETURNS integer
    LANGUAGE SQL
    AS '
    ; DELETE FROM foo.bar_table WHERE field = $1
    ; SELECT 1'
;

Any idea?

Thanks a lot in advance!

Olivier


--
Downloading signature ... 99%
*CRC FAILED*
signature aborted

pgsql-jdbc by date:

Previous
From: Alban Mathieu
Date:
Subject: Driver JDBC3 build 213 for postgreSQL 7.4
Next
From:
Date:
Subject: Java Test Harness