From: | Olivier Hubaut <olivier(at)scmbb(dot)ulb(dot)ac(dot)be> |
---|---|
To: | PgSQL JDBC <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Bug in JDBC CREATE FUNCTION syntax? |
Date: | 2003-12-10 09:27:45 |
Message-ID: | 3FD6E711.2070601@scmbb.ulb.ac.be |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
I'm trying to do a create function using JDBC 3,0 in Eclipse IDE with
JFaceDBC plugin.
This function doesn't work:
CREATE FUNCTION @user_schema(at)(dot)@igloo_login(at)_log_constraints_set ()
RETURNS boolean
LANGUAGE SQL
AS '
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_transaction
ADD CONSTRAINT @user_schema(at)_@igloo_login(at)_log_transaction_pk
PRIMARY KEY (batch)
;
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_object
ADD CONSTRAINT
@user_schema(at)_@igloo_login(at)_log_object_batch_id_uq UNIQUE (batch, id)
;
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_object
ADD CONSTRAINT
@user_schema(at)_@igloo_login(at)_log_object_batch_id_class_pk PRIMARY KEY
(batch, id, class)
;
SELECT true;'
;
But the same, written using a different indetation protocol, works:
CREATE FUNCTION @user_schema(at)(dot)@igloo_login(at)_log_constraints_set ()
RETURNS boolean
LANGUAGE SQL
AS '
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_transaction
ADD CONSTRAINT @user_schema(at)_@igloo_login(at)_log_transaction_pk
PRIMARY KEY (batch); ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_object
ADD CONSTRAINT
@user_schema(at)_@igloo_login(at)_log_object_batch_id_uq UNIQUE (batch, id);
ALTER TABLE @user_schema(at)(dot)@igloo_login(at)_log_object
ADD CONSTRAINT
@user_schema(at)_@igloo_login(at)_log_object_batch_id_class_pk PRIMARY KEY
(batch, id, class)
; SELECT true;'
;
It seem's that the problem is about the semi-colon position. The
following query MUST be on the same line to make it works...
Does anyone else notice the same thing?
Thanks,
From | Date | Subject | |
---|---|---|---|
Next Message | Kris Jurka | 2003-12-10 09:35:43 | Re: Bug in JDBC CREATE FUNCTION syntax? |
Previous Message | Kris Jurka | 2003-12-10 03:01:08 | Re: Multi column foreign keys. |