Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Posts
    36

    Unanswered: ERROR SQLCODE "-551", SQLSTATE "42501" when doing inserts.

    Hi All,
    When I am running the following insert command. I am getting the following error.

    COMMAND:

    INSERT INTO WCCADM12.CDEVENTDEFTP ( LANG_TP_CD , EVENTDEF_TP_CD , EVENT_CAT_CD , EVENT_NAME , ENABLE_NOTIFY , EXPIRY_DT , DESCRIPTION , LAST_UPDATE_USER , LAST_UPDATE_DT ) VALUES
    ( 100, 15, 6, 'PartyComplianceNextVerify', 'Y', null, 'Party Compliance Next Verify Date', null, CURRENT_TIMESTAMP )

    ERROR::
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0727N An error occurred during implicit system action type "7".
    Information returned for the error includes SQLCODE "-551", SQLSTATE "42501"
    and message tokens "WCCADM12|ALTER TABLE|WCCADM12.CDEVENTDEFTP". LINE
    NUMBER=0. SQLSTATE=56098

    When I tried for solutions on google. Many replied that the solution is to
    1. drop the triggers related to this table
    2. then run the insert commands
    3. create the triggers again.

    The above steps are absolutely working. But as this is in DEV. I am ok to do this and get rid of the issues. But I am worried about doing this in PROD. I just want to know that does anyone has encountered the same issue and could be fixed without dropping and recreating the Triggers.

    Actually my triggers on this table are for only Updates and Deletes but not on the INSERTS. I am not able to understand why the inserrts are failing.

    Anyone please help me in finding a solution for this issue without dropping and recreating the triggers.

    DB2 Version : DB2 v 9.5
    OS Level : AIX 5.3

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Did you try and grant update and delete to the user for the tables in the trigger?
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Mar 2009
    Posts
    36
    Hey Marcus thanks so much for the reply..

    Initially the tables that triggers are using doesnt have any privileges. I have granted the full privilegs as that of the main table.. But still I am not able to insert the values into that table.. Is there any other solution?

    Thanks, much appreciated..

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Clearly the error indicates that the user WCCADM12 does not have the ALTER TABLE privilege for WCCADM12.CDEVENTDEFTP.
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    Mar 2009
    Posts
    36
    Thanks Nick for the reply..

    But WCCADM12 is not a user. It is a schema name.. and if that is the case then other tables which were succedded also does not have any privileges related to WCCADM12.

    Please also let me know if we are not using the WCCADM12 as a user how can we grant permissions to that user?

    Thanks

  6. #6
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The error message, when expanded, reads:
    SQL0551N "WCCADM12" does not have the privilege to perform
    operation "ALTER TABLE" on object "WCCADM12.CDEVENTDEFTP".
    So what is rather surprising is the "ALTER TABLE". It seems that you have a trigger calling a stored procedure that runs an ALTER TABLE or something? That would be rather fishy if DML triggers DDL...
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •