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 > Getting SQLCODE "-551" error for updated command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-20-09, 01:29
anilsharma19_2000 anilsharma19_2000 is offline
Registered User
 
Join Date: Jan 2009
Posts: 2
Unhappy Getting SQLCODE "-551" error for updated command

Hi All,

I am getting an unusual error while trying to do an update for one of my tables.although the user have createin/alterin/dropin privilges on the table schema .
FYI : I can successfully update any other tables .this table have some triggers associated.

command :
db2 "UPDATE USERS SET MODIFIED= TIMESTAMP('2001-01-01 00:00:00.0')WHERE MODIFIED IS NULL"

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 "DB2USRBH|ALTER TABLE|DB2USRBH.USERS". LINE NUMBER=0.
SQLSTATE=56098
Reply With Quote
  #2 (permalink)  
Old 02-20-09, 02:22
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
According to error message, command: "db2 ? SQL0727N" you have some trigger problem. It looks like you try to update table, but trigger executes some action that can't be completed, so trigger rollbacks you transaction.

Check trigger action:
select * from syscat.triggers where tabschema='table_schema' and tabname='table_name'

Regards
Reply With Quote
  #3 (permalink)  
Old 02-20-09, 03:48
anilsharma19_2000 anilsharma19_2000 is offline
Registered User
 
Join Date: Jan 2009
Posts: 2
thanks . I had a fix for it. I had dropped and recreated the trigger with a change in function path ( used in resolving functions and types).
earlier it was ""SYSIBM","SYSFUN","SYSPROC","SYSIBMADM","<def ault user schema>" . I replaced <default user schema> with the base table schema.
Reply With Quote
  #4 (permalink)  
Old 02-20-09, 04:36
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
I recommend that you fully qualify all function calls (except for system functions). Otherwise, the next person who has to maintain (fix or extend) the trigger will run into the same problem. So a permanent solution should be much better than the temporary work-around with setting the function path for the trigger creation.
__________________
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