**************************************************************** * * COMMENT SECTION * * DATE 1995/2/22 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. * * DML150.PCO * WRITTEN BY: Joan Sullivan * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests dynamic parameters. * * REFERENCES * FIPS PUB 127-2 14.1 Transitional SQL * ANSI SQL-1992 * ****************************************************************
MOVE"FLATER "TO uid CALL"AUTHID"USING uid MOVE"not logged in, not"TO uidx EXECSQLSELECT USER INTO :uidx FROM HU.ECCO END-EXEC MOVE SQLCODE TO SQL-COD EXECSQL ROLLBACK WORK END-EXEC MOVE SQLCODE TO SQL-COD if (uid NOT = uidx) then DISPLAY"ERROR: User ", uid " expected. User ", uidx "
- " connected" STOPRUN END-IF MOVE 0 TO errcnt
DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, dml150.pco" DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print ACCEPT TO-DAY FROMDATE ACCEPT THE-TIME FROMTIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME
******************** BEGIN TEST0845 ******************* MOVE 1 TO flag
COMPUTE int1 = -1 MOVE"xxxxxxxxxxxxxxx"TO ch15 MOVE 99 TO indic1 MOVE 99 TO indic2 DISPLAY"SELECT * INTO :ch3, :ch20:indic1, :int1 :indic2,
- " :ch15" DISPLAY" FROM HU.STAFF WHERE EMPNUM = 'E6';" EXECSQLSELECT * INTO :ch3, :ch20:indic1, :int1 :indic2,
:ch15 FROM HU.STAFF WHERE EMPNUM = 'E6'END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" " DISPLAY"int1 should be 11; its value is ", int1 DISPLAY"ch15 should be 'MinneapolisPaul'; its value is ",
ch15 DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be 0; its value is ", indic2 if (int1 NOT = 11 OR ch15 NOT = "MinneapolisPaul") then MOVE 0 TO flag END-IF if (indic1 NOT = -1 OR indic2 NOT = 0) then MOVE 0 TO flag END-IF
*dynamic parameter spec. in INSERT... SELECT... WHERE *17.6 preparable <insert statement> with 13.8 <query expression>
EXECSQLDELETEFROM CONCATBUF END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLINSERTINTO CONCATBUF VALUES ( 'INSERT INTO HU.STAFF SELECT PNUM,' || ' CAST (? AS CHAR (20)),' || ' CAST (? AS DECIMAL (4)),' || ' CAST (? AS CHAR (15))' || ' FROM HU.PROJ'
) END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLSELECT ZZ INTO :longst FROM CONCATBUF END-EXEC MOVE SQLCODE TO SQL-COD
DISPLAY"longst=""", longst """"
DISPLAY"PREPARE INS2 FROM :longst;" EXECSQL PREPARE INS2 FROM :longst END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
MOVE 13 TO int1 MOVE"Madonna of the Woods"TO ch20 MOVE"MinneapolisPaul"TO ch15 MOVE 0 TO indic1 COMPUTE indic2 = -1 DISPLAY"int1 = ", int1 DISPLAY"ch20 = ", ch20 DISPLAY"ch15 = ", ch15 DISPLAY"indic1 = ", indic1 DISPLAY"indic2 = ", indic2 DISPLAY"EXECUTE INS2 USING :ch20:indic1, :int1 :indic2,
- " :ch15;" EXECSQL EXECUTE INS2 USING :ch20:indic1, :int1 :indic2,
:ch15 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE PNUM = 'P3' AND EMPNAME = 'Madonna of
- " the Woods'" DISPLAY" AND GRADE IS NULL AND CITY =
- " 'MinneapolisPaul';" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE EMPNUM = 'P3'AND EMPNAME = 'Madonna of the Woods' AND GRADE ISNULLAND CITY = 'MinneapolisPaul'END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 1; its value is ", int1 if (int1 NOT = 1) then MOVE 0 TO flag END-IF
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF;" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 12; its value is ", int1 if (int1 NOT = 12) then MOVE 0 TO flag END-IF
*dynamic parameter spec. in 17.6 <dynamic select statement>
EXECSQLDELETEFROM CONCATBUF END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLINSERTINTO CONCATBUF VALUES ( 'SELECT * FROM HU.STAFF WHERE EMPNUM = ?' || ' OR EMPNAME = ? OR GRADE = ?'
) END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLSELECT ZZ INTO :longst FROM CONCATBUF END-EXEC MOVE SQLCODE TO SQL-COD
DISPLAY"longst=""", longst """"
DISPLAY"PREPARE SEL1 FROM :longst;" EXECSQL PREPARE SEL1 FROM :longst END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
*17.12 <dynamic declare cursor>
DISPLAY"DECLARE S1 CURSOR FOR SEL1;" EXECSQL DECLARE S1 CURSOR FOR SEL1 END-EXEC DISPLAY" "
*parameter spec. in 17.14 <dynamic open statement>
MOVE"E13"TO ch3 MOVE 11 TO int1 MOVE"Madonna of the Woods"TO ch20 MOVE 0 TO indic1 COMPUTE indic2 = -1 DISPLAY"ch3 = ", ch3 DISPLAY"ch20 = ", ch20 DISPLAY"int1 = ", int1 DISPLAY"indic1 = ", indic1 DISPLAY"indic2 = ", indic2 DISPLAY"OPEN S1 USING :ch3, :ch20:indic1, :int1:indic2;" EXECSQLOPEN S1 USING :ch3, :ch20:indic1, :int1:indic2 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
*17.15 <dynamic fetch statement>
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ch20 DISPLAY"FETCH S1 INTO :ch3, :ch20:indic1, :int1:indic2,
- " :ch15;" EXECSQL FETCH S1 INTO :ch3, :ch20:indic1, :int1:indic2,
:ch15 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"ch20 should be 'Madonna of the Woods'; its value
- " is ", ch20 DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 if (indic1 NOT = 0 OR indic2 NOT = -1) then MOVE 0 TO flag END-IF if (ch20 NOT = "Madonna of the Woods") then MOVE 0 TO flag END-IF DISPLAY" "
*parameter spec. in 17.18 <dynamic update statement: positioned>
COMPUTE indic1 = -1 DISPLAY"indic1 = ", indic1 DISPLAY"UPDATE HU.STAFF SET EMPNAME = :ch20:indic1 WHERE
- " CURRENT OF S1;" EXECSQL UPDATE HU.STAFF SET EMPNAME = :ch20:indic1 WHERE
CURRENT OF S1 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
*17.15 <dynamic fetch statement>
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ch20 DISPLAY"FETCH S1 INTO :ch3, :ch20:indic1, :int1:indic2,
- " :ch15;" EXECSQL FETCH S1 INTO :ch3, :ch20:indic1, :int1:indic2,
:ch15 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"ch20 should be 'Madonna of the Woods'; its value
- " is ", ch20 DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 if (indic1 NOT = 0 OR indic2 NOT = -1) then MOVE 0 TO flag END-IF if (ch20 NOT = "Madonna of the Woods") then MOVE 0 TO flag END-IF DISPLAY" "
*17.17 <dynamic delete statement: positioned>
DISPLAY"DELETE FROM HU.STAFF WHERE CURRENT OF S1;" EXECSQLDELETEFROM HU.STAFF WHERE CURRENT OF S1 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
*parameter spec. in 17.14 <dynamic open statement>
MOVE"E13"TO ch3 MOVE 11 TO int1 MOVE"Madonna of the Woods"TO ch20 COMPUTE indic1 = -1 MOVE 0 TO indic2 DISPLAY"ch3 = ", ch3 DISPLAY"ch20 = ", ch20 DISPLAY"int1 = ", int1 DISPLAY"indic1 = ", indic1 DISPLAY"indic2 = ", indic2 DISPLAY"OPEN S1 USING :ch3, :ch20:indic1, :int1:indic2;" EXECSQLOPEN S1 USING :ch3, :ch20:indic1, :int1:indic2 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
*17.15 <dynamic fetch statement>
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ch20 DISPLAY"FETCH S1 INTO :ch3, :ch20:indic1, :int1:indic2,
- " :ch15;" EXECSQL FETCH S1 INTO :ch3, :ch20:indic1, :int1:indic2,
:ch15 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 11; its value is ", int1 DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be 0; its value is ", indic2 if (indic1 NOT = -1 OR indic2 NOT = 0 OR int1 NOT
= 11) then MOVE 0 TO flag END-IF DISPLAY" "
*parameter spec. in 17.18 <dynamic update statement: positioned>
COMPUTE indic1 = -1 DISPLAY"indic1 = ", indic1 DISPLAY"UPDATE HU.STAFF SET CITY = :ch15:indic1 WHERE
- " CURRENT OF S1;" EXECSQL UPDATE HU.STAFF SET CITY = :ch15:indic1 WHERE
CURRENT OF S1 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE EMPNAME = 'Madonna of the Woods;'" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE EMPNAME = 'Madonna of the Woods'END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 4; its value is ", int1 if (int1 NOT = 4) then MOVE 0 TO flag END-IF
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE EMPNAME IS NULL" DISPLAY" AND (CITY IS NULL OR GRADE IS NULL);" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE EMPNAME ISNULL AND (CITY ISNULLOR GRADE ISNULL) END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 2; its value is ", int1 if (int1 NOT = 2) then MOVE 0 TO flag END-IF
*dynamic parameter spec. in DELETE... WHERE *17.6 preparable <delete statement: searched>
EXECSQLDELETEFROM CONCATBUF END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLINSERTINTO CONCATBUF VALUES ( 'DELETE FROM HU.STAFF WHERE EMPNUM=?' || ' OR GRADE=? OR CITY=?'
) END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLSELECT ZZ INTO :longst FROM CONCATBUF END-EXEC MOVE SQLCODE TO SQL-COD
DISPLAY"longst=""", longst """"
DISPLAY"PREPARE MOD1 FROM :longst;" EXECSQL PREPARE MOD1 FROM :longst END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF;" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 9; its value is ", int1 if (int1 NOT = 9) then MOVE 0 TO flag END-IF
MOVE 10 TO int1 COMPUTE indic1 = -1 MOVE 0 TO indic2 DISPLAY"int1 = ", int1 DISPLAY"indic1 = ", indic1 DISPLAY"indic2 = ", indic2 DISPLAY"EXECUTE MOD1 USING :ch3, :int1:indic1,
- " :ch15:indic2;" EXECSQL EXECUTE MOD1 USING :ch3, :int1:indic1,
:ch15:indic2 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF;" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 8; its value is ", int1 if (int1 NOT = 8) then MOVE 0 TO flag END-IF
*dynamic parameter spec. in UPDATE.. WHERE *17.6 preparable <update statement: searched>
EXECSQLDELETEFROM CONCATBUF END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLINSERTINTO CONCATBUF VALUES ( 'UPDATE HU.STAFF SET EMPNAME = ?, CITY = ?' || ' WHERE EMPNUM = ? OR GRADE = ?'
) END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLSELECT ZZ INTO :longst FROM CONCATBUF END-EXEC MOVE SQLCODE TO SQL-COD
DISPLAY"longst=""", longst """"
*17.6 GR 6 , existing SQL statement MOD1 implicitly deallocated DISPLAY"PREPARE MOD1 FROM :longst;" EXECSQL PREPARE MOD1 FROM :longst END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
MOVE"E5 "TO ch3 MOVE"Flash in the pan "TO ch20 MOVE 13 TO int1 MOVE"Migrane "TO ch15 MOVE 0 TO indic1 COMPUTE indic2 = -1 MOVE 0 TO indic3 COMPUTE indic4 = -1 DISPLAY"ch3 = ", ch3 DISPLAY"ch20 = ", ch20 DISPLAY"int1 = ", int1 DISPLAY"ch15 = ", ch15 DISPLAY"indic1 = ", indic1 DISPLAY"indic2 = ", indic2 DISPLAY"indic3 = ", indic3 DISPLAY"indic4 = ", indic4 DISPLAY"EXECUTE MOD1 " DISPLAY" USING
- " :ch20:indic1,:ch15:indic2,:ch3:indic3,:int1:indic4;" EXECSQL EXECUTE MOD1 USING
:ch20:indic1,
:ch15:indic2,
:ch3:indic3,
:int1:indic4 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE EMPNAME = 'Flash in the pan';" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE EMPNAME = 'Flash in the pan'END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 1; its value is ", int1 if (int1 NOT = 1) then MOVE 0 TO flag END-IF
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE CITY = 'Migrane';" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE CITY = 'Migrane'END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 0; its value is ", int1 if (int1 NOT = 0) then MOVE 0 TO flag END-IF
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE EMPNAME IS NULL;" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE EMPNAME ISNULLEND-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 2; its value is ", int1 if (int1 NOT = 2) then MOVE 0 TO flag END-IF
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE CITY IS NULL;" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE CITY ISNULLEND-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 2; its value is ", int1 if (int1 NOT = 2) then MOVE 0 TO flag END-IF
MOVE"P4 "TO ch3 MOVE"Flash in the pan "TO ch20 MOVE 13 TO int1 MOVE"Migrane "TO ch15 COMPUTE indic1 = -1 MOVE 0 TO indic2 COMPUTE indic3 = -1 MOVE 0 TO indic4 DISPLAY"ch3 = ", ch3 DISPLAY"ch20 = ", ch20 DISPLAY"int1 = ", int1 DISPLAY"ch15 = ", ch15 DISPLAY"indic1 = ", indic1 DISPLAY"indic2 = ", indic2 DISPLAY"indic3 = ", indic3 DISPLAY"indic4 = ", indic4 DISPLAY"EXECUTE MOD1 " DISPLAY" USING
- " :ch20:indic1,:ch15:indic2,:ch3:indic3,:int1:indic4;" EXECSQL EXECUTE MOD1 USING
:ch20:indic1,
:ch15:indic2,
:ch3:indic3,
:int1:indic4 END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE EMPNAME = 'Flash in the pan';" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE EMPNAME = 'Flash in the pan'END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 0; its value is ", int1 if (int1 NOT = 0) then MOVE 0 TO flag END-IF
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE CITY = 'Migrane';" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE CITY = 'Migrane'END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 2; its value is ", int1 if (int1 NOT = 2) then MOVE 0 TO flag END-IF
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE EMPNAME IS NULL;" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE EMPNAME ISNULLEND-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 4; its value is ", int1 if (int1 NOT = 4) then MOVE 0 TO flag END-IF
COMPUTE int1 = -1 DISPLAY"SELECT COUNT(*) INTO :int1 FROM HU.STAFF" DISPLAY" WHERE CITY IS NULL;" EXECSQLSELECTCOUNT(*) INTO :int1 FROM HU.STAFF
WHERE CITY ISNULLEND-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 1; its value is ", int1 if (int1 NOT = 1) then MOVE 0 TO flag END-IF
DISPLAY"ROLLBACK WORK;" EXECSQL ROLLBACK WORK END-EXEC MOVE SQLCODE TO SQL-COD
if ( flag = 1 ) then DISPLAY" *** pass *** " EXECSQLINSERTINTO HU.TESTREPORT
VALUES('0845','pass','PCO') END-EXEC MOVE SQLCODE TO SQL-COD else DISPLAY" dml150.pco *** fail *** " EXECSQLINSERTINTO HU.TESTREPORT
VALUES('0845','fail','PCO') END-EXEC MOVE SQLCODE TO SQL-COD COMPUTE errcnt = errcnt + 1 END-IF
EXECSQL COMMIT WORK END-EXEC MOVE SQLCODE TO SQL-COD ******************** END TEST0845 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK. DISPLAY"SQLCODE should be 0; its value is ", SQL-COD DISPLAY"SQLSTATE should be 00000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODE NOT = 0 OR NORMSQ NOT = "00000") then MOVE 0 TO flag END-IF if (NORMSQ = "00000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." 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 TO NORMSQ
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 if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) 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 GOTO 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 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
MOVE 5 TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROM 1 BY 1 UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then 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
if (NORMSQX(1) = "0"AND NORMSQX(2) = "1") then MOVE"0"TO NORMSQX(2) END-IF
.
EXIT-NOSUBCLASS. EXIT.
¤ Dauer der Verarbeitung: 0.4 Sekunden
(vorverarbeitet)
¤
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.