Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 54573B5DC6A for ; Sat, 3 Sep 2011 10:52:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 85507-01 for ; Sat, 3 Sep 2011 13:52:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mail.postgresql.org (Postfix) with ESMTP id 999BBB5DC69 for ; Sat, 3 Sep 2011 10:52:47 -0300 (ADT) Received: from tbz-emx-mobil.localnet ([31.18.176.36]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0M15IK-1RJrSq1s88-00t4ul; Sat, 03 Sep 2011 15:47:44 +0200 From: "ml-tb" Reply-To: ml-tb@emagixx.de To: pgsql-jdbc@postgresql.org Subject: Re: Problem with sql ant task Date: Sat, 3 Sep 2011 15:47:42 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32-5-amd64; KDE/4.4.5; x86_64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201109031547.43338.ml-tb@emagixx.de> X-Provags-ID: V02:K0:msC5a5Zojuruzwd5B8kulGdQVCp+V5DDAW/BuyDR7GE 87orMVFEj5m4A/27RMHs3te/OPMkL/72qjb9B5wogij8VKkNUu lhTtPgA1bSZ+uA0Lq6+7jyhPuYCpe4Q1g4D1vpk4Kncd+1nFR4 073fCpPJ0uBPLJqsZnwXfmssVzkKDCwhSBFOEs7w7Wz0IFYpx+ gI13iPYG+NN1TuyhpaFT4vgKfE5NTSngl9FzV/JOTDoBtDLuv9 OzIx7yZwhwKSXRK1SG/ygqVtXYwr5b1KWknp1rxvJTNnB+rh67 obcxTSX/WbMSB+WYYEwuedYPbD2kET3YeEQVl29Xqs7qmwiZKP Qd4K5iQdDf4dRvkPrxRjWyaPiZAIItsS4WqqWS/LM X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201109/2 X-Sequence-Number: 22120 Hi, first: This is not a PostgreSQL or JDBC issue. some points to remember: =2D in ANT the '$' starts a property reference =2D functions/triggers/... in JDBC context ist a little bit tricky for the first point: Have a look at the ANT manual :-). The second point is implmentation specific. Many Java SQL script=20 executors splits a scrips in single statments to send them one after=20 another. But how to detect procedure definition what as one statement?=20 The procedure langugage is DB specific. No chance for a generic parser.=20 The solution "Send the whole procedure definition as one statement" does=20 not work in this environment and especialy not with the ANT task 'sql'. Bye Thomas Am Freitag, 2. September 2011 schrieb Alejandra Juarez D'Aquino: > Hi, I'm new using Posgres and in Ant as well. > I'm trying to use an ant task (sql) to run ours sql scripts to update > the database... The test should be re-runnables, so, I was looking > for a way to do it and I found this >=20 > create or replace function execute(TEXT) RETURNS VOID AS $$ BEGIN > EXECUTE $1; END ; >=20 > $$ LANGUAGE plpgsql STRICT; >=20 > select execute('create table CLIENTES.TEST (x int4); ') where not > exsist...; >=20 >=20 >=20 > but when I try to do something like that >=20 >=20 >=20 >=20 > select execute($$'create table CLIENTES.TEST ( > important_field text not null default 's' > ); '$$); >=20 > I am suposed to use $$, however the ant task throws the following > exception org.postgresql.util.PSQLException: ERROR: error de > sintaxis en o cerca de =AB$=BB >=20 >=20 > Any Idea why is this happening? in pgAdmin it runs ok. >=20 >=20 > Thanks very much...