Gollum
Gollum

Reputation: 33

Z/OS DB2 via IBM.Data.DB2

I am using IBM.Data.DB2 via C# to access a DB2 database on our mainframe Z/OS. Unfortunately I receive "DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=USER_NAME;EXECUTE PACKAGE;NULLID.SYSLH200, DRIVER=4.19.56"

I received the same error when I tried to access DB2 database via IBM Data Studio but it later it started working when I granted execute permissions on package 'NULLID.SYSLH200' to my user but I still receive the same error from IBM.Data.DB2 via C# code.

I made sure that:

Any idea on how should I get it working?

Upvotes: 1

Views: 437

Answers (1)

Gollum
Gollum

Reputation: 33

Well, moments alter when I posted this question, I did some hit and try and realized that I have to grant permissions to my user on all the packages for which I receive an error. This actually fixed the issue.

Our main confusion was that since its working with .Net OLEDB provider for DB2 then it should work flawlessly with Data Studio as well as IBM.Data.DB2 but looks like each driver uses its' own set of DB2 Packages to execute queries and depending on the approach that you are using, you have to grant permissions on allthose packages to your user.

Upvotes: 2

Related Questions