Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

CREATE TRIGGER INSTEAD OF failure

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Vladimir Mestovski

New User


Joined: 15 Nov 2011
Posts: 4
Location: Belarus

PostPosted: Mon Jul 02, 2012 6:07 pm    Post subject: CREATE TRIGGER INSTEAD OF failure
Reply with quote

Hi DB2 experts,
can you help me to understand the reason of the following failure, does the DB2 V9.1 support the INSTEAD OF in the CREATE TRIGGER?

CONNECT;
*** CONNECT successful, SERVER_NAME='BYDB2LABE', PRODUCT_ID='DSN09010'
*** SERVER_CLASS='QDB2 for DB2 UDB for z/OS'

--CREATE VIEW V2IBAVM.WIPINVRUL5
-- (RULE_TYPE,ACTIVE_IND,PN,RECV_LOC)
-- AS SELECT RULE_TYPE,ACTIVE_IND,PN,CHAR(SUBSTR(FAMILY,1,4),4)
-- FROM V2IBAVM.TOM_RULES
-- WHERE RULE_TYPE = 'WIPINVRULE';
--COMMIT;

CREATE TRIGGER WIP_INSERT INSTEAD OF INSERT ON V2IBAVM.WIPINVRUL5
REFERENCING NEW AS NEWWIP FOR EACH ROW MODE DB2SQL
INSERT INTO V2IBAVM.TOM_RULES
(RULE_TYPE,ACTIVE_IND,PN,FAMILY)
VALUES(NEWWIP.RULE_TYPE,NEWWIP.ACTIVE_IND,
NEWWIP.PN,NEWWIP.RECV_LOC);

*DB2error(s) on PREPARE STMNT2:
*DB2error#1* SQLCODE = -4700
*DB2error#1* ATTEMPT TO USE NEW FUNCTION BEFORE NEW FUNCTION MODE
*DB2error#1* SQLSTATE = 56038

56038 │ The requested feature is not supported in this environment. │ -4700, │
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Mon Jul 02, 2012 6:36 pm    Post subject: Reply to: CREATE TRIGGER INSTEAD OF failure
Reply with quote

Quote:
ATTEMPT TO USE NEW FUNCTION BEFORE NEW FUNCTION MODE

the message is clear...
read the DB2 manuals about <compatibility> and <new function> mode
and also speak to Your support.
Back to top
View user's profile Send private message
Mahi_e

New User


Joined: 10 Dec 2010
Posts: 43
Location: hyderabad

PostPosted: Tue Jul 03, 2012 12:31 pm    Post subject: Re: CREATE TRIGGER INSTEAD OF failure
Reply with quote

Vladimir Mestovski wrote:

does the DB2 V9.1 support the INSTEAD OF in the CREATE TRIGGER?


Yes DB2 V9 supports INSTEAD OF TRIGGER......

CREATE VIEW EMP_DEPT (EMPNO, FIRSTNME, MIDINIT, LASTNAME,
PHONENO, HIREDATE, DEPTNAME)
AS SELECT EMPNO, FIRSTNME, MIDINIT, LASTNAME, PHONENO,
HIREDATE, DEPTNAME
FROM EMP, DEPT
WHERE EMP.WORKDEPT = DEPT.DEPTNO;

CREATE TRIGGER E_D_ISRT
INSTEAD OF INSERT ON EMP_DEPT
REFERENCING NEW AS NEWEMP
FOR EACH ROW INSERT INTO EMPLOYEE
(EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE)
VALUES
(EMPNO, FIRSTNME, MIDINIT, LASTNAME,
COALESCE
((SELECT DEPTNO FROM DEPT AS D WHERE D.DEPTNAME = NEWEMP.DEPTNAME),
RAISE_ERROR('70001', 'Unknown dept name')
),
PHONENO, HIREDATE);

Hope this would work fine..........
Correct me if i were wrong.....
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Jul 03, 2012 12:59 pm    Post subject:
Reply with quote

I agree with Enrico that the system you tried it on is not running DB2 9 with NFM. With DB2 9, it's called "conversion mode" though, no?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need to create file with Dynamic Name... kapil27 JCL & VSAM 4 Wed May 25, 2016 9:45 am
No new posts How to track incoming input files tha... shreya19 JCL & VSAM 6 Thu Feb 25, 2016 6:15 pm
No new posts Issue in trigger vickey_dw DB2 3 Wed Feb 10, 2016 5:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us