Attention! Your ePaper is waiting for publication!
By publishing your document, the content will be optimally indexed by Google via AI and sorted into the right category for over 500 million ePaper readers on YUMPU.
This will ensure high visibility and many readers!
![illustration](https://assets.yumpu.com/release/Gb2iuBFx8UHm6GO/v5/img/account/document_privacy_modal/step1.png)
Your ePaper is now published and live on YUMPU!
You can find your publication here:
Share your interactive ePaper on all platforms and on your website with our embed function
![illustration](https://assets.yumpu.com/release/Gb2iuBFx8UHm6GO/v5/img/account/document_privacy_modal/step2.png)
Application Programming and SQL Guide - Kmlinux
Application Programming and SQL Guide - Kmlinux
Application Programming and SQL Guide - Kmlinux
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
DB2 ® DB2 Universal Database for z/OS<br />
Version 8<br />
<strong>Application</strong> <strong>Programming</strong><br />
<strong>and</strong> <strong>SQL</strong> <strong>Guide</strong><br />
���<br />
SC18-7415-02
DB2 ® DB2 Universal Database for z/OS Version 8 <strong>Application</strong> <strong>Programming</strong> <strong>and</strong> <strong>SQL</strong> <strong>Guide</strong> ��� SC18-7415-02
- Page 1: DB2 ® DB2 Universal Database for z
- Page 5 and 6: | | | | | | Contents About this boo
- Page 7 and 8: | | | | | | | | | Using the SQL com
- Page 9 and 10: | | | | | | | | | | | | | | | | # D
- Page 11 and 12: | | | LOB lock and LOB table space
- Page 13 and 14: # | | | Flexibility of dynamic SQL
- Page 15 and 16: | | | | | | | | Column correlation
- Page 17 and 18: | | Several tasks . . . . . . . . .
- Page 19 and 20: | CICS . . . . . . . . . . . . . .
- Page 21 and 22: About this book Who should read thi
- Page 23 and 24: Accessibility ►► required_item
- Page 25 and 26: | | | | | | | | | | | | | | | | | |
- Page 27 and 28: | | | | | | | Part 1. Using SQL que
- Page 29 and 30: Chapter 1. Retrieving data Result t
- Page 31 and 32: Table 1. Compatibility of data type
- Page 33 and 34: With a single SELECT statement, you
- Page 35 and 36: | | | | | | | | If a search conditi
- Page 37 and 38: | | | # # # # # # Summarizing group
- Page 39 and 40: Merging lists of values: UNION Usin
- Page 41 and 42: | | | | | | | | | | | | | | | | | |
- Page 43 and 44: | | | | v DEC31 rules allow a maxim
- Page 45 and 46: | Chapter 2. Working with tables an
- Page 47 and 48: | | | | | | | | For information abo
- Page 49 and 50: | | Example: Suppose that you creat
- Page 51 and 52: ows to be deleted from the table at
- Page 53 and 54:
| | | | | v Views that you can use
- Page 55 and 56:
INSERT INTO YEMP (EMPNO, FIRSTNME,
- Page 57 and 58:
| | | | | | | | | | | | | | | | | |
- Page 59 and 60:
| | | | | | | | | | | | | | | | | |
- Page 61 and 62:
| | | | | | | | | | | | | | | | | |
- Page 63 and 64:
If DB2 finds an error while executi
- Page 65 and 66:
Chapter 3. Joining data from more t
- Page 67 and 68:
Full outer join SELECT PART, SUPPLI
- Page 69 and 70:
Right outer join The result table l
- Page 71 and 72:
Using more than one join in an SQL
- Page 73 and 74:
PROD# PRODUCT ===== =========== 505
- Page 75 and 76:
Chapter 4. Using subqueries Concept
- Page 77 and 78:
SELECT EMPNO, LASTNAME FROM DSN8810
- Page 79 and 80:
use the keyword EXISTS, DB2 simply
- Page 81 and 82:
You can define a correlation name f
- Page 83 and 84:
| | DELETE FROM DSN8810.DEPT THIS W
- Page 85 and 86:
Chapter 5. Using SPUFI to execute S
- Page 87 and 88:
# | | # # # # # DSNESP02 CURRENT SP
- Page 89 and 90:
| | | | | | | | | | On the panel, u
- Page 91 and 92:
# # # # # # # # # # # # Processing
- Page 93 and 94:
Browsing the output SPUFI formats a
- Page 95 and 96:
| | | | | | | | | | | | | | | | | P
- Page 97 and 98:
| | | | Embedding SQL statements .
- Page 99 and 100:
Chapter 6. Basics of coding SQL in
- Page 101 and 102:
| | Declaring table and view defini
- Page 103 and 104:
v “Inserting data from column val
- Page 105 and 106:
| | | | | | | | | | | Example: Upda
- Page 107 and 108:
| | | | | | | | | | | | | | | | | |
- Page 109 and 110:
| | | | | | | | | | | | | | | | | |
- Page 111 and 112:
# # # # # # # # # # # # # # # # # #
- Page 113 and 114:
| | | | | | | Because this example
- Page 115 and 116:
| | | | | | | | | EXEC SQL WHENEVER
- Page 117 and 118:
| | | | | | | | | | | | | | | | | |
- Page 119 and 120:
| Table 4. Data types for GET DIAGN
- Page 121 and 122:
You can find the programming langua
- Page 123 and 124:
You use the statement WHENEVER SQLE
- Page 125 and 126:
| | | | | | | | | | | | | | | Chapt
- Page 127 and 128:
FROM DSN8810.PROJ Y WHERE X.EMPNO=Y
- Page 129 and 130:
| | | | | | | | | | | | | Using pos
- Page 131 and 132:
| | | | | | | | | | | | | | | | | |
- Page 133 and 134:
| | | | | | | | | | | | | | | | | |
- Page 135 and 136:
| | | | | | | | | | | | | | | | | |
- Page 137 and 138:
| | | | | | | | | | | | | | | | | |
- Page 139 and 140:
| | | | | | | | | | | | Retrieving
- Page 141 and 142:
| | | | | | | | | | | | | | | | | |
- Page 143 and 144:
The searched UPDATE statement creat
- Page 145 and 146:
| | | | | | | v A static scrollable
- Page 147 and 148:
***********************************
- Page 149 and 150:
| | | | | | | | | | | | | | | | | |
- Page 151 and 152:
| . *******************************
- Page 153 and 154:
Chapter 8. Generating declarations
- Page 155 and 156:
| | | | | | corresponds to the colu
- Page 157 and 158:
DSNEOP01 DB2I DEFAULTS COMMAND ===>
- Page 159 and 160:
DSNEDP01 DCLGEN SSID: DSN ===> DSNE
- Page 161 and 162:
Chapter 9. Embedding SQL statements
- Page 163 and 164:
| | | | | | Embedding SQL statement
- Page 165 and 166:
CICS A CICS application program use
- Page 167 and 168:
►► variable-name Graphic host v
- Page 169 and 170:
Table 11. SQL data types the precom
- Page 171 and 172:
| | | Table 12. SQL data types mapp
- Page 173 and 174:
v Datetime data types are compatibl
- Page 175 and 176:
See Appendix B, “Sample applicati
- Page 177 and 178:
| | Embedding SQL statements You ca
- Page 179 and 180:
| | | | | | | | | | | The names of
- Page 181 and 182:
| | | | ►► auto extern static
- Page 183 and 184:
| | | | ►► auto extern static
- Page 185 and 186:
| | | | | | | # # # # # | | | ►
- Page 187 and 188:
| | | | | | | | | | | | | | | | | |
- Page 189 and 190:
| | | | | | | | | | | | | | | | | |
- Page 191 and 192:
| ►► ► ▼ auto extern static
- Page 193 and 194:
| Table 13. SQL data types the prec
- Page 195 and 196:
Table 14. SQL data types mapped to
- Page 197 and 198:
| | | | | | | | | | | Result set lo
- Page 199 and 200:
| | | However, you cannot use a FET
- Page 201 and 202:
| | | | | Handling SQL error return
- Page 203 and 204:
DB2 sets the SQLCODE and SQLSTATE v
- Page 205 and 206:
| # # EXEC SQL UPDATE DSN8810.DEPT
- Page 207 and 208:
| | | | | | - TRUNC(BIN) if the pre
- Page 209 and 210:
|# ►► 01 77 level-1 ► BINARY
- Page 211 and 212:
►► ►► ► ►► ► 49 01
- Page 213 and 214:
►► ►► ► ►► ► 49 01
- Page 215 and 216:
| | | | | | | | | | | | | | | | | |
- Page 217 and 218:
| | | | | | | | | | | | | | | | | |
- Page 219 and 220:
| | | | | | | | | | | | | | | | | |
- Page 221 and 222:
| | | | | | | | | | | | | | | | | |
- Page 223 and 224:
|# ►► ► USAGE VALUE IS IS con
- Page 225 and 226:
►► ► ►► ► 49 VALUE 49 V
- Page 227 and 228:
# # Table 16. SQL data types the pr
- Page 229 and 230:
v The NATIONAL data type that is us
- Page 231 and 232:
| | | v Character data types are co
- Page 233 and 234:
| | | | | ►► ► 01 77 VALUE va
- Page 235 and 236:
CICS If you call DSNTIAR dynamicall
- Page 237 and 238:
| v DESCRIBE CURSOR host-variable I
- Page 239 and 240:
v You cannot use the SQL INCLUDE st
- Page 241 and 242:
►► SQL TYPE IS Determining equi
- Page 243 and 244:
v An integer or floating-point vari
- Page 245 and 246:
| | | | | ►► INTEGER*2 ▼ vari
- Page 247 and 248:
| | v DESCRIBE TABLE host-variable
- Page 249 and 250:
| | | | | | | | | v If you want a D
- Page 251 and 252:
►► ► FIXED DECLARE DCL FLOAT
- Page 253 and 254:
| | | | | | | | | | | | | | | | | #
- Page 255 and 256:
| | | | | | | | | | | | | | | | | |
- Page 257 and 258:
►► , DECLARE DCL ► ▼ level-
- Page 259 and 260:
Table 21 shows direct conversions b
- Page 261 and 262:
PL/I scoping rules: The precompiler
- Page 263 and 264:
| | | | | ►► DECLARE DCL Figure
- Page 265 and 266:
CICS If your CICS application requi
- Page 267 and 268:
►► Notes: ADDRESS DSNREXX EXECS
- Page 269 and 270:
| | | Continuation for SQL statemen
- Page 271 and 272:
are listed for each data type are t
- Page 273 and 274:
INSQLDA.SQLD = 1 /* SQLDA contains
- Page 275 and 276:
To change the isolation level for S
- Page 277 and 278:
Chapter 10. Using constraints to ma
- Page 279 and 280:
Using referential constraints v The
- Page 281 and 282:
A table can have no more than one p
- Page 283 and 284:
| | | You can create an index on th
- Page 285 and 286:
| | | | | | | | | | | | | | | | | |
- Page 287 and 288:
| | | | | | | | | | | | | | | | | |
- Page 289 and 290:
| | | | | | | | | | | | | | | | | |
- Page 291 and 292:
| | | | | | | | | | | | | | | | | |
- Page 293 and 294:
| | | | | | | | | | INSERT INTO ORD
- Page 295 and 296:
Chapter 12. Using triggers for acti
- Page 297 and 298:
Parts of a trigger Trigger name Sub
- Page 299 and 300:
CREATE TRIGGER NEW_HIRE AFTER INSER
- Page 301 and 302:
Triggered action When a trigger is
- Page 303 and 304:
Because you can include INSERT, DEL
- Page 305 and 306:
Ordering of multiple triggers v Tri
- Page 307 and 308:
| | | | | | | | | | | | | | | | | |
- Page 309 and 310:
1 2 When DB2 executes the positione
- Page 311 and 312:
# Part 3. Using DB2 object-relation
- Page 313 and 314:
Chapter 13. Introduction to DB2 obj
- Page 315 and 316:
| | | | | | | | | | | | | | | | | |
- Page 317 and 318:
COLUMN EMP_RESUME; CREATE UNIQUE IN
- Page 319 and 320:
# # # # # # # # # form, the LOB hos
- Page 321 and 322:
Table 31. Examples of COBOL variabl
- Page 323 and 324:
DB2 allocates a certain number of d
- Page 325 and 326:
***********************************
- Page 327 and 328:
Chapter 15. Creating and using user
- Page 329 and 330:
| The user-defined function definer
- Page 331 and 332:
| Table 35. Characteristics of a us
- Page 333 and 334:
| | | | | | | CREATE FUNCTION FINDS
- Page 335 and 336:
Implementing an external user-defin
- Page 337 and 338:
Some user-defined functions with ex
- Page 339 and 340:
Figure 123. Parameter conventions f
- Page 341 and 342:
# | # # # # # # # # # # # definitio
- Page 343 and 344:
Table 39. Compatible COBOL declarat
- Page 345 and 346:
| | | | | | | | | | Code the user-d
- Page 347 and 348:
user-defined function definition. F
- Page 349 and 350:
| | | | | | | | | | Otherwise, this
- Page 351 and 352:
These examples assume that the user
- Page 353 and 354:
. } /******************************
- Page 355 and 356:
| #pragma runopts(plist(os)) #inclu
- Page 357 and 358:
| | | | | | | | | | | | | | | | | |
- Page 359 and 360:
| | | | | | | | | | DCL 01 UDF_DBIN
- Page 361 and 362:
| | | Table 41. Characteristics of
- Page 363 and 364:
| CREATE FUNCTION COUNTER() RETURNS
- Page 365 and 366:
CHECKEMP CSECT SAVE (14,12) ANY SAV
- Page 367 and 368:
. . . . . IDENTIFICATION DIVISION.
- Page 369 and 370:
| | | | | | | | | | | | | Making a
- Page 371 and 372:
Using the Debug Tool interactively:
- Page 373 and 374:
Implementing an SQL scalar function
- Page 375 and 376:
If two or more candidates fit the u
- Page 377 and 378:
| | How DB2 chooses the best fit am
- Page 379 and 380:
| | | | | | | | | | | | | | | | | |
- Page 381 and 382:
| | | | | | | | | | want to invoke
- Page 383 and 384:
COUNTER is a user-defined function
- Page 385 and 386:
Chapter 16. Creating and using dist
- Page 387 and 388:
| You cannot use host variables in
- Page 389 and 390:
| JAPAN_SALES tables. The TOTAL col
- Page 391 and 392:
| | | | | You have also defined and
- Page 393 and 394:
. /* Extract the subject from the d
- Page 395 and 396:
Part 4. Designing a DB2 database ap
- Page 397 and 398:
| | | | Maximizing LOB performance
- Page 399 and 400:
| | | | | Chapter 17. Planning for
- Page 401 and 402:
Figure 139. Program preparation wit
- Page 403 and 404:
Binding a plan that includes only a
- Page 405 and 406:
Table 43. Changes requiring BIND or
- Page 407 and 408:
Rebinding lists of plans and packag
- Page 409 and 410:
Whether EXPLAIN runs during automat
- Page 411 and 412:
Chapter 18. Planning for concurrenc
- Page 413 and 414:
| | Deadlock Example: An applicatio
- Page 415 and 416:
IMS If you are using IMS, and a dea
- Page 417 and 418:
| | | | | | | | | | | | | | Replace
- Page 419 and 420:
| | | | | | | | | | | | | | | | | |
- Page 421 and 422:
| | | | | | | | | | | | | Segmented
- Page 423 and 424:
| | | | | space locks are sometimes
- Page 425 and 426:
The object of a lock Table 46. Comp
- Page 427 and 428:
numbers. They can perform several s
- Page 429 and 430:
| | | - Acquire an exclusive lock (
- Page 431 and 432:
SELECT * FROM T1 WHERE COL1 = (SELE
- Page 433 and 434:
Restrictions: You cannot use UR iso
- Page 435 and 436:
Restrictions on concurrent access:
- Page 437 and 438:
| Application Request row or page T
- Page 439 and 440:
| | | | | | | | | | | If your insta
- Page 441 and 442:
Access paths Recommendations for us
- Page 443 and 444:
# # # LOB locks - To let other user
- Page 445 and 446:
the locked LOB. Concurrent processe
- Page 447 and 448:
Chapter 19. Planning for recovery D
- Page 449 and 450:
v Explicitly by CICS SYNCPOINT comm
- Page 451 and 452:
If the program abends, people at te
- Page 453 and 454:
v How you want the output messages
- Page 455 and 456:
Using ROLL Issuing a ROLL call caus
- Page 457 and 458:
Chapter 20. Planning to access dist
- Page 459 and 460:
table SYSTABLES to determine whethe
- Page 461 and 462:
This example requires DRDA access b
- Page 463 and 464:
OPTIONS When you make a remote copy
- Page 465 and 466:
After the application obtains a loc
- Page 467 and 468:
| | | | | | | | | | | | | | | | | |
- Page 469 and 470:
second update is committed, no auto
- Page 471 and 472:
| For information about how to writ
- Page 473 and 474:
| | | | | | | | | | | | | | | | | |
- Page 475 and 476:
- It is not defined with the clause
- Page 477 and 478:
The number of rows that DB2 transmi
- Page 479 and 480:
Figure 149. Message flows with OPTI
- Page 481 and 482:
Working with distributed data Limit
- Page 483 and 484:
| | | | | | | | An application prog
- Page 485 and 486:
| Part 5. Developing your applicati
- Page 487 and 488:
| | | | | | | Chapter 21. Preparing
- Page 489 and 490:
| | | | | | | # # # # For assembler
- Page 491 and 492:
| | | | | | | | | | listing always
- Page 493 and 494:
| | | | | | | | | | | | | | | | | |
- Page 495 and 496:
You might need to increase the SIZE
- Page 497 and 498:
| | | | | | | Table 63. SQL process
- Page 499 and 500:
| | | | | | | | | | | Table 63. SQL
- Page 501 and 502:
Table 63. SQL processing options (c
- Page 503 and 504:
Table 64. IBM-supplied installation
- Page 505 and 506:
CICS (continued) You can run CICS a
- Page 507 and 508:
| | | | | | | | You must bind plans
- Page 509 and 510:
v When about to run a package, DB2
- Page 511 and 512:
| | | | 3. If it does not find COLL
- Page 513 and 514:
| Identifying a package version: So
- Page 515 and 516:
| | Table 68. Definitions of dynami
- Page 517 and 518:
You can also use CURRENT RULES in h
- Page 519 and 520:
CICS (continued) Sequence of SQL St
- Page 521 and 522:
The PARMS keyword of the RUN subcom
- Page 523 and 524:
CICS To run a program First, ensure
- Page 525 and 526:
IMS //LKED.SYSIN DD * INCLUDE SYSLI
- Page 527 and 528:
An alternative method for preparing
- Page 529 and 530:
| | | | | Using JCL to prepare a pr
- Page 531 and 532:
| | | | | | | | | | | | | | | | | |
- Page 533 and 534:
Chapter 22. Testing an application
- Page 535 and 536:
ind and run programs you want to te
- Page 537 and 538:
When your program encounters an err
- Page 539 and 540:
You can use the SYNCPOINT command t
- Page 541 and 542:
TRANSACTION: XC05 PROGRAM: TESTC05
- Page 543 and 544:
- Have you specified all the DBRMs
- Page 545 and 546:
DB2 SQL PRECOMPILER Version 8 OPTIO
- Page 547 and 548:
Notes for Figure 158: DATA NAMES Id
- Page 549 and 550:
Chapter 23. Processing DL/I batch a
- Page 551 and 552:
SQL statements and IMS calls You ca
- Page 553 and 554:
program can only connect to one DB2
- Page 555 and 556:
Link-editing name is not in the RTT
- Page 557 and 558:
ISOCS04 JOB 3000,ISOIR,MSGLEVEL=(1,
- Page 559 and 560:
# | | | Part 6. Additional programm
- Page 561 and 562:
| | | | | Sample programs to help y
- Page 563 and 564:
| | Retrieving rows for a plan . .
- Page 565 and 566:
Program preparation . . . . . . . .
- Page 567 and 568:
| | | | | | | | | | # # # # # # # #
- Page 569 and 570:
Chapter 24. Coding dynamic SQL in a
- Page 571 and 572:
| | | | | | | | | | 5. Processes th
- Page 573 and 574:
| | | | | | | | | | | | | | | HOLD
- Page 575 and 576:
| | # # # # # # # # # # # # # # # #
- Page 577 and 578:
Handling implicit prepare errors: I
- Page 579 and 580:
Using predictive governing and enab
- Page 581 and 582:
| | | | | | | | | | | | | | | | | |
- Page 583 and 584:
| | | | | | | | | | Using the EXECU
- Page 585 and 586:
| | | | | | | | | | | | | | | | | |
- Page 587 and 588:
The preceding two steps are exactly
- Page 589 and 590:
Those first two steps are exactly t
- Page 591 and 592:
Preparing the statement using the m
- Page 593 and 594:
or distinct type column, the corres
- Page 595 and 596:
hold values from that column. Simil
- Page 597 and 598:
Describing tables with LOB and dist
- Page 599 and 600:
EXEC SQL FETCH C1 USING DESCRIPTOR
- Page 601 and 602:
| | | | | | | | | | | | | | | | | |
- Page 603 and 604:
Chapter 25. Using stored procedures
- Page 605 and 606:
1. Receives a set of parameters con
- Page 607 and 608:
| 3. The SQL statement CALL tells t
- Page 609 and 610:
| See Part 3 of DB2 Administration
- Page 611 and 612:
| | Subsystem code page A 48-byte s
- Page 613 and 614:
| v It is part of the WLM applicati
- Page 615 and 616:
Member DSNTIJMV of data set DSN810.
- Page 617 and 618:
v A reentrant stored procedure does
- Page 619 and 620:
***********************************
- Page 621 and 622:
| | | | | | | | | A ROLLBACK statem
- Page 623 and 624:
| | Table 77. Characteristics of sp
- Page 625 and 626:
v The client supports the DRDA code
- Page 627 and 628:
Preparing a stored procedure to run
- Page 629 and 630:
Figure 180 shows the definition of
- Page 631 and 632:
***********************************
- Page 633 and 634:
stored procedure by executing the A
- Page 635 and 636:
| | | | | | | | | | | | | valid if
- Page 637 and 638:
| | | | | | | | | | | | | | | Handl
- Page 639 and 640:
| | | | | | | | | | | | | | | | | |
- Page 641 and 642:
| | | | | ELSE SET divide_result =
- Page 643 and 644:
CREATE PROCEDURE CREATEDEPTTABLE (I
- Page 645 and 646:
| | | | | | | | | | | | | | | | | |
- Page 647 and 648:
| | | | | | | | | | | | | | | | | |
- Page 649 and 650:
| | | | | | | | | | | | | | | | | |
- Page 651 and 652:
| | | | | | | | | | | | | | | | | |
- Page 653 and 654:
| | | | | | | | | | | | | | | | | |
- Page 655 and 656:
| | Table 82. SQL procedure samples
- Page 657 and 658:
technique, the defined encoding sch
- Page 659 and 660:
| | | | | | | | | | | Figure 188 sh
- Page 661 and 662:
Figure 190 shows how a stored proce
- Page 663 and 664:
CBL RENT IDENTIFICATION DIVISION. *
- Page 665 and 666:
***********************************
- Page 667 and 668:
CBL RENT IDENTIFICATION DIVISION. *
- Page 669 and 670:
| | | | IN V1 INT, OUT V2 CHAR(9) T
- Page 671 and 672:
| #pragma runopts(plist(os)) #inclu
- Page 673 and 674:
| | #pragma linkage(myproc,fetchabl
- Page 675 and 676:
| | | | | | | | | | | | | | | | | |
- Page 677 and 678:
| | #ifdef MVS #pragma runopts(PLIS
- Page 679 and 680:
| Table 84. Compatible assembler la
- Page 681 and 682:
Table 86. Compatible COBOL declarat
- Page 683 and 684:
The first alternative is simpler to
- Page 685 and 686:
more complete example of a C langua
- Page 687 and 688:
***********************************
- Page 689 and 690:
Table 88. Parameter formats for a C
- Page 691 and 692:
***********************************
- Page 693 and 694:
| | | | | | Running a stored proced
- Page 695 and 696:
- Use the CALL procedure-name form
- Page 697 and 698:
| | | | | | | | | | stored procedur
- Page 699 and 700:
Debugging with the Debug Tool and I
- Page 701 and 702:
Debug Tool is invoked. The most con
- Page 703 and 704:
Using SQL INSERT statements You can
- Page 705 and 706:
| | | | Chapter 26. Tuning your que
- Page 707 and 708:
| | | The predicate in subquery 1 (
- Page 709 and 710:
| | | | | | Does the query contain
- Page 711 and 712:
| | | | | | | | | | | | | | | | | |
- Page 713 and 714:
| | | | | For more information abou
- Page 715 and 716:
| | | | | |# | | | # # # # # Table
- Page 717 and 718:
| | | | | | | | | | | | | | | | | |
- Page 719 and 720:
| | | | Examples of predicate prope
- Page 721 and 722:
| | | | Table 92. DB2 default filte
- Page 723 and 724:
| | | | | | | | | Table 94. Default
- Page 725 and 726:
| | | | | | | | | | | | | | | | | |
- Page 727 and 728:
Column correlation on the best matc
- Page 729 and 730:
Example: RUNSTATS collects statisti
- Page 731 and 732:
| | | | | | SELECT * FROM V1 WHERE
- Page 733 and 734:
| | | | | | | | | | | | | | | | | |
- Page 735 and 736:
| | | | | | | | | | | | | | | | | |
- Page 737 and 738:
EXEC SQL SELECT * FROM DSN8810.EMP
- Page 739 and 740:
Writing efficient subqueries AND A.
- Page 741 and 742:
| | | What DB2 does: When the curso
- Page 743 and 744:
For a statement with multiple subqu
- Page 745 and 746:
| | | | | | | | | | | | | | | | | |
- Page 747 and 748:
| | | | | | | | | | | | | | | | | |
- Page 749 and 750:
| | | | | | | | When both the FETCH
- Page 751 and 752:
| | | | | | | | | | | | | | | | | |
- Page 753 and 754:
CREATE TABLE PART_HISTORY ( PART_TY
- Page 755 and 756:
v If you do not have information ab
- Page 757 and 758:
| | | | | | | | Rearranging the ord
- Page 759 and 760:
| | | | | | | | | | | | | | | | | f
- Page 761 and 762:
Chapter 27. Using EXPLAIN to improv
- Page 763 and 764:
| | DB2 sample library, under the m
- Page 765 and 766:
| | | | | | | | | | | | | Your plan
- Page 767 and 768:
| | | Table 99. Descriptions of col
- Page 769 and 770:
| Table 99. Descriptions of columns
- Page 771 and 772:
| | | You can execute EXPLAIN eithe
- Page 773 and 774:
ACCESSCREATOR and ACCESSNAME identi
- Page 775 and 776:
When an SQL application uses index-
- Page 777 and 778:
Example: Coding with row IDs for di
- Page 779 and 780:
| | 6000 and 8000 appear in partiti
- Page 781 and 782:
| | | | | | | | | | | | | | | | | |
- Page 783 and 784:
Matching index scan (MATCHCOLS>0) I
- Page 785 and 786:
as an extension to list prefetch wi
- Page 787 and 788:
| | | | | Unique Index1: (C1, C2) U
- Page 789 and 790:
Two kinds of joins differ in what t
- Page 791 and 792:
| | v No join columns exist. Hybrid
- Page 793 and 794:
- A new matching outer row. DB2 the
- Page 795 and 796:
▌3▐ Sorts the data in the outer
- Page 797 and 798:
| | | | | You can create even more
- Page 799 and 800:
| | | | | | | | Table 116. Plan tab
- Page 801 and 802:
| | | | | | | | | | | | | | | | | |
- Page 803 and 804:
| | | | | | | | | | Table 119. The
- Page 805 and 806:
When sequential detection is used D
- Page 807 and 808:
Sorts of RIDs The performance of th
- Page 809 and 810:
Materialization Views and table exp
- Page 811 and 812:
| v When the view is the operand in
- Page 813 and 814:
FROM WEEK1 WHERE DATE BETWEEN ’01
- Page 815 and 816:
| | | | | | | | | | | | 3. “Retri
- Page 817 and 818:
Populating and maintaining a statem
- Page 819 and 820:
Chapter 28. Parallel operations and
- Page 821 and 822:
CP task 1: I/O: CP task 2: I/O: CP
- Page 823 and 824:
| | | | | | When parallelism is not
- Page 825 and 826:
| | | | | | | | | | | | Table 127.
- Page 827 and 828:
Locking considerations for repeatab
- Page 829 and 830:
Chapter 29. Programming for the Int
- Page 831 and 832:
If you want to use ISPLINK, then ca
- Page 833 and 834:
Chapter 30. Programming for the cal
- Page 835 and 836:
CAF requirements When you write pro
- Page 837 and 838:
Figure 223. Sample call attachment
- Page 839 and 840:
Different types of implicit connect
- Page 841 and 842:
commit point. If a connected task a
- Page 843 and 844:
Terminating at this point provides
- Page 845 and 846:
eascode A 4-byte area in which CAF
- Page 847 and 848:
Table 134. Examples of CAF CONNECT
- Page 849 and 850:
Table 135. Examples of CAF OPEN cal
- Page 851 and 852:
DSNALI DISCONNECT function ►► C
- Page 853 and 854:
Table 138. Examples of CAF TRANSLAT
- Page 855 and 856:
A single task with explicit connect
- Page 857 and 858:
Table 140. CAF return codes and rea
- Page 859 and 860:
****************************** CONN
- Page 861 and 862:
***********************************
- Page 863 and 864:
DSNALI as DSNHLI. DSNALI uses 31-bi
- Page 865 and 866:
| | | Chapter 31. Programming for t
- Page 867 and 868:
Use of LOAD RRSAF uses z/OS SVC LOA
- Page 869 and 870:
| | | | | | | | | | | | | | | | | |
- Page 871 and 872:
Application LOAD DSNRLI LOAD DSNWLI
- Page 873 and 874:
Connection name and connection type
- Page 875 and 876:
| | | | | | | | | | | | | | | | | |
- Page 877 and 878:
function An 18-byte area containing
- Page 879 and 880:
Table 145. Examples of RRSAF IDENTI
- Page 881 and 882:
Execute SQL on subsystem 23 SWITCH
- Page 883 and 884:
| | This field is optional. If spec
- Page 885 and 886:
| | | DSNRLI AUTH SIGNON function
- Page 887 and 888:
exists, the thread becomes part of
- Page 889 and 890:
| | | | user A 16-byte area that co
- Page 891 and 892:
Table 150. Examples of RRSAF CONTEX
- Page 893 and 894:
| | | | | | | | | | | | | | | | | |
- Page 895 and 896:
| | | | | function An 18-byte area
- Page 897 and 898:
TERMINATE THREAD: Syntax and usage
- Page 899 and 900:
If the application allocated a plan
- Page 901 and 902:
Example of a single task This examp
- Page 903 and 904:
Table 157. RRSAF return codes Retur
- Page 905 and 906:
***************************** IDENT
- Page 907 and 908:
| | | | Chapter 32. CICS-specific p
- Page 909 and 910:
| | | | | | | | | | | | | | | | | |
- Page 911 and 912:
| | | | | | | | | | | | | | | | | |
- Page 913 and 914:
| | | | | | | | | | | | | | | | | |
- Page 915 and 916:
| | | | | | | | | | | | | | | | | |
- Page 917 and 918:
| | | | | | | | | | | | | | | | | |
- Page 919 and 920:
| | | | | | | | | | | | | | | | | |
- Page 921 and 922:
# # # # # # # # # # # # # # # # # #
- Page 923 and 924:
# # # # # # # # # # # # # # # # # #
- Page 925 and 926:
# # # # # # # # # # # # # # # # # #
- Page 927 and 928:
# # # # # # # # # # # # # # # # # #
- Page 929 and 930:
# # # # # # # # # # # # # # the que
- Page 931 and 932:
| | Chapter 34. Programming techniq
- Page 933 and 934:
while(SQLCODE==0) { EXEC SQL FETCH
- Page 935 and 936:
Retrieving thousands of rows Using
- Page 937 and 938:
Answer: Your program can dynamicall
- Page 939 and 940:
Part 7. Appendixes © Copyright IBM
- Page 941 and 942:
Appendix A. DB2 sample tables Most
- Page 943 and 944:
Table 163. Columns of the departmen
- Page 945 and 946:
Table 166. Columns of the employee
- Page 947 and 948:
The table is a parent table of: v T
- Page 949 and 950:
Table 173 shows the content of the
- Page 951 and 952:
| | | | | | | | | | | | | | | | | |
- Page 953 and 954:
Table 180. Views on sample tables (
- Page 955 and 956:
CREATE VIEW DSN8810.VEMPDPT1 (DEPTN
- Page 957 and 958:
CREATE VIEW DSN8810.VSTAFAC2 (PROJN
- Page 959 and 960:
Table spaces The following table sp
- Page 961 and 962:
Appendix B. Sample applications Typ
- Page 963 and 964:
The programs that create and popula
- Page 965 and 966:
Table 182. Sample DB2 applications
- Page 967 and 968:
| | | | | | | | | | Appendix C. Run
- Page 969 and 970:
| | | | # # # # # # # # # # # deter
- Page 971 and 972:
| | | | //UNLOAD EXEC PGM=IKJEFT01,
- Page 973 and 974:
| | | | | | in this data set. DSNTI
- Page 975 and 976:
# # # # # # # # # | | | | | | | | |
- Page 977 and 978:
Appendix D. Programming examples Th
- Page 979 and 980:
* ENTRY POINT = DSN8BCU1 * * PURPOS
- Page 981 and 982:
* OUTPUT = SYMBOLIC LABEL/NAME = SY
- Page 983 and 984:
* FD SYSREC01 RECORD CONTAINS 5 TO
- Page 985 and 986:
***********************************
- Page 987 and 988:
***********************************
- Page 989 and 990:
***********************************
- Page 991 and 992:
* Logic specification: */ /* */ /*
- Page 993 and 994:
Sample DB2 REXX application /******
- Page 995 and 996:
Edit data set The data set from whi
- Page 997 and 998:
* REXX ****************************
- Page 999 and 1000:
UPDATE DSN8810.EMP SET -- COLUMN NA
- Page 1001 and 1002:
SQLTYPE. = "UNKNOWN TYPE" VCHTYPE =
- Page 1003 and 1004:
L = Line.0 + 1; Line.0 = L Line.L =
- Page 1005 and 1006:
***********************************
- Page 1007 and 1008:
Sample COBOL program using DRDA acc
- Page 1009 and 1010:
* FETCH-DELETE-SITE-1. * * Provide
- Page 1011 and 1012:
SAL DECIMAL(8,2) NOT NULL, VALCHK D
- Page 1013 and 1014:
***********************************
- Page 1015 and 1016:
Sample COBOL program using DB2 priv
- Page 1017 and 1018:
* UPDATE-ADDRESS. * * Update the ad
- Page 1019 and 1020:
PROCEDURE DIVISION. A101-HOUSE-KEEP
- Page 1021 and 1022:
Examples of using stored procedures
- Page 1023 and 1024:
***********************************
- Page 1025 and 1026:
***********************************
- Page 1027 and 1028:
***********************************
- Page 1029 and 1030:
*PROCESS SYSTEM(MVS); CALPRML: PROC
- Page 1031 and 1032:
#pragma runopts(plist(os)) #include
- Page 1033 and 1034:
#pragma runopts(plist(os)) #include
- Page 1035 and 1036:
This stored procedure is able to re
- Page 1037 and 1038:
***********************************
- Page 1039 and 1040:
PROCEDURE DIVISION USING PROCNM, SC
- Page 1041 and 1042:
| ASUTIME NO LIMIT PARAMETER STYLE
- Page 1043 and 1044:
| | | | | | | | | | | | | | | | | |
- Page 1045 and 1046:
| | | | | | | | | | | | | | | | | |
- Page 1047 and 1048:
| | | | | | | | | Table 194. Result
- Page 1049 and 1050:
Appendix F. REBIND subcommands for
- Page 1051 and 1052:
SELECT SUBSTR(’REBIND PLAN(’CON
- Page 1053 and 1054:
***********************************
- Page 1055 and 1056:
Appendix G. Reserved schema names a
- Page 1057 and 1058:
ordinary identifiers in names that
- Page 1059 and 1060:
| Appendix H. Characteristics of SQ
- Page 1061 and 1062:
| Table 196. Actions allowed on SQL
- Page 1063 and 1064:
| | Table 197. SQL statements in ex
- Page 1065 and 1066:
| | | Table 198. Valid SQL statemen
- Page 1067 and 1068:
Table 198. Valid SQL statements in
- Page 1069 and 1070:
Appendix I. Program preparation opt
- Page 1071 and 1072:
| | | | # # # # # # # # Appendix J.
- Page 1073 and 1074:
# # # v In a non-data sharing envir
- Page 1075 and 1076:
DSNACICS syntax diagram The followi
- Page 1077 and 1078:
first messages. The messages appear
- Page 1079 and 1080:
Table 201. Contents of the XPL exit
- Page 1081 and 1082:
# # # # # # # # # # # # # # # # # #
- Page 1083 and 1084:
# # # # # # # # # # # # # # # # # #
- Page 1085 and 1086:
# # # # # # # # # # # # # # # Conne
- Page 1087 and 1088:
# Notices This information was deve
- Page 1089 and 1090:
Trademarks Product-sensitive Progra
- Page 1091 and 1092:
| | Glossary The following terms an
- Page 1093 and 1094:
| | | | # # # # # batch message pro
- Page 1095 and 1096:
| | | | | | | | # # # # # # # objec
- Page 1097 and 1098:
| | | | | | coupling facility. A sp
- Page 1099 and 1100:
DBCLOB. Double-byte character large
- Page 1101 and 1102:
| | | | | | | | | | | DRDA. Distrib
- Page 1103 and 1104:
| | | | # # # # # # # # must have t
- Page 1105 and 1106:
| | | | | implied forget. In the pr
- Page 1107 and 1108:
session key, a timestamp, and other
- Page 1109 and 1110:
| | | | | LUWID. Logical unit of wo
- Page 1111 and 1112:
package list. An ordered list of pa
- Page 1113 and 1114:
primary group buffer pool. For a du
- Page 1115 and 1116:
| | | referential structure. A set
- Page 1117 and 1118:
| | | | | | | | | | | | schema. (1)
- Page 1119 and 1120:
procedures. In dynamic SQL, the cur
- Page 1121 and 1122:
table space set. A set of table spa
- Page 1123 and 1124:
unit of recovery identifier (URID).
- Page 1125 and 1126:
Bibliography DB2 Universal Database
- Page 1127 and 1128:
v DB2 Query Management Facility: Ge
- Page 1129 and 1130:
v z/OS Language Environment Debuggi
- Page 1131 and 1132:
v z/OS Security Server RACF Auditor
- Page 1133 and 1134:
Index Special characters _ (undersc
- Page 1135 and 1136:
BIND PLAN subcommand of DSN (contin
- Page 1137 and 1138:
COBOL application program (continue
- Page 1139 and 1140:
cursor (continued) rowset-positione
- Page 1141 and 1142:
distributed data (continued) exampl
- Page 1143 and 1144:
error (continued) run 516 ESTAE rou
- Page 1145 and 1146:
host variable array (continued) num
- Page 1147 and 1148:
lock (continued) benefits 386 class
- Page 1149 and 1150:
package (continued) binding (contin
- Page 1151 and 1152:
eferential integrity effect on subq
- Page 1153 and 1154:
scrollable cursor (continued) sensi
- Page 1155 and 1156:
SQL statements (continued) comments
- Page 1157 and 1158:
subsystem parameters (continued) MA
- Page 1159 and 1160:
user-defined function (UDF) (contin
- Page 1161 and 1162:
Readers’ Comments — We’d Like
- Page 1164:
���� Program Number: 5625-D
Inappropriate
Loading...
Inappropriate
You have already flagged this document.
Thank you, for helping us keep this platform clean.
The editors will have a look at it as soon as possible.
Mail this publication
Loading...
Embed
Loading...
Delete template?
Are you sure you want to delete your template?
DOWNLOAD ePAPER
This ePaper is currently not available for download.
You can find similar magazines on this topic below under ‘Recommendations’.