Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10373
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
No new posts How to create issuer certificate? :'( vasanthz All Other Mainframe Topics 1 Sat Nov 18, 2017 5:14 am
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts How do I create a mainframe monitorin... anjali.bisht All Other Mainframe Topics 4 Fri Sep 01, 2017 2:20 pm
No new posts Failure after DIR command Hank Watson All Other Mainframe Topics 2 Tue Aug 29, 2017 3:14 am
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us