By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,558 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,558 IT Pros & Developers. It's quick & easy.

trigger with check integer column

P: 3
I have create trigger:

CREATE TRIGGER TR
NO CASCADE
BEFORE INSERT ON T
REFERENCING NEW AS newrow
FOR EACH ROW MODE DB2SQL
WHEN (newrow.id = null)
BEGIN ATOMIC
set newrow.id = nextval for SAMPLE.sequ ;
END

But, write error with type. Column 'id' is integer and primery key.
If ID is then entered id, unless it gets sequence. but I can not do a check on value.

Please help me.
Thanks
Sep 10 '07 #1
Share this Question
Share on Google+
2 Replies


P: 3
i'm find vote this problem
Sep 10 '07 #2

P: 3
CREATE TRIGGER TR
NO CASCADE
BEFORE INSERT ON T
REFERENCING NEW AS newrow
FOR EACH ROW MODE DB2SQL
WHEN (newrow.id = null)
BEGIN ATOMIC
set newrow.id = nextval for SAMPLE.sequ ;
END
CREATE TRIGGER TR
NO CASCADE
BEFORE INSERT ON T
REFERENCING NEW AS newrow
FOR EACH ROW MODE DB2SQL
WHEN (newrow.id is null)
begin atomic
set newrow.id = nextval for sequ;
end
Sep 10 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.