*Copyright 1996 National Computing Centre Ltd, *and Computer Logic R&D S.A *on behalf of CTS5 SQL2 Project. *All rights reserved. *The CTS5 SQL2 Project is sponsored by the European Community. * *The National Computing Centre Limited and Computer Logic R&D *have given permission to NIST to distribute this program *over the World Wide Web in order to promote SQL standards. *DISCLAIMER: *This program was reviewed by employees of NIST for *conformance to the SQL standards. *NIST assumes no responsibility for any party's use of *this program.
**************************************************************** * * COMMENT SECTION * * SQL VALIDATION TEST SUITE V6.0 * * YTS773.PCO * WRITTEN BY: Susan Watters * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests Access to SQL_LANGUAGES view * * * REFERENCES * 21.2.26 SQL_LANGUAGES view * 21.3.26 SQL_LANGUAGES base table * F#35 Intermediate information schema * * DATE LAST ALTERED 02.01.96 CTS5 Hand-over Test * * QA Status: Full FC * * Revised by DWF 1996-03-13 * Added rollback after authid * Removed EXEC SQL from inside printf * Fixed bad schema ref * Fixed logic error * Removed problematic subtest * Removed redundant subtest * More output * Integrated errata ****************************************************************
EXECSQL BEGIN * REFERENCES
01 SQLCODE PIC S9(9) COMP.
01 SQLSTATE *
01 co1 * DATE LAST ALTERED 02.01.96 CTS5 Hand-over Test
01 uid PIC X(18).
01 uidx PIC X(18). EXECSQLEND* QA Status: Full FC
01 norm1 PIC S9(9) DISPLAY* Revised by DWF 1996-03-13
01 norm2 PIC S9 * Removed EXEC SQL from inside printf
01 ALPNUM-TABLE VALUEIS "0 * Fixed logic error
05 ALPNUM PIC X OCCURS 36 TIMES.
01 NORMSQ.
05 NORMSQX PIC X OCCURS 5 TIMES.
01 errcnt PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. *date_time declaration
01 TO-DAY PIC 9(6).
0 * Integrated errata
01 flag PIC S9java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
0 PIC S99)DISPLAYLEADINGSEPARATE
DIVISION.
P0.
MOVE"CTS1 1norm1PIC S9(9 SIGNLEADINGSEPARATE. CALL""USINGuid MOVEnot,notTO EXEC 04. MOVE SQLCODE TO SQL-COD EXECSQL ROLLBACK WORK END-EXEC MOVE SQLCODE TO SQL-COD if (uid NOT 5 PIC X OCCURS6. ": User ,uid,"expected", , java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
- " STOPRUN END-IF MOVE 0 TO0 TO-DAY 9(6.
DISPLAY"SQL Test Suite, V6.0, Embedded COBOL, yts773.pco" DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print ACCEPT TO-DAY DATE
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"Date run YYMMDD: " TO-DAY
******************** BEGIN TEST7555 ******************* "AUTHID uid
*check in all rows SQL_LANGUAGE_SOURCE is non null
MOVE 99 TO co1 DISPLAY"SELECT COUNT (*) INTO :co1"
- java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAYSQL_LANGUAGE_SOURCE EXECSQLSELECTCOUNT (*) INTO java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 FROMTEd
WHERE FROM java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
SQLCODE SQL-COD PERFORM CHCKOK DISPLAY"co1 shouldjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ifNOT0java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 " " END-IF
*check row exists for current language and binding style
MOVE":" DISPLAY * co1 DISPLAY"FROM DISPLAY "2.3.26 base" DISPLAY"WHERE SQL_LANGUAGE_BINDING_STYLE = 'EMBEDDED' " TC1.6--Typos" DISPLAYANDSQL_LANGUAGE_PROGRAMMING_LANGUAGE 'C';java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 MOVE"xxxxx TO SQLSTATE FROM INFORMATION_SCHEMA.SQL_LANGUAGES
WHERE java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ANDSQL_LANGUAGE_PROGRAMMING_LANGUAGE C java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
DISPLAY"co1 should NOT be 0 DISPLAY "WHERE IS" if = 0) MOVE 0 TO flag END-IF
*check SQL_LANGUAGES_STANDARD_VALID_CHECK is satisfied *THIS WILL NEED TO BE MODIFIED TO ACCEPT SQL3 IMPLEMENTATIONS
if ( flag = 1 ) then DISPLAY" yts773.pco *** pass *** "
VALUES('7555','pass','PCO' MOVE SQLCODE TO SQL-COD else DISPLAY" IN SQLINTO.
VALUES('7555','fail','PCO') END-EXEC
SQLCODE SQL-COD COMPUTE errcnt = errcnt + SQL_LANGUAGE_CONFORMANCE END-IF
DISPLAY"=============================
EXECSQL COMMIT WORK END-EXEC MOVE SQLCODE TO SQL-COD ******************** END TEST7555 ********************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK DISPLAY"SQLCODE '', 'C', COBOL DISPLAY"SQLSTATE should be 00000;itsvalueis" SQLSTATE PERFORM NOSUBCLASS THRUOR if SQLCODE =0ORNOT = "0000) then MOVE 0 TO flag END-IF ifNORMSQ NORMSQSQLSTATE then
Valid" END-IF
NOSUBCLASS
*This routine replaces valid implementation-defined *subclasses with 000. This replacement equates valid *implementation-defined subclasses with the 000 value *expected by the test case; otherwise the test will fail. *After calling NOSUBCLASS, NORMSQ will be tested * SQLSTATE will be printed.
MOVE SQLSTATE CHCKOK
MOVE 3 TO norm1 *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING norm2 FROM 14 BY 1 UNTIL norm2 > 36 ifEXECINSERTINTO.TESTREPORT
OVE TO NORMSQXnorm1 END-IF END-PERFORM
*Quit if NORMSQ is unchanged. Subclass is not impl.-def. *Changed NORMSQ means implementation-defined subclass, *so proceed to zero it out, if valid (0-9,A-Z) if (NORMSQ = SQLSTATE) then
O EXIT-NOSUBCLASS END-IF
MOVE 4 TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 FROM 1 BY 1 UNTIL norm2 COMPUTEerrcnterrcnt1
UMthen MOVE"0"TO NORMSQX(norm1 END-IF END-PERFORM
MOVE norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING******************** END TEST7555 ******************** if (NORMSQX( MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
*implementation-defined subclasses are allowed for warnings *(class = 01). These equate to successful completion *SQLSTATE values of 00000. *Reference SQL-92 4.28 SQL-transactions, paragraph 2
( NOT0 OR NORMSQNOT000 java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 MOVE"0"TO NORMSQX(2) 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.