I just discovered an interesting thing: the problem comes from this
code:
EXECUTE ''ALTER TABLE '' || dv || '' ADD CONSTRAINT idfk FOREIGN KEY
(_id) REFERENCES dt_'' || a_table;
If I put it into a temp variable, it doesn't help:
temp := ''ALTER TABLE '' || dv || '' ADD CONSTRAINT idfk FOREIGN KEY
(_id) REFERENCES dt_'' || a_table;
EXECUTE temp;
However, if I raise a notice just before the EXECUTE statement, it
suddenly works!
temp := ''ALTER TABLE '' || dv || '' ADD CONSTRAINT idfk FOREIGN KEY
(_id) REFERENCES dt_'' || a_table;
RAISE NOTICE ''%'', temp;
EXECUTE temp;
Strange, IMO.
Erik
__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer