If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > ERROR SQLCODE "-551", SQLSTATE "42501" when doing inserts.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-28-09, 16:14
db2pro db2pro is offline
Banned
 
Join Date: Mar 2009
Posts: 36
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
Reply With Quote
  #2 (permalink)  
Old 04-28-09, 16:19
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 04-28-09, 17:40
db2pro db2pro is offline
Banned
 
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..
Reply With Quote
  #4 (permalink)  
Old 04-28-09, 20:22
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Clearly the error indicates that the user WCCADM12 does not have the ALTER TABLE privilege for WCCADM12.CDEVENTDEFTP.
Reply With Quote
  #5 (permalink)  
Old 04-29-09, 12:01
db2pro db2pro is offline
Banned
 
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
Reply With Quote
  #6 (permalink)  
Old 04-29-09, 13:22
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The error message, when expanded, reads:
Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On