Home > Ask the Data management / BI Experts > Questions & Answers > What authority non-DBAs need to create triggers
Ask The Data Management Expert: Questions & Answers
EMAIL THIS

What authority non-DBAs need to create triggers

Craig Mullins, Years 2005-2006 EXPERT RESPONSE FROM: Craig Mullins, Years 2005-2006

Pose a Question
Other Data Management Categories
Meet all Data Management Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 18 October 2004
What authority would a non-DBA need to create a DB2 trigger? We are using Endevor and processors to create triggers. We were successful in creating stored procedures and thought triggers required similar authorization.
CREATE TRIGGER ZJCTSS00.CASEU1               
  AFTER UPDATE OF                            
    CASE_YYMM_DT                             
  ON ZJCTSS00.CASE                           
  REFERENCING OLD AS OLDROW                  
              NEW AS NEWROW                  
  FOR EACH ROW MODE DB2SQL                   
  BEGIN ATOMIC                               
    UPDATE ZJCTSS00.NAMEX                    
    SET CASE_YYMM_DT = NEWROW.CASE_YYMM_DT   
    WHERE CASE_PROJ_NUM = OLDROW.CASE_NUM    
      AND SOURCE_IND    = 'R';               
END#                                    SQLCODE = -20100, ERROR:  AN
ERROR OCCURRED WHEN BINDING A TRIGGERED SQL STATEMENT.  INFORMATION
RETURNED: SEC

NUMBER : 2 SQLCODE -551, SQLSTATE 42501, AND MESSAGE TOKENS
ENDVID2,UPDATE,ZJCTSS00.NAMEX.CASE_YYMM_DT

SQLSTATE   = 56059 SQLSTATE RETURN CODE

SQLERRP    = DSNXODML SQL PROCEDURE DETECTING ERROR

>
Well, you'll need a bunch of authority to create a trigger. Creating a trigger requires that the user's privilege set include ALL of the following:

1. Either the CREATEIN privilege on the schema, SYSADM or SYSCTRL authority.

2. The TRIGGER privilege on the table. The privilege set must include at least one of the following: - The TRIGGER privilege on the table on which the trigger is defined
- The ALTER privilege on the table on which the trigger is defined
- DBADM authority on the database that contains the table
- SYSADM or SYSCTRL authority

3. The SELECT privilege on the table on which the trigger is defined if any transition variables or transition tables are specified.

4. The SELECT privilege on any table or view to which the search condition of triggered action refers.

5. The necessary privileges to invoke the triggered SQL statements in the triggered action.

Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our discussion forums.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
IBM DB2 management
How to select an MPP database: DB2 vs. Teradata
What are the top database management systems (DBMS)?
Are there benefits to using both Teradata and a DB2 database?
Tips for evaluating top database management systems and choosing a small DBMS
Exec explains IBM's Information On Demand (IOD) initiative
IBM DB2 9 Fundamentals certification (Exam 730): Sample questions about tables, Part 7
IBM DB2 9 Fundamentals certification (Exam 730): Sample questions about tables, Part 6
IBM DB2 9 Fundamentals certification (Exam 730): Sample questions about tables, Part 5
DB2 basics
IBM DB2 basics

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts