The remote and local binding a package a tricky concept. This has been asked many times in interviews.
Local Binding a Package/Plan
BIND PLAN(IMSONLY) - PKLIST(DSN8IC91.*) - ACTION(ADD) - ISOLATION(CS) - OWNER(DEPTM92) - QUALIFIER(PRODUCTN) - CACHESIZE - ENABLE(IMS)
Remote Binding a Package/Plan
To BIND the DBRM PROGA at the location PARIS and in the collection GROUP1.
BIND PACKAGE(PARIS.GROUP1) COPY(GROUP1.PROGA)
The above Package is located at PARIS. Collection is group1.
BIND PLAN (PLANB) PKLIST (*.GROUP1.*)
Then you need to include remote package list into local Plan.
SQLCode Vs. SQLSTATE in DB2
SQLSTATE – It gives more information about last executed SQL. Weather the SQL is successfully executed or not. It comprises of 5 letters. First 2 letters gives more information about last executed error.
- 00-Successfule execution
- 01-Warning
- 02-No data is returned as a result of SQL exected
Since SQLSTATE is updated after every execution of SQL. You need to check information about SQLSTATE. ‘00000’ states that SQL is executed successfully.
Main use of SQLSTATE is when you are working with remote systems.
SQLCODE- It is a return code obtained when you execute a SQL query. All negative values are errors. Refer various SQL error CODES returned from DB2 .
Also read: