What is the difference between plan & packagewhat is difference between views & joinswhat is db2 stored procedures? how to work it in mainframehow to calculate n th maximum valueif the error code -811 ? how to rectify it?if the error in dead lock how to rectify it?how to read the last record in data file don't know the no.of records?what is the use of profile in Qmf?

Showing Answers 1 - 6 of 6 Answers

Hi Latha,I could suggest you to refer DB2-SQL Red books And online help while working with mainframe.Anyhow, I will answer to few of your questions.Plan is executable code and it contains access path to the packages bound with it.Package is non executable code and it contains access path to DB2(database). This is simple answer to your question. But don't confuse.Views and Joins are no where related but We can use JOIN for creating a VIEWS and fetching records in Views.Views is logical data content extracted from tables, you can access it with view name itself.SQL Code -811 occures when embedded program trying to fetch more than one row and hence to resolve same DECLARE CURSOR if modatory I mean Is necessary to fetch more than one? If your answer for is YES declare it Else check your table and make sure that column is unique one. Otherwise data will be in error.Deadlock will ocurres when other user having exclussive control on or updating data. You can resovle it two ways one By program other by Resubmit job.By Program Means, Make program in loop that count Deadlock error each time and limit it while declaring.To read last record Use FILE-AID/DATA MANUPALATION UTILITY(INSYNC).what is the use of profile in Qmf? For this question read QMF manual.

  Was this answer useful?  Yes

1. Plan is executable,Pakage is non-executable and Plan contains packages. n No. of pgms contains n No. of packages but only one plan.

2. View is Just a logical table to Base tables for ex: if we are having 20 fields in table(s) and we want only certain columns to access, at that time we go for views and in views also contains joins.

3. Joins are used to access the data from more than two tables.

4. Select e1.sal from emp e1 where (n-1)=( select count(distinct e2.sal) from emp2 where e1.sal=e2.sal)

5. If our "select" statement is retrieving more than one row at a time, so our ws-var cant handle this, because ws-var stores only one row at time. At this time sql error code -811 will get. To handle this we use Cursors, so that we can retrieve more than one row at a time(Cursor is a pointer variable).

6. Wait for some times and tell them to restart from the abended step.

7. Read file-name AT END SET EOF-YES TO TRUE. DISPLAY file-rec.it will display last rec of the file.

8. For Test (db2) purpose we use QMF

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions