**************************************************************** * * 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. * * CDR005.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
MOVE 0 TO errcnt DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, cdr005.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 TEST0313 ******************* *This test case checks the integrity constraint: * GRADE > 0 AND GRADE < 20 on STAFF5 * declared in <table constraint definition> * <Comparison Predicate> *Using UPDATE check violation.
DISPLAY" " EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD ****************** END TEST0313 *****************************
******************** BEGIN TEST0314 ******************* *This test case checks the integrity constraint: * GRADE > 0 AND GRADE < 20 on STAFF6 * declared in <column definition> * <Comparison Predicate> * Using UPDATE to check violation
DISPLAY" " EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD ****************** END TEST0314 *****************************
******************** BEGIN TEST0315 ******************* *This test case checks the integrity constraint: * GRADE BETWEEN 1 AND 20 * declared in <table constraint definition> * <between Predicate> * Using UPDATE to check violation
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.