Well I am little confused about the time stamp concept and when we need to bind
Some concepts that I keep in mind
- we get a SQLCODE -818 if there is a mismatch between the time stamp of load mondule and the time stamp of Plan
- If I am using a Package for a program(SQL program) and I make change to non-SQL part then I need to recompile as well as BIND PACKAGE the new DBRM again, but not BIND PLAN
- One of the advantage of binding DBRMs to PACKAGE first and then binding these PACKAGEs to PLAN is that if there is a change in the program for any one PACKAGE we just have to BIND PACKAGE again not the PLAN.
Now there are two doubts which trouble me:
1)If I only BIND PACKAGE and the time stamp changes from t1 to t2 for this DBRM/package and I don't BIND PLAN then how will the time stamp of the PLAN change to t2 automatically ?
2) I compile the changed module(subprogram) on time stamp t2 but now I also have to recompile the main module(also a SQL module but with no changes) again. Suppose I do it at time stamp t3. Then how does the final load module and the final Plan get the same time stamp and what will the time stamp be t2 or t3 or some thing different?
In both your queries you are trying to associate a PLAN with a single timestamp/consistency token. Remember that PLAN is list of packages and every package has its associated consistency-token. 'Timestamp' is not the correct terminology to use. So when you bind a package, it is enough. No need to bind the plan.
I have never encountered -818. I can't imagine getting -818 when working with packages.