* Standard COBOL (file "CDR028.SCO") calling SQL * procedures in file "CDR028.MCO". * STANDARD COBOL (file "CDR028.SCO")
**************************************************************** * * COMMENT SECTION * * DATE 1992/07/02 STANDARD 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. * * CDR028.SCO * WRITTEN BY: DAVID W. FLATER * * THIS ROUTINE TESTS REFERENTIAL INTEGRITY. * ****************************************************************
*This table should be OK (albeit probably empty) DISPLAY"SELECT COUNT(*) INTO :count1 FROM RASTER;" * EXEC SQL SELECT COUNT(*) INTO :count1 FROM RASTER; CALL"SUB2"USING SQLCODE count1 MOVE SQLCODE TO SQL-COD MOVE SQLCODE TO ii DISPLAY"SQLCODE should be 0; its value is ", ii
if (ii NOT = 0) then MOVE 0 TO flag END-IF
*Either this table should not be here, or it should be *here without the illegal constraints, in which case *there should have been appropriate errors and warnings *when the schema was loaded.
*Is the table even here? DISPLAY" " DISPLAY"SELECT COUNT(*) FROM REFRESH;" DISPLAY" (ii=SQLCODE)" * EXEC SQL SELECT COUNT(*) INTO :count1 FROM REFRESH; CALL"SUB3"USING SQLCODE count1 MOVE SQLCODE TO SQL-COD MOVE SQLCODE TO ii
DISPLAY"INSERT INTO REFRESH VALUES ('cabbage');" * EXEC SQL INSERT INTO REFRESH * VALUES ('cabbage'); CALL"SUB4"USING SQLCODE MOVE SQLCODE TO SQL-COD
DISPLAY"ii and SQLCODE should either both be < 0 or both
- " be 0" DISPLAY"ii = ", ii "; SQLCODE = ", SQL-COD
if (ii = 0 AND SQLCODE NOT = 0) then MOVE 0 TO flag END-IF if (ii NOT = 0 AND SQLCODE = 0) then MOVE 0 TO flag END-IF if (ii > 0 OR SQLCODE > 0) then MOVE 0 TO flag END-IF
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 ist noch experimentell.