Ah, a common misconception. Ant does not pass this to psql, but rather uses jdbc to connect to the database using the java drivers for postgresql. While this may seem like the same thing, it really isnt. Most (if not all) of the proprietary functionality of tools like psql and sqlplus are lost.
-Rob A > -----Original Message----- > From: Gareth Reakes [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 18, 2006 1:17 AM > To: Ant Users List > Subject: Re: postgres stored procedure sql task problem > > Hey Rob, > > Thanks for help. The problem is this works fine if I > pipe it into psql on the command line which suggests to me > that ant is going something to the file prior to giving to > psql. Maybe I will have a dig into the code and see. > > Cheers, > > Gareth > > Anderson, Rob (Global Trade) wrote: > > Since Ant is not throwing the exception, I don't think there is a > > problem with your usage of the sql task. I would suggest > asking in a > > postgresql forum. > > > > Sorry I cannot offer more help. > > > > -Rob A > > > >> -----Original Message----- > >> From: Gareth Reakes [mailto:[EMAIL PROTECTED] > >> Sent: Tuesday, May 16, 2006 8:27 AM > >> To: Ant Users List > >> Subject: postgres stored procedure sql task problem > >> > >> Hi all, > >> > >> I am having a problem sucking in a stored procedure. I > works fine on > >> the command line to psql but gives the error > >> > >> org.postgresql.util.PSQLException: ERROR: unterminated > >> dollar-quoted string at or near $update_track_rating_average$ > >> > >> DECLARE > >> current_average_rating FLOAT" > >> > >> > >> The first few lines of the stored procedure are: > >> > >> CREATE OR REPLACE FUNCTION update_track_rating_average() RETURNS > >> TRIGGER AS $update_track_rating_average$ > >> > >> DECLARE > >> current_average_rating FLOAT; > >> number_of_ratings BIGINT; > >> old_rating SMALLINT; > >> new_rating SMALLINT; > >> BEGIN > >> > >> -- get current average rating / number of ratings > >> SELECT INTO current_average_rating average_rating FROM > tracks WHERE > >> track_id = OLD.track_id; > >> SELECT INTO number_of_ratings ratings FROM tracks WHERE > >> track_id = OLD.track_id; > >> > >> -- rating removed / updated > >> IF (TG_OP = 'DELETE' OR TG_OP = 'UPDATE') THEN > >> > >> > >> > >> I have played with delimiter, delimitertype, escapeprocessing and > >> keepformat with no luck. Can anyone offer some advice? > >> > >> > >> Cheers, > >> > >> Gareth > >> > >> -- > >> Gareth Reakes, Managing Director Parthenon Computing > >> +44-1865-811184 http://www.parthcomp.com > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] For > >> additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] For > additional > > commands, e-mail: [EMAIL PROTECTED] > > > > > > -- > Gareth Reakes, Managing Director Embrace Mobile > +44-1865-811197 http://www.embracemobile.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] For > additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]