IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 plan for DSNTEP2 / DSNTEP4


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mainak_Dalal

New User


Joined: 05 May 2010
Posts: 19
Location: USA

PostPosted: Thu Jan 21, 2016 1:08 am
Reply with quote

I am trying to understand how the batch Spufi programs DSNTEP2 / 4 can process any sql statement against any database schema in a DB2 subsystem. These are PL/I programs bound to DB2 plan DSNTEP2 (or any other name) to process SQL dynamically, when invoked through TSO batch program IKJEFT01 in a JCL.

Now, when a DB2 plan is created, it has a qualifier in Bind Plan command and the plan or any package bound to the plan can execute sql against the the objects within that schema / qualifier only.
But through DSNTEP program we can execute sql against any schema dynamically. I am not sure how the plan access is working here. Can someone please help understand the process here?

Thanks in advance
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Jan 21, 2016 1:23 am
Reply with quote

Binding indicates which of the FOO tables on the system the program should operate on; the subsystem and schema are specified at (package) bind time. If you do triple qualification of table names in the dynamic SQL, you can operate on any table (assuming, of course, that you have the appropriate privileges on it).
Back to top
View user's profile Send private message
Mainak_Dalal

New User


Joined: 05 May 2010
Posts: 19
Location: USA

PostPosted: Thu Jan 21, 2016 1:35 am
Reply with quote

Akatsukami, thanks for reply. What are FOO tables? Also what does qualifier signifies in BIND PLAN statement? Will the plan be able to access tables outside the schema / qualifier?

Also by triple qualification, do you mean DB.Schema.Table?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Jan 21, 2016 1:46 am
Reply with quote

I was an avid reader of Ed Yourdon; he used FOO and BAR as examples for pretty much.

A package is bound to a given subsystem and schema. Since a plan can have more than one package in it, it can access many subsystems and schemata, although a given routine can only access a certain subsystem/schema combination at a time (accessing a different combination requires a rebind).

Triple qualification would be subsystem.schema.table. I use dynamic SQL in Rexx frequently; the tables are always specified that way.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts current batch plan DB2 3
No new posts DSNTEP2 - setting exception DB2 2
No new posts Execute DSNTEP2 in REXX which is call... CLIST & REXX 4
No new posts Log an Plan name/id or Job Id using D... DB2 1
No new posts Usage/Utiliy of Plan in DB2 DB2 4
Search our Forums:

Back to Top