**************************************************************** * * COMMENT SECTION * * DATE 1989/04/07 EMBEDDED COBOL LANGUAGE * NIST SQL VALIDATION TEST SUITE V6.0 * DISCLAIMER: * This program was written by employees of NIST to test SQL * implementations for conformance to the SQL standards. * NIST assumes no responsibility for any party's use of * this program. * * CDR002.PCO * WRITTEN BY: SUN DAJUN * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * THIS ROUTINE TESTS THE <CHECK> CONSTRAINT. * * REFERENCES * AMERICAN NATIONAL STANDARD database language - SQL * with Integrity Enhancement * * SECTION 6.8 * <check constraint definition>::= * CHECK (<search condition>) ****************************************************************
MOVE"SUN"TO uid CALL"AUTHID"USING uid MOVE"not logged in, not"TO uidx EXECSQLSELECT
USER INTO :uidx FROM SUN.ECCO END-EXEC if (uid NOT = uidx) then DISPLAY"ERROR: User " uid " expected." DISPLAY"User " uidx " connected." DISPLAY" " STOPRUN END-IF
MOVE0TO errcnt DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, cdr002.pco" DISPLAY" " DISPLAY "59-byte ID" DISPLAY"TEd Version #" DISPLAY" " * date_time print * ACCEPT TO-DAY FROMDATE ACCEPT THE-TIME FROMTIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME ******************** BEGIN TEST0302 ******************* *This test case checks the integrity constraint: * GRADE > 0 AND GRADE < 20 on STAFF5 * declared in <table constraint definition> * <Comparison Predicate>
DISPLAY" " EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD ****************** END TEST0302 *****************************
******************** BEGIN TEST0303 ******************* *This test case checks the integrity constraint: * GRADE > 0 AND GRADE < 20 on STAFF6 * declared in <column definition> * <Comparison Predicate>
DISPLAY" " EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD ****************** END TEST0303 *****************************
******************** BEGIN TEST0304 ******************* *This test case checks the integrity constraint: * GRADE BETWEEN 1 AND 20 * declared in <table constraint definition> * <between Predicate>
DISPLAY" " EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD ****************** END TEST0304 *****************************
******************** BEGIN TEST0305 ******************* *This test case checks the integrity constraint: * EMPNAME IS NOT NULL on STAFF8 * declared in <table constraint definition> * <null predicate>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.