Hi Arihan,
I'm pretty sure, there's nothing wrong about the syntax of your statements.
I've just googled a bit to find out about the meaning of the error
message you are given
Error: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501,
SQLERRMC=APPTEST;UPDATE;STM.LOAN, DRIVER=3.50.152
SQLState: 42501
ErrorCode: -551
I came across the following page
http://www.sqlerror.de/db2_sql_error_-551_sqlstate_42501.html
There the following is mentioned
DB2 SQL-Error: -551
SQLState: 42501
Short Description: DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION ON
OBJECT
So, I would guess the DB2 user you use to connect to your database is
not allowed to change data in the table STM.LOAN
From my point of view, you have two options, ask your DBA to grant the
user the prvilege to change data or ask for another user that is allowed
to perform the action.
Wishing you a nice weekend
Andreas
Am 20.07.2011 11:57, schrieb arihan:
> Hi All,
>
> FOR DB2 database
> =============
> When I am executing the sql command as SELECT * FROM STM.LOAN where ID =
> 72000695; and try to edit the sql results table it doesnot allow me.
>
> I've sql results as editable table in new session properties -> Genral .
> Also even if you don't make it editable then you can right click on the
> column and it would give me the option to make editable. I tried both and it
> doesn't work
>
> Could you please let me know if I am facing this problem.
> When I click the objects -> table name> content tab and try to edit it then
> it works fine. It gives me "make editable" option by right click on the
> column.
>
> Actually I am trying to use the update statement by taking different
> combinations
>
> UPDATE STM.LOAN SET ADDRESS = 'XYZ' WHERE ID = 72000695;
> UPDATE "STM"."LOAN" SET ADDRESS = 'XYZ' WHERE ID = 72000695;
> UPDATE STM.LOAN A SET A.ADDRESS = 'XYZ' WHERE A.ID = 72000695;
>
> it gives the error as
> Error: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501,
> SQLERRMC=APPTEST;UPDATE;STM.LOAN, DRIVER=3.50.152
> SQLState: 42501
> ErrorCode: -551
>
> Is anything wrong in the syntax of update statement. Any quick help would be
> highly appreciable.
>
> Cheers
> Arihan
>
|