An Sql Error - 551
Contents |
Technote (troubleshooting) Problem(Abstract) What should I do if I
Sqlcode=-551 Sqlstate=42501 Insert
receive SQL error -551? The error message is: SQL0551N "
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow http://stackoverflow.com/questions/1588687/db2-connection-problem-with-java the company Business Learn more about hiring developers or posting ads with us Stack https://geekcredential.wordpress.com/2014/03/11/db2-sql-error-sqlcode-551-sqlstate42501-can-be-a-bit-misleading/ Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Db2 connection problem with java up vote 7 down vote favorite 3 I am having problem with DB2. sql error I just installed the db2 as a db2admin and with a password. When i try to connect to database it is success full and while running any simple select query it give me following error:- DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.LOGIN, DRIVER=3.57.82 I have a database named onp and a table in it called 'login' in which there is one table called 'login' with two fields username and password. Query that i db2 sql error am running Select * from login; gives me error DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.LOGIN, DRIVER=3.57.82 Select * from system.login; gives me error:- (//system is schema name) DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=DB2ADMIN;SELECT;SYSTEM.LOGIN, DRIVER=3.57.82 I have tried all the resources on the net and exhausted completely. Please help me java jdbc db2 db2-luw share|improve this question edited Jul 21 at 19:47 mustaccio 10.6k41933 asked Oct 19 '09 at 13:33 RishiPatel 801211 add a comment| 4 Answers 4 active oldest votes up vote 8 down vote accepted I don't know a lot about DB2, but looking up the error codes... The first error is because you didn't specify a schema, so it couldn't find the login table. SQLCODE -204 Object not defined to DB2 DB2 apparently requires you to specify the schema name or it looks in the schema with the same name as your login user. You must use SET SCHEMA or fully qualify the table name. The second error is because you don't have the privileges to perform that select: SQLCODE -551, Error: DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION ON OBJECT I'm not sure why the db2admin user wouldn't be able to select from this table... Resources: List of DB2 SQLCODEs share|improve this answer answered Oct 19 '09 at 13:44
13 Mar 2014 The Situation A Groovy script that executes some SQL against a DB2 for LUW 9.7 database throws an exception: com.ibm.db2.jcc.a.bn: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=USERID;EXECUTE;SCHEMA.GET_FACE_AMOUNT, DRIVER=3.51.90 IBM states that SQLCODE -551 means: authorization-ID does not have the required authorization or privilege to perform operation operation on object object-name. Initially, this seems to be a pretty straightforward problem. This is a database that was recently copied from another system. It is not unlikely that when it was restored, permissions were not granted to USERID to execute SCHEMA.GET_FACE_AMOUNT. However, once the database administrator demonstrates that he can execute the GET_FACE_AMOUNT function while logged on as USERID, we’re left with a puzzle. What We Learned Our DB2 permissions were applied to user groups. The executing userid is a member of the ‘rw’ group, which should have read, write and execute permissions to the GET_FACE_AMOUNT function. As it turns out, however, DB2 does not apply group permissions to user defined functions. It’s a much better practice to manage database permissions using roles. I’m not a DB2 DBA, so I can’t comment on exactly what the differences between groups and roles are. However, it seems like roles are a more robust way of defining permissions for a collection of users. #db2, #db2-sql-error, #sql, #sql0551n, #sqlcode-551, #sqlstate-42501 Leave a Reply Cancel reply Your email address will not be published. Required fields are marked *Comment Name * Email * Website Notify me of new comments via email. Post navigation ← Vagrant Up fails with "VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE (0x80080005)" Groovy Order of Operations Gotcha: Ternary Operator vs. LeftShift → Categories Development (44) Humor (2) Network Admin (6) Stop Spam (2) Uncategorized (6) Archives Archives Select Month August 2014 April 2014 March 2014 September 2013 May