SQL Q. Using USER function in constraints
Posted in 1994
Topics: General Discussion
Hi all,
I'm trying to add a constraint to an already existing database
such that when a row is inserted or updated one of the rows cannot
be equal to the user doing the insert or update. I decided to use the
alter table add constraint statement in the following way:
alter table coffeemade add constraint
check (maker not in (USER))
but this just returns a syntax error every time ( error 201 in Informix
5 ), and seemingly points out that the use of the USER function is
incorrect. If I substitute USER with another row in the table, say
logger, then the constraint is added okay.
As I understand it from reading the SQL reference manual its okay to
use USER in such away ( theres even an example of USER being used like
this ).
Has anyone any ideas of where I'm going wrong, or even any alternative
ways of getting the same effect using some other method.
Thanks
Andrew Hird
--
------------------------------------------------------
Andrew Hird, (IS Eng) andyh@sage.compnews.co.uk
"Wake up Harry. You're having a very important
nightmare!" - Wild Palms