ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <flo...@mindspring.com>
Subject Re: postgres stored procedure sql task problem
Date Fri, 19 May 2006 12:37:00 GMT
What if you escape the $ signs?

Gareth Reakes wrote:
> Hi Scot,
>
>     thanks for your response. I have tried both in the file and in the 
> sql tag. I get an error in both cases.
>
> Cheers,
>
> Gareth
>
> Scot P. Floess wrote:
>> Gareth:
>>
>> My apologies, I meant escaping when it exists in another file.  I 
>> never actually included my SQL statements in my build script - this 
>> was probably 3 - 4 years ago when I was doing so.
>>
>> Gareth Reakes wrote:
>>> Hi,
>>>
>>>     Very simplified version:
>>>
>>>         <sql
>>>           keepformat="true"
>>>           driver="${jdbc.driverClassName}"
>>>           url="${jdbc.url}"
>>>           userid="${jdbc.username}"
>>>           password="${jdbc.password}"
>>>           delimiter="lineEnding"
>>>           delimitertype="row"
>>>           escapeprocessing="false">
>>>             CREATE OR REPLACE FUNCTION update_track_rating_average() 
>>> RETURNS TRIGGER AS $update_track_rating_average$ \
>>>                 BEGIN \
>>>                 RETURN NULL; \
>>>                 END; \
>>> lineEnding                                 <classpath>
>>>               <pathelement 
>>> location="${lib_dir}/postgresql-8.1-405.jdbc2.jar" />
>>>           </classpath>
>>>         </sql>
>>>
>>>
>>> Adding \ to end of lines made no difference.
>>>
>>>
>>> Thanks for your help,
>>>
>>> Gareth
>>>
>>> Anderson, Rob (Global Trade) wrote:
>>>> Can you post the portion of your build.xml that produces the error you
>>>> mention below.
>>>>
>>>> -Rob A
>>>>> -----Original Message-----
>>>>> From: Gareth Reakes [mailto:gareth@parthcomp.com] Sent: Tuesday, 
>>>>> May 16, 2006 9:15 AM
>>>>> To: Ant Users List
>>>>> Subject: postgres stored procedure sql task problem
>>>>>
>>>>> Hi all,
>>>>>
>>>>> Apologies if this ends up being a duplicate - It seems this email 
>>>>> was not registered
>>>>>
>>>>>      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: user-unsubscribe@ant.apache.org
>>>>> For additional commands, e-mail: user-help@ant.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>>> For additional commands, e-mail: user-help@ant.apache.org
>>>>
>>>>
>>>
>>
>

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message