This function doesn't work:
CREATE FUNCTION @[EMAIL PROTECTED]@[EMAIL PROTECTED] () RETURNS boolean LANGUAGE SQL AS ' ALTER TABLE @[EMAIL PROTECTED]@[EMAIL PROTECTED] ADD CONSTRAINT @[EMAIL PROTECTED]@[EMAIL PROTECTED] PRIMARY KEY (batch) ; ALTER TABLE @[EMAIL PROTECTED]@[EMAIL PROTECTED] ADD CONSTRAINT @[EMAIL PROTECTED]@[EMAIL PROTECTED] UNIQUE (batch, id) ; ALTER TABLE @[EMAIL PROTECTED]@[EMAIL PROTECTED] ADD CONSTRAINT @[EMAIL PROTECTED]@[EMAIL PROTECTED] PRIMARY KEY (batch, id, class) ; SELECT true;' ;
But the same, written using a different indetation protocol, works:
CREATE FUNCTION @[EMAIL PROTECTED]@[EMAIL PROTECTED] () RETURNS boolean LANGUAGE SQL AS ' ALTER TABLE @[EMAIL PROTECTED]@[EMAIL PROTECTED] ADD CONSTRAINT @[EMAIL PROTECTED]@[EMAIL PROTECTED] PRIMARY KEY (batch); ALTER TABLE @[EMAIL PROTECTED]@[EMAIL PROTECTED] ADD CONSTRAINT @[EMAIL PROTECTED]@[EMAIL PROTECTED] UNIQUE (batch, id); ALTER TABLE @[EMAIL PROTECTED]@[EMAIL PROTECTED] ADD CONSTRAINT @[EMAIL PROTECTED]@[EMAIL PROTECTED] 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,
-- Ci-git une signature avortee. ** RIP **
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster