Advanced functions and administration on DB2 Universal by Hernando Bedoya; et al

By Hernando Bedoya; et al

Show description

Read Online or Download Advanced functions and administration on DB2 Universal Database for iSeries PDF

Best programming books

Concurrent Programming on Windows

Writer Joe Duffy has risen to the problem of explaining the best way to write software program that takes complete good thing about concurrency and parallelism. In Concurrent Programming on home windows, he explains the best way to layout, enforce, and retain large-scale concurrent courses, basically utilizing C# and C++ for home windows.

Developing with PDF: Dive Into the Portable Document Format

PDF is changing into the normal for electronic files around the world, yet it's tough to profit by yourself. With functions that allow you to use a number of photographs and textual content, embed audio and video, and supply hyperlinks and navigation, there's much to discover. This useful consultant is helping you know the way to paintings with PDF to build your personal files, troubleshoot difficulties, or even construct your individual instruments.

Learn Objective-C on the Mac: For iOS and OS X (2nd Edition)

Learn how to write apps for a few of today's most well liked applied sciences, together with the iPhone and iPad (using iOS), in addition to the Mac (using OS X). It starts off with Objective-C, the bottom language on which the local iOS software program improvement package (SDK) and the OS X are established. study Objective-C at the Mac: For OS X and iOS, moment variation updates a top promoting ebook and is an in depth, newly up-to-date advisor to Objective-C.

Additional resources for Advanced functions and administration on DB2 Universal Database for iSeries

Sample text

Check pending This is the state of a referential constraint when potential mismatches exist between foreign and parent keys for a constraint relationship. 1 Constraint prerequisites You can find a full description of the prerequisites and limitations on the database files and the constraints themselves in Database Programming, SC41-5701. The basic requirement is that your parent key and foreign key must have matching field attributes and definitions. This section also points out some other considerations.

On the other hand, when you delete an order, you should remove all the related items and all the corresponding features from the database. For this reason, you need to define two referential constraints: The first one between FEATURE and DETAIL The second one between DETAIL and ORDERH For both constraints, the delete rule must be CASCADE. The update rule can be either RESTRICT or NOACTION. Now, create the tables that were previously described: CREATE TABLE TEST/ORDERH (ORDER_NUMBER FOR COLUMN ORHNBR CHAR (5) CUSTOMER_NUMBER FOR COLUMN CUSNBR CHAR (5) ORDER_INS_DATE FOR COLUMN ORHDTE DATE NOT ORDER_DELIV_DATE FOR COLUMN ORHDLY DATE NOT ORDER_TOTAL FOR COLUMN ORHTOT DEC(11,2) NOT CONSTRAINT ORDERH_KEY PRIMARY KEY (ORHNBR)) NOT NULL, NOT NULL, NULL, NULL, NULL WITH DEFAULT 0, CREATE TABLE TEST/DETAIL (ORDER_NUMBER FOR COLUMN ORHNBR CHAR (5) NOT NULL, PRODUCT_NUMBER FOR COLUMN PRDNBR CHAR (5) NOT NULL, PRODUCT_QUANTITY FOR COLUMN PRDQTY DEC (5, 0) NOT NULL, PRODUCT_TOTAL FOR COLUMN PRDTOT DEC (9, 2) NOT NULL, CONSTRAINT DETAIL_KEY PRIMARY KEY (ORHNBR, PRDNBR), CONSTRAINT DETAIL_ORD FOREIGN KEY (ORHNBR) REFERENCES TEST/ORDERH (ORHNBR) ON DELETE CASCADE ON UPDATE RESTRICT) CREATE TABLE TEST/FEATURE (ORDER_NUMBER FOR COLUMN ORHNBR CHAR (5) NOT NULL, PRODUCT_NUMBER FOR COLUMN PRDNBR CHAR (5) NOT NULL, FEATURE_NUMBER FOR COLUMN FTRNBR CHAR (5) NOT NULL, FEATURE_QUANTITY FOR COLUMN FTRQTY DEC(5,0) NOT NULL, FEATURE_TOTAL FOR COLUMN FTRTOT DEC(9,2) NOT NULL, CONSTRAINT FTR_KEY PRIMARY KEY (ORHNBR, PRDNBR, FTRNBR), CONSTRAINT FTR_PRD FOREIGN KEY (ORHNBR, PRDNBR) REFERENCES TEST/DETAIL (ORHNBR,PRDNBR) ON DELETE CASCADE ON UPDATE RESTRICT) If TEST is not an SQL collection, you must explicitly start journaling the files to the same journal.

Sequence . . . : QSQJRN 2309 Code . . . . : Type . . . . : R - Operation on specific record DL - Record deleted Object .

Download PDF sample

Rated 4.75 of 5 – based on 48 votes