Microsoft Knowledge Base Email Alertz

(269626) - The Microsoft ODBC Driver for DB2 and the Microsoft OLE DB Provider for DB2, each of which are implemented as an IBM Distributed Relational Database Architecture (DRDA) Application Requester, use packages to issue dynamic SQL statements after...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 269626 - Last Review: December 5, 2003 - Revision: 3.1

INFO: Permissions Needed to Create Packages Using DB2OLEDB on DB2 and DB2/400

This article was previously published under Q269626

SUMMARY

The Microsoft ODBC Driver for DB2 and the Microsoft OLE DB Provider for DB2, each of which are implemented as an IBM Distributed Relational Database Architecture (DRDA) Application Requester, use packages to issue dynamic SQL statements after connecting to DB2 running on supported platforms.

This article describes the minimum permissions a user must have to create these packages in an OS/390 (MVS) and AS/400 environment.

MORE INFORMATION

These packages are not required for connecting to the backend, but they are necessary before any query will work. There are two ways to create these packages:
  • Explicitly: By using the CrtpKgw.exe utility that ships with SNA 4.0 (SP2/SP3) Server/Client, or with its command line version, Crtpkg.exe.
  • Implicitly: If the user does not explicitly create these packages, the driver or provider tries to create them dynamically when a query is run, but the connected user needs to have the required priviliges in order for this to succeed.
All of these packages will be created inside the Collection that is specified in the Package Collection property in the datalink file, or in the connection string.

If the user does not have the appropriate authority to create packages in the specified Collection, or if the specified Collection does not exist, the provider or driver might report the following error:

In the case of DB2 (on OS/390 or MVS):
A SQL error has occurred. Please consult the documentation for your specific DB2 version for a description of the associated Native Error and SQL State. SQLSTATE: 51002, SQLCODE: -567.
In the case of DB2/400:
A SQL error has occurred. Please consult the documentation for your specific DB2 version for a description of the associated Native Error and SQL State. SQLSTATE: 51002, SQLCODE: -805.
There are two authorities required to create the packages in the case of DB2 (on OS/390 or MVS):
  • GRANT BINDADD TO "Authorization ID"
  • GRANT CREATE IN COLLECTION "Collection ID" TO "Authorization ID"
The "Authorization ID" is the user who needs the permission to create the packages. Once an administrator executes the above statements on behalf of a non-privileged user, that user can then run the Create Package Utility, which would create five sets of packages (one for each of the five isolation levels supported on DB2/MVS) for use by "all" (in other words, PUBLIC) users.

The "Collection ID" is the name of the Collection, which the user specifies in the datalink file for the Package Collection property. This Collection should be a valid Collection within the DB2.

In the case of DB2/400, the user ID must have:
  • *CHANGE authority on the DB2 collection

    -or-
  • *ALL authority on the DB2 collection

If the user merely has *USE authority, or if the user has *EXCLUDE authority, the Create Package process will fail.

REFERENCES

For additional information on DB2 packages and other related topics, click the article numbers below to view the articles in the Microsoft Knowledge Base:
235631  (http://kbalertz.com/Feedback.aspx?kbNumber=235631/EN-US/ ) Crtpkgw.exe Hangs While Trying to Create Packages in DB2 When Connected over TCP/IP
216810  (http://kbalertz.com/Feedback.aspx?kbNumber=216810/EN-US/ ) Creating Packages for Use with ODBC Driver for DB2 and OLE DB Provider for DB2
218590  (http://kbalertz.com/Feedback.aspx?kbNumber=218590/EN-US/ ) INF: Configuring Data Sources for the Microsoft OLE DB Provider for DB2

APPLIES TO
  • Microsoft OLE DB Provider for DB2
  • Microsoft OLE DB Provider for DB2
  • Microsoft ODBC Driver for DB2 4.0 SP2
  • Microsoft ODBC Driver for DB2 4.0 SP3
Keywords: 
kbdatabase kbdb2 kbinfo KB269626
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate