You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Markus Mehrwald <mm...@gmx.at> on 2010/06/04 01:13:46 UTC

Ant SQL task

Hi,

I have a problem with the ant sql task. The task
<sql classpathref="myclasspath"
	driver="org.postgresql.Driver"
	url="url"
	userid="user"
	password="password">
	<transaction  src="db/Model.ddl"/>
	<transaction  src="db/Trigger.sql"/>
</sql>

always gets the following error:
[sql] Failed to execute:  CREATE OR REPLACE FUNCTION make_plpgsql() 
RETURNS void AS $ BEGIN CREATE LANGUAGE plpgsql

With the exception: Syntaxerror at "$"
The script looks like this:
CREATE OR REPLACE FUNCTION make_plpgsql() RETURNS void AS $$
BEGIN
	CREATE LANGUAGE plpgsql;
END
$$ LANGUAGE sql;

and it works with pgadmin3 and psql \i Trigger.sql without any errors.
I tried with ant 1.7 and 1.8.1

Thanks,
Markus

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


Re: Ant SQL task

Posted by Markus Mehrwald <mm...@gmx.at>.
Sry, the sql function should be without begin and end:

CREATE OR REPLACE FUNCTION make_plpgsql() RETURNS void AS $$
CREATE LANGUAGE plpgsql;
$$ LANGUAGE sql;

Am 04.06.2010 01:13, schrieb Markus Mehrwald:
> Hi,
>
> I have a problem with the ant sql task. The task
> <sql classpathref="myclasspath"
> driver="org.postgresql.Driver"
> url="url"
> userid="user"
> password="password">
> <transaction src="db/Model.ddl"/>
> <transaction src="db/Trigger.sql"/>
> </sql>
>
> always gets the following error:
> [sql] Failed to execute: CREATE OR REPLACE FUNCTION make_plpgsql()
> RETURNS void AS $ BEGIN CREATE LANGUAGE plpgsql
>
> With the exception: Syntaxerror at "$"
> The script looks like this:
> CREATE OR REPLACE FUNCTION make_plpgsql() RETURNS void AS $$
> BEGIN
> CREATE LANGUAGE plpgsql;
> END
> $$ LANGUAGE sql;
>
> and it works with pgadmin3 and psql \i Trigger.sql without any errors.
> I tried with ant 1.7 and 1.8.1
>
> Thanks,
> Markus
>
> ---------------------------------------------------------------------
> 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