473,484 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

trigger with check integer column

3 New Member
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
2 1803
pashki
3 New Member
i'm find vote this problem
Sep 10 '07 #2
pashki
3 New Member
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

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

Similar topics

0
4073
by: Sean Utt | last post by:
Table "grps" Column | Type | Modifiers -------------+-----------------------------+-------------------------------- --------------------- grpsid ...
2
7156
by: Rigs | last post by:
Hi, I'm a SQL Server newbie, so I'd appreciate if someone would tell me if this is possible. I'm running SQL Server 2000 on Win2k Server I have one table with a large number of columns. I...
9
3447
by: Martin | last post by:
Hello, I'm new with triggers and I can not find any good example on how to do the following: I have two tables WO and PM with the following fields: WO.WONUM, VARCHAR(10) WO.PMNUM,...
33
4736
by: coosa | last post by:
I have a table: ---------------------------------------------------- CREATE TABLE CATEGORY ( CATEGORY_ID INTEGER IDENTITY(1,1) NOT NULL, CATEGORY_NAME VARCHAR(40) NOT NULL,...
2
2633
by: ezra epstein | last post by:
Hi, I've got a table: <code language="SQL"> CREATE TABLE "common"."dynamic_enum" ( "pk_id" integer DEFAULT nextval('"common"."pw_seq"') , "enum_type" ...
4
4158
by: Alexander Pope | last post by:
I am using db2 udb v8.2 AIX I have created trigger, however I am not confident it meets industry standards. If I make it fail, I cant tell from the message where it is failing. what can I add to...
2
6424
by: 73blazer | last post by:
Perhaps my thinking is wrong but this is what I have: 1 table (Tab1) with 1 attribute (Attr1) Attr1 char(16) for bit data ----------------------------------------------- create trigger...
0
2443
by: JohnO | last post by:
Thanks to Serge and MarkB for recent tips and suggestions. Ive rolled together a few stored procedures to assist with creating audit triggers automagically. Hope someone finds this as useful as...
3
3415
by: beer | last post by:
Hello All I'm running 7.3.4-1 on a RH9 box. I'm having a problem with a trigger that seems to execute without actually performing the update that it should. The update returns true everytime...
0
7082
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4845
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4529
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3046
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3041
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
592
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
235
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.