**************************************************************** * * COMMENT SECTION * * DATE 1995/2/6 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. * * DML148.PCO * WRITTEN BY: Joan Sullivan (mostly) * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * Embedded COBOL by David Flater * * This routine tests the ordering of columns in joins. * * 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 MOVESQLCODETO SQL-COD EXECSQLROLLBACK WORK END-EXEC MOVESQLCODETO SQL-COD if (uid NOT = uidx) then DISPLAY"ERROR: User ", uid " expected. User ", uidx "
- " connected" STOPRUN END-IF MOVE0TO errcnt
DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, dml148.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 TEST0843 ******************* MOVE1TO flag
MOVE"xxx"TO pn MOVE"xxx"TO en COMPUTE hr = -1 MOVE"xxxxxxxxxxxxxxxxxxxx"TO pname MOVE"xxxxxx"TO pt COMPUTE bu = -1 MOVE"xxxxxxxxxxxxxxx"TO ct DISPLAY"FETCH C14811 INTO :pn, :en, :hr, :pname, :pt, :bu,
- " :ct;" EXECSQL FETCH C14811 INTO :pn, :en, :hr, :pname, :pt, :bu,
:ct END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P2; its value is ", pn DISPLAY"en should be E4; its value is ", en DISPLAY"hr should be 20; its value is ", hr DISPLAY"pname should be CALM; its value is ", pname DISPLAY"pt should be Code; its value is ", pt DISPLAY"bu should be 30000; its value is ", bu DISPLAY"ct should be Vienna; its value is ", ct if (pn NOT = "P2"OR en NOT = "E4") then MOVE0TO flag END-IF if (hr NOT = 20OR pname NOT = "CALM") then MOVE0TO flag END-IF if (pt NOT = "Code"OR bu NOT = 30000) then MOVE0TO flag END-IF if (ct NOT = "Vienna") then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en COMPUTE hr = -1 MOVE"xxxxxxxxxxxxxxxxxxxx"TO pname MOVE"xxxxxx"TO pt COMPUTE bu = -1 MOVE"xxxxxxxxxxxxxxx"TO ct DISPLAY"FETCH C14811 INTO :pn, :en, :hr, :pname, :pt, :bu,
- " :ct;" EXECSQL FETCH C14811 INTO :pn, :en, :hr, :pname, :pt, :bu,
:ct END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P4; its value is ", pn DISPLAY"en should be E4; its value is ", en DISPLAY"hr should be 40; its value is ", hr DISPLAY"pname should be SDP; its value is ", pname DISPLAY"pt should be Design; its value is ", pt DISPLAY"bu should be 20000; its value is ", bu DISPLAY"ct should be Deale; its value is ", ct if (pn NOT = "P4"OR en NOT = "E4") then MOVE0TO flag END-IF if (hr NOT = 40OR pname NOT = "SDP") then MOVE0TO flag END-IF if (pt NOT = "Design"OR bu NOT = 20000) then MOVE0TO flag END-IF if (ct NOT = "Deale") then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en COMPUTE hr = -1 MOVE"xxxxxxxxxxxxxxxxxxxx"TO pname MOVE"xxxxxx"TO pt COMPUTE bu = -1 MOVE"xxxxxxxxxxxxxxx"TO ct DISPLAY"FETCH C14812 INTO :pn, :en, :hr, :pname, :pt, :bu,
- " :ct;" EXECSQL FETCH C14812 INTO :pn, :en, :hr, :pname, :pt, :bu,
:ct END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P2; its value is ", pn DISPLAY"en should be E4; its value is ", en DISPLAY"hr should be 20; its value is ", hr DISPLAY"pname should be CALM; its value is ", pname DISPLAY"pt should be Code; its value is ", pt DISPLAY"bu should be 30000; its value is ", bu DISPLAY"ct should be Vienna; its value is ", ct if (pn NOT = "P2"OR en NOT = "E4") then MOVE0TO flag END-IF if (hr NOT = 20OR pname NOT = "CALM") then MOVE0TO flag END-IF if (pt NOT = "Code"OR bu NOT = 30000) then MOVE0TO flag END-IF if (ct NOT = "Vienna") then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en COMPUTE hr = -1 MOVE"xxxxxxxxxxxxxxxxxxxx"TO pname MOVE"xxxxxx"TO pt COMPUTE bu = -1 MOVE"xxxxxxxxxxxxxxx"TO ct DISPLAY"FETCH C14812 INTO :pn, :en, :hr, :pname, :pt, :bu,
- " :ct;" EXECSQL FETCH C14812 INTO :pn, :en, :hr, :pname, :pt, :bu,
:ct END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P4; its value is ", pn DISPLAY"en should be E4; its value is ", en DISPLAY"hr should be 40; its value is ", hr DISPLAY"pname should be SDP; its value is ", pname DISPLAY"pt should be Design; its value is ", pt DISPLAY"bu should be 20000; its value is ", bu DISPLAY"ct should be Deale; its value is ", ct if (pn NOT = "P4"OR en NOT = "E4") then MOVE0TO flag END-IF if (hr NOT = 40OR pname NOT = "SDP") then MOVE0TO flag END-IF if (pt NOT = "Design"OR bu NOT = 20000) then MOVE0TO flag END-IF if (ct NOT = "Deale") then MOVE0TO flag END-IF
DISPLAY"DECLARE C14813 CURSOR FOR" DISPLAY" SELECT * FROM HU.WORKS RIGHT JOIN HU.PROJ" DISPLAY" ON HU.WORKS.PNUM = HU.PROJ.PNUM" DISPLAY" ORDER BY 1 DESC, 2;" EXECSQL DECLARE C14813 CURSOR FOR SELECT * FROM HU.WORKS RIGHT JOIN HU.PROJ ON HU.WORKS.PNUM = HU.PROJ.PNUM ORDERBY1 DESC, 2END-EXEC
MOVE"xxx"TO pn MOVE"xxx"TO pn2 MOVE"xxx"TO en COMPUTE hr = -1 MOVE"xxxxxxxxxxxxxxxxxxxx"TO pname MOVE"xxxxxx"TO pt COMPUTE bu = -1 MOVE"xxxxxxxxxxxxxxx"TO ct DISPLAY"FETCH C14813 INTO :en, :pn, :hr, :pn2, :pname,
- " :pt, :bu, :ct;" EXECSQL FETCH C14813 INTO :en, :pn, :hr, :pn2, :pname,
:pt, :bu, :ct END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be E4; its value is ", en DISPLAY"pn should be P2; its value is ", pn DISPLAY"hr should be 20; its value is ", hr DISPLAY"pn2 should be P2; its value is ", pn2 DISPLAY"pname should be CALM; its value is ", pname DISPLAY"pt should be Code; its value is ", pt DISPLAY"bu should be 30000; its value is ", bu DISPLAY"ct should be Vienna; its value is ", ct if (en NOT = "E4"OR pn NOT = "P2") then MOVE0TO flag END-IF if (hr NOT = 20OR pname NOT = "CALM") then MOVE0TO flag END-IF if (pt NOT = "Code"OR bu NOT = 30000) then MOVE0TO flag END-IF if (ct NOT = "Vienna"OR pn2 NOT = "P2") then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO pn2 MOVE"xxx"TO en COMPUTE hr = -1 MOVE"xxxxxxxxxxxxxxxxxxxx"TO pname MOVE"xxxxxx"TO pt COMPUTE bu = -1 MOVE"xxxxxxxxxxxxxxx"TO ct DISPLAY"FETCH C14813 INTO :en, :pn, :hr, :pn2, :pname,
- " :pt, :bu, :ct;" EXECSQL FETCH C14813 INTO :en, :pn, :hr, :pn2, :pname,
:pt, :bu, :ct END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"en should be E4; its value is ", en DISPLAY"pn should be P4; its value is ", pn DISPLAY"hr should be 40; its value is ", hr DISPLAY"pn2 should be P4; its value is ", pn2 DISPLAY"pname should be SDP; its value is ", pname DISPLAY"pt should be Design; its value is ", pt DISPLAY"bu should be 20000; its value is ", bu DISPLAY"ct should be Deale; its value is ", ct if (en NOT = "E4"OR pn NOT = "P4") then MOVE0TO flag END-IF if (hr NOT = 40OR pname NOT = "SDP") then MOVE0TO flag END-IF if (pt NOT = "Design"OR bu NOT = 20000) then MOVE0TO flag END-IF if (ct NOT = "Deale"OR pn2 NOT = "P4") then MOVE0TO flag END-IF
EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD ******************** END TEST0843 ******************** ******************** BEGIN TEST0844 ******************* MOVE1TO flag
DISPLAY"DECLARE C14821 CURSOR FOR" DISPLAY" SELECT EMPNAME, CITY, T_DECIMAL" DISPLAY" FROM HU.STAFF LEFT OUTER JOIN SEVEN_TYPES " DISPLAY" ON -GRADE / 11 BETWEEN T_REAL AND T_DECIMAL" DISPLAY" ORDER BY EMPNAME;" EXECSQL DECLARE C14821 CURSOR FOR SELECT EMPNAME, CITY, T_DECIMAL FROM HU.STAFF LEFT OUTER JOIN SEVEN_TYPES ON -GRADE / 11 BETWEEN T_REAL AND T_DECIMAL ORDERBY EMPNAME END-EXEC
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxx"TO ct MOVE48TO int1 MOVE48TO indic1 DISPLAY"FETCH C14821 INTO :ename, :ct, :int1:indic1;" EXECSQL FETCH C14821 INTO :ename, :ct, :int1:indic1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be Alice; its value is ", ename DISPLAY"ct should be Deale; its value is ", ct DISPLAY"indic1 should be -1; its value is ", indic1 if (ename NOT = "Alice"OR ct NOT = "Deale") then MOVE0TO flag END-IF if (indic1 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxx"TO ct MOVE48TO int1 MOVE48TO indic1 DISPLAY"FETCH C14821 INTO :ename, :ct, :int1:indic1;" EXECSQL FETCH C14821 INTO :ename, :ct, :int1:indic1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be Betty; its value is ", ename DISPLAY"ct should be Vienna; its value is ", ct DISPLAY"int1 should be 0; its value is ", int1 DISPLAY"indic1 should be 0; its value is ", indic1 if (ename NOT = "Betty"OR ct NOT = "Vienna") then MOVE0TO flag END-IF if (int1 NOT = 0OR indic1 NOT = 0) then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxx"TO ct MOVE48TO int1 MOVE48TO indic1 DISPLAY"FETCH C14821 INTO :ename, :ct, :int1:indic1;" EXECSQL FETCH C14821 INTO :ename, :ct, :int1:indic1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be Betty; its value is ", ename DISPLAY"ct should be Vienna; its value is ", ct DISPLAY"int1 should be 0; its value is ", int1 DISPLAY"indic1 should be 0; its value is ", indic1 if (ename NOT = "Betty"OR ct NOT = "Vienna") then MOVE0TO flag END-IF if (int1 NOT = 0OR indic1 NOT = 0) then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxx"TO ct MOVE48TO int1 MOVE48TO indic1 DISPLAY"FETCH C14821 INTO :ename, :ct, :int1:indic1;" EXECSQL FETCH C14821 INTO :ename, :ct, :int1:indic1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be Carmen; its value is ", ename DISPLAY"ct should be Vienna; its value is ", ct DISPLAY"indic1 should be -1; its value is ", indic1 if (ename NOT = "Carmen"OR ct NOT = "Vienna") then MOVE0TO flag END-IF if (indic1 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxx"TO ct MOVE48TO int1 MOVE48TO indic1 DISPLAY"FETCH C14821 INTO :ename, :ct, :int1:indic1;" EXECSQL FETCH C14821 INTO :ename, :ct, :int1:indic1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be Don; its value is ", ename DISPLAY"ct should be Deale; its value is ", ct DISPLAY"indic1 should be -1; its value is ", indic1 if (ename NOT = "Don"OR ct NOT = "Deale") then MOVE0TO flag END-IF if (indic1 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxxxxxxxxxxxxxx"TO ct MOVE48TO int1 MOVE48TO indic1 DISPLAY"FETCH C14821 INTO :ename, :ct, :int1:indic1;" EXECSQL FETCH C14821 INTO :ename, :ct, :int1:indic1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"ename should be Ed; its value is ", ename DISPLAY"ct should be Akron; its value is ", ct DISPLAY"indic1 should be -1; its value is ", indic1 if (ename NOT = "Ed"OR ct NOT = "Akron") then MOVE0TO flag END-IF if (indic1 NOT = -1) then MOVE0TO flag END-IF
DISPLAY"FETCH C14821 INTO :ename, :ct, :int1:indic1;" EXECSQL FETCH C14821 INTO :ename, :ct, :int1:indic1 END-EXEC MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
MOVE49TO int1 MOVE49TO indic1 MOVE"xxxxxxxxxx"TO tc MOVE49TO indic2 MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxx"TO en MOVE49TO gr DISPLAY"FETCH C14822 INTO :int1:indic1, :tc:indic2,
- " :ename, :en, :gr;" EXECSQL FETCH C14822 INTO :int1:indic1, :tc:indic2,
:ename, :en, :gr END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 DISPLAY"ename should be Alice; its value is ", ename DISPLAY"en should be E1; its value is ", en DISPLAY"gr should be 12; its value is ", gr if (indic1 NOT = -1OR indic2 NOT = -1) then MOVE0TO flag END-IF if (ename NOT = "Alice"OR en NOT = "E1") then MOVE0TO flag END-IF if (gr NOT = 12) then MOVE0TO flag END-IF
MOVE49TO int1 MOVE49TO indic1 MOVE"xxxxxxxxxx"TO tc MOVE49TO indic2 MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxx"TO en MOVE49TO gr DISPLAY"FETCH C14822 INTO :int1:indic1, :tc:indic2,
- " :ename, :en, :gr;" EXECSQL FETCH C14822 INTO :int1:indic1, :tc:indic2,
:ename, :en, :gr END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"indic2 should be 0; its value is ", indic2 DISPLAY"int1 should be 2; its value is ", int1 DISPLAY"tc should be E2; its value is ", tc DISPLAY"ename should be Betty; its value is ", ename DISPLAY"en should be E2; its value is ", en DISPLAY"gr should be 10; its value is ", gr if (indic1 NOT = 0OR indic2 NOT = 0) then MOVE0TO flag END-IF if (int1 NOT = 2OR tc NOT = "E2") then MOVE0TO flag END-IF if (ename NOT = "Betty"OR en NOT = "E2") then MOVE0TO flag END-IF if (gr NOT = 10) then MOVE0TO flag END-IF
MOVE49TO int1 MOVE49TO indic1 MOVE"xxxxxxxxxx"TO tc MOVE49TO indic2 MOVE"xxxxxxxxxxxxxxxxxxxx"TO ename MOVE"xxx"TO en MOVE49TO gr DISPLAY"FETCH C14822 INTO :int1:indic1, :tc:indic2,
- " :ename, :en, :gr;" EXECSQL FETCH C14822 INTO :int1:indic1, :tc:indic2,
:ename, :en, :gr END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 DISPLAY"ename should be Carmen; its value is ", ename DISPLAY"en should be E3; its value is ", en DISPLAY"gr should be 13; its value is ", gr if (indic1 NOT = -1OR indic2 NOT = -1) then MOVE0TO flag END-IF if (ename NOT = "Carmen"OR en NOT = "E3") then MOVE0TO flag END-IF if (gr NOT = 13) then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en MOVE5TO bu MOVE5TO hr MOVE5TO indic1 MOVE5TO indic2 DISPLAY"FETCH C14823 INTO :pn, :bu, :hr:indic1,
- " :en:indic2;" EXECSQL FETCH C14823 INTO :pn, :bu, :hr:indic1, :en:indic2 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P1; its value is ", pn DISPLAY"bu should be 10000; its value is ", bu DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 if (pn NOT = "P1"OR bu NOT = 10000) then MOVE0TO flag END-IF if (indic1 NOT = -1OR indic2 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en MOVE5TO bu MOVE5TO hr MOVE5TO indic1 MOVE5TO indic2 DISPLAY"FETCH C14823 INTO :pn, :bu, :hr:indic1,
- " :en:indic2;" EXECSQL FETCH C14823 INTO :pn, :bu, :hr:indic1, :en:indic2 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P2; its value is ", pn DISPLAY"bu should be 30000; its value is ", bu DISPLAY"hr should be 80; its value is ", hr DISPLAY"en should be E2; its value is ", en DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"indic2 should be 0; its value is ", indic2 if (pn NOT = "P2"OR bu NOT = 30000) then MOVE0TO flag END-IF if (indic1 NOT = 0OR indic2 NOT = 0) then MOVE0TO flag END-IF if (hr NOT = 80OR en NOT = "E2") then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en MOVE5TO bu MOVE5TO hr MOVE5TO indic1 MOVE5TO indic2 DISPLAY"FETCH C14823 INTO :pn, :bu, :hr:indic1,
- " :en:indic2;" EXECSQL FETCH C14823 INTO :pn, :bu, :hr:indic1, :en:indic2 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P3; its value is ", pn DISPLAY"bu should be 30000; its value is ", bu DISPLAY"hr should be 80; its value is ", hr DISPLAY"en should be E1; its value is ", en DISPLAY"indic1 should be 0; its value is ", indic1 DISPLAY"indic2 should be 0; its value is ", indic2 if (pn NOT = "P3"OR bu NOT = 30000) then MOVE0TO flag END-IF if (indic1 NOT = 0OR indic2 NOT = 0) then MOVE0TO flag END-IF if (hr NOT = 80OR en NOT = "E1") then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en MOVE5TO bu MOVE5TO hr MOVE5TO indic1 MOVE5TO indic2 DISPLAY"FETCH C14823 INTO :pn, :bu, :hr:indic1,
- " :en:indic2;" EXECSQL FETCH C14823 INTO :pn, :bu, :hr:indic1, :en:indic2 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P4; its value is ", pn DISPLAY"bu should be 20000; its value is ", bu DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 if (pn NOT = "P4"OR bu NOT = 20000) then MOVE0TO flag END-IF if (indic1 NOT = -1OR indic2 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en MOVE5TO bu MOVE5TO hr MOVE5TO indic1 MOVE5TO indic2 DISPLAY"FETCH C14823 INTO :pn, :bu, :hr:indic1,
- " :en:indic2;" EXECSQL FETCH C14823 INTO :pn, :bu, :hr:indic1, :en:indic2 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P5; its value is ", pn DISPLAY"bu should be 10000; its value is ", bu DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 if (pn NOT = "P5"OR bu NOT = 10000) then MOVE0TO flag END-IF if (indic1 NOT = -1OR indic2 NOT = -1) then MOVE0TO flag END-IF
MOVE"xxx"TO pn MOVE"xxx"TO en MOVE5TO bu MOVE5TO hr MOVE5TO indic1 MOVE5TO indic2 DISPLAY"FETCH C14823 INTO :pn, :bu, :hr:indic1,
- " :en:indic2;" EXECSQL FETCH C14823 INTO :pn, :bu, :hr:indic1, :en:indic2 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"pn should be P6; its value is ", pn DISPLAY"bu should be 50000; its value is ", bu DISPLAY"indic1 should be -1; its value is ", indic1 DISPLAY"indic2 should be -1; its value is ", indic2 if (pn NOT = "P6"OR bu NOT = 50000) then MOVE0TO flag END-IF if (indic1 NOT = -1OR indic2 NOT = -1) then MOVE0TO flag END-IF
DISPLAY "FETCH C14823 INTO :pn, :bu, :hr:indic1,
- " :en:indic2;"
EXEC SQL FETCH C14823 INTO :pn, :bu, :hr:indic1, :en:indic2
END-EXEC
MOVE SQLCODE TO SQL-COD
DISPLAY "SQLCODE should be 100; its value is ", SQL-COD
DISPLAY "SQLSTATE should be 02000; its value is ", SQLSTATE
PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODE NOT = 100 OR NORMSQ NOT = "02000") then
MOVE 0 TO flag
END-IF if (NORMSQ = "02000" AND NORMSQ NOT = SQLSTATE)
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY " "
DISPLAY "CLOSE C14823;"
EXEC SQL CLOSE C14823 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
*Subtest number four
DISPLAY "DECLARE C14824 CURSOR FOR"
DISPLAY " SELECT HU.STAFF.CITY,EMPNAME,PNAME,BUDGET"
DISPLAY " FROM HU.STAFF LEFT JOIN HU.PROJ"
DISPLAY " ON HU.STAFF.CITY = HU.PROJ.CITY"
DISPLAY " AND HU.STAFF.CITY <> 'Vienna'"
DISPLAY " AND EMPNAME <> 'Don'"
DISPLAY " WHERE BUDGET > 15000 OR BUDGET IS NULL"
DISPLAY " ORDER BY HU.STAFF.CITY, EMPNAME, BUDGET;"
EXEC SQL DECLARE C14824 CURSOR FOR
SELECT HU.STAFF.CITY,EMPNAME,PNAME,BUDGET
FROM HU.STAFF LEFT JOIN HU.PROJ
ON HU.STAFF.CITY = HU.PROJ.CITY
AND HU.STAFF.CITY <> 'Vienna'
AND EMPNAME <> 'Don'
WHERE BUDGET > 15000 OR BUDGET IS NULL
ORDER BY HU.STAFF.CITY, EMPNAME, BUDGET END-EXEC
DISPLAY "OPEN C14824;"
EXEC SQL OPEN C14824 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14824 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14824 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Akron; its value is ", ct
DISPLAY "ename should be Ed; its value is ", ename
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (ct NOT = "Akron" OR ename NOT = "Ed") then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14824 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14824 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Deale; its value is ", ct
DISPLAY "ename should be Alice; its value is ", ename
DISPLAY "pname should be SDP; its value is ", pname
DISPLAY "bu should be 20000; its value is ", bu
DISPLAY "indic1 should be 0; its value is ", indic1
DISPLAY "indic2 should be 0; its value is ", indic2 if (ct NOT = "Deale" OR ename NOT = "Alice") then
MOVE 0 TO flag
END-IF if (pname NOT = "SDP" OR bu NOT = 20000) then
MOVE 0 TO flag
END-IF if (indic1 NOT = 0 OR indic2 NOT = 0) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14824 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14824 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Deale; its value is ", ct
DISPLAY "ename should be Alice; its value is ", ename
DISPLAY "pname should be PAYR; its value is ", pname
DISPLAY "bu should be 50000; its value is ", bu
DISPLAY "indic1 should be 0; its value is ", indic1
DISPLAY "indic2 should be 0; its value is ", indic2 if (ct NOT = "Deale" OR ename NOT = "Alice") then
MOVE 0 TO flag
END-IF if (pname NOT = "PAYR" OR bu NOT = 50000) then
MOVE 0 TO flag
END-IF if (indic1 NOT = 0 OR indic2 NOT = 0) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14824 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14824 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Deale; its value is ", ct
DISPLAY "ename should be Don; its value is ", ename
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (ct NOT = "Deale" OR ename NOT = "Don") then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14824 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14824 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Vienna; its value is ", ct
DISPLAY "ename should be Betty; its value is ", ename
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (ct NOT = "Vienna" OR ename NOT = "Betty")
then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14824 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14824 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Vienna; its value is ", ct
DISPLAY "ename should be Carmen; its value is ", ename
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (ct NOT = "Vienna" OR ename NOT = "Carmen")
then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
DISPLAY "FETCH C14824 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14824 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
DISPLAY "SQLCODE should be 100; its value is ", SQL-COD
DISPLAY "SQLSTATE should be 02000; its value is ", SQLSTATE
PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODE NOT = 100 OR NORMSQ NOT = "02000") then
MOVE 0 TO flag
END-IF if (NORMSQ = "02000" AND NORMSQ NOT = SQLSTATE)
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY " "
DISPLAY "CLOSE C14824;"
EXEC SQL CLOSE C14824 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
*Subtest number five
*Difference between WHERE and ON
DISPLAY "DECLARE C14825 CURSOR FOR"
DISPLAY " SELECT HU.STAFF.CITY,EMPNAME,PNAME,BUDGET"
DISPLAY " FROM HU.STAFF LEFT JOIN HU.PROJ"
DISPLAY " ON HU.STAFF.CITY = HU.PROJ.CITY"
DISPLAY " AND HU.STAFF.CITY <> 'Vienna'"
DISPLAY " WHERE (BUDGET > 15000 OR BUDGET IS NULL)"
DISPLAY " AND EMPNAME <> 'Don'"
DISPLAY " ORDER BY HU.STAFF.CITY, EMPNAME, BUDGET;"
EXEC SQL DECLARE C14825 CURSOR FOR
SELECT HU.STAFF.CITY,EMPNAME,PNAME,BUDGET
FROM HU.STAFF LEFT JOIN HU.PROJ
ON HU.STAFF.CITY = HU.PROJ.CITY
AND HU.STAFF.CITY <> 'Vienna'
WHERE (BUDGET > 15000 OR BUDGET IS NULL)
AND EMPNAME <> 'Don'
ORDER BY HU.STAFF.CITY, EMPNAME, BUDGET END-EXEC
DISPLAY "OPEN C14825;"
EXEC SQL OPEN C14825 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14825 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14825 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Akron; its value is ", ct
DISPLAY "ename should be Ed; its value is ", ename
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (ct NOT = "Akron" OR ename NOT = "Ed") then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14825 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14825 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Deale; its value is ", ct
DISPLAY "ename should be Alice; its value is ", ename
DISPLAY "pname should be SDP; its value is ", pname
DISPLAY "bu should be 20000; its value is ", bu
DISPLAY "indic1 should be 0; its value is ", indic1
DISPLAY "indic2 should be 0; its value is ", indic2 if (ct NOT = "Deale" OR ename NOT = "Alice") then
MOVE 0 TO flag
END-IF if (pname NOT = "SDP" OR bu NOT = 20000) then
MOVE 0 TO flag
END-IF if (indic1 NOT = 0 OR indic2 NOT = 0) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14825 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14825 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Deale; its value is ", ct
DISPLAY "ename should be Alice; its value is ", ename
DISPLAY "pname should be PAYR; its value is ", pname
DISPLAY "bu should be 50000; its value is ", bu
DISPLAY "indic1 should be 0; its value is ", indic1
DISPLAY "indic2 should be 0; its value is ", indic2 if (ct NOT = "Deale" OR ename NOT = "Alice") then
MOVE 0 TO flag
END-IF if (pname NOT = "PAYR" OR bu NOT = 50000) then
MOVE 0 TO flag
END-IF if (indic1 NOT = 0 OR indic2 NOT = 0) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14825 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14825 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Vienna; its value is ", ct
DISPLAY "ename should be Betty; its value is ", ename
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (ct NOT = "Vienna" OR ename NOT = "Betty")
then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
MOVE "xxxxxxxxxxxxxxxxxxxx" TO ename
MOVE "xxxxxxxxxxxxxxxxxxxx" TO pname
MOVE "xxxxxxxxxxxxxxx" TO ct
MOVE 28 TO bu
DISPLAY "FETCH C14825 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14825 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "ct should be Vienna; its value is ", ct
DISPLAY "ename should be Carmen; its value is ", ename
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (ct NOT = "Vienna" OR ename NOT = "Carmen")
then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
DISPLAY "FETCH C14825 INTO :ct, :ename, :pname:indic1,
- " :bu:indic2;"
EXEC SQL FETCH C14825 INTO :ct, :ename, :pname:indic1,
:bu:indic2 END-EXEC
MOVE SQLCODE TO SQL-COD
DISPLAY "SQLCODE should be 100; its value is ", SQL-COD
DISPLAY "SQLSTATE should be 02000; its value is ", SQLSTATE
PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODE NOT = 100 OR NORMSQ NOT = "02000") then
MOVE 0 TO flag
END-IF if (NORMSQ = "02000" AND NORMSQ NOT = SQLSTATE)
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY " "
DISPLAY "CLOSE C14825;"
EXEC SQL CLOSE C14825 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
*Subtest number six
*Correlation name with self-JOIN
DISPLAY "DECLARE C14826 CURSOR FOR"
DISPLAY " SELECT XX.T_INT, YY.T_INT"
DISPLAY " FROM SEVEN_TYPES XX RIGHT OUTER JOIN SEVEN_TYPES
- " YY"
DISPLAY " ON XX.T_INT = YY.T_INT +1"
DISPLAY " ORDER BY YY.T_INT;"
EXEC SQL DECLARE C14826 CURSOR FOR
SELECT XX.T_INT, YY.T_INT
FROM SEVEN_TYPES XX RIGHT OUTER JOIN SEVEN_TYPES YY
ON XX.T_INT = YY.T_INT +1
ORDER BY YY.T_INT END-EXEC
DISPLAY "OPEN C14826;"
EXEC SQL OPEN C14826 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
MOVE 0 TO int1
MOVE 40 TO indic1
MOVE 0 TO int2
DISPLAY "FETCH C14826 INTO :int1:indic1, :int2;"
EXEC SQL FETCH C14826 INTO :int1:indic1, :int2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "int1 should be 2; its value is ", int1
DISPLAY "indic1 should be 0; its value is ", indic1
DISPLAY "int2 should be 1; its value is ", int2 if (int1 NOT = 2 OR indic1 NOT = 0) then
MOVE 0 TO flag
END-IF if (int2 NOT = 1) then
MOVE 0 TO flag
END-IF
MOVE 0 TO int1
MOVE 40 TO indic1
MOVE 0 TO int2
DISPLAY "FETCH C14826 INTO :int1:indic1, :int2;"
EXEC SQL FETCH C14826 INTO :int1:indic1, :int2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "int1 should be 3; its value is ", int1
DISPLAY "indic1 should be 0; its value is ", indic1
DISPLAY "int2 should be 2; its value is ", int2 if (int1 NOT = 3 OR indic1 NOT = 0) then
MOVE 0 TO flag
END-IF if (int2 NOT = 2) then
MOVE 0 TO flag
END-IF
MOVE 0 TO int1
MOVE 40 TO indic1
MOVE 0 TO int2
DISPLAY "FETCH C14826 INTO :int1:indic1, :int2;"
EXEC SQL FETCH C14826 INTO :int1:indic1, :int2 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "int2 should be 3; its value is ", int2 if (indic1 NOT = -1 OR int2 NOT = 3) then
MOVE 0 TO flag
END-IF
DISPLAY "CLOSE C14826;"
EXEC SQL CLOSE C14826 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
*Subtest number seven
*Nested booleans
*Data types are merely comparable
DISPLAY "DECLARE C14827 CURSOR FOR"
DISPLAY " SELECT GRADE, T_NUMERIC, DECIMAL6_6"
DISPLAY " FROM HU.STAFF LEFT JOIN SEVEN_TYPES T7"
DISPLAY " ON GRADE * -40 > T7.T_NUMERIC"
DISPLAY " OR (DECIMAL6_6 -542.5 < GRADE AND DECIMAL6_6
- " -541.5 > GRADE)"
DISPLAY " ORDER BY GRADE;"
EXEC SQL DECLARE C14827 CURSOR FOR
SELECT GRADE, T_NUMERIC, DECIMAL6_6
FROM HU.STAFF LEFT JOIN SEVEN_TYPES T7
ON GRADE * -40 > T7.T_NUMERIC
OR (DECIMAL6_6 -542.5 < GRADE
AND DECIMAL6_6 -541.5 > GRADE)
ORDER BY GRADE END-EXEC
DISPLAY "OPEN C14827;"
EXEC SQL OPEN C14827 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
MOVE 0 TO gr
MOVE 0.0 TO flt1
MOVE 0.0 TO flt2
MOVE 40 TO indic1
MOVE 40 TO indic2
DISPLAY "FETCH C14827 INTO :gr, :flt1:indic1,
- " :flt2:indic2;"
EXEC SQL FETCH C14827 INTO :gr, :flt1:indic1, :flt2:indic2
END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "gr should be 10; its value is ", gr
MOVE flt1 TO FLT-1
DISPLAY "flt1 should be -444 +- 0.1; its value is ", FLT-1
MOVE flt2 TO FLT-1
DISPLAY "flt2 should be -55 +- 0.1; its value is ", FLT-1 if (gr NOT = 10) then
MOVE 0 TO flag
END-IF if (flt1 < -444.1 OR flt1 > -443.9) then
MOVE 0 TO flag
END-IF if (flt2 < -55.1 OR flt2 > -54.9) then
MOVE 0 TO flag
END-IF
MOVE 0 TO gr
MOVE 0.0 TO flt1
MOVE 0.0 TO flt2
MOVE 40 TO indic1
MOVE 40 TO indic2
DISPLAY "FETCH C14827 INTO :gr, :flt1:indic1,
- " :flt2:indic2;"
EXEC SQL FETCH C14827 INTO :gr, :flt1:indic1, :flt2:indic2
END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "gr should be 12; its value is ", gr
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (gr NOT = 12) then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
MOVE 0 TO gr
MOVE 0.0 TO flt1
MOVE 0.0 TO flt2
MOVE 40 TO indic1
MOVE 40 TO indic2
DISPLAY "FETCH C14827 INTO :gr, :flt1:indic1,
- " :flt2:indic2;"
EXEC SQL FETCH C14827 INTO :gr, :flt1:indic1, :flt2:indic2
END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "gr should be 12; its value is ", gr
DISPLAY "indic1 should be -1; its value is ", indic1
DISPLAY "indic2 should be -1; its value is ", indic2 if (gr NOT = 12) then
MOVE 0 TO flag
END-IF if (indic1 NOT = -1 OR indic2 NOT = -1) then
MOVE 0 TO flag
END-IF
MOVE 0 TO gr
MOVE 0.0 TO flt1
MOVE 0.0 TO flt2
MOVE 40 TO indic1
MOVE 40 TO indic2
DISPLAY "FETCH C14827 INTO :gr, :flt1:indic1,
- " :flt2:indic2;"
EXEC SQL FETCH C14827 INTO :gr, :flt1:indic1, :flt2:indic2
END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "gr should be 13; its value is ", gr
MOVE flt1 TO FLT-1
DISPLAY "flt1 should be 44 +- 0.1; its value is ", FLT-1
MOVE flt2 TO FLT-1
DISPLAY "flt2 should be 555 +- 0.1; its value is ", FLT-1 if (gr NOT = 13) then
MOVE 0 TO flag
END-IF if (flt1 < 43.9 OR flt1 > 44.1) then
MOVE 0 TO flag
END-IF if (flt2 < 554.9 OR flt2 > 555.1) then
MOVE 0 TO flag
END-IF
MOVE 0 TO gr
MOVE 0.0 TO flt1
MOVE 0.0 TO flt2
MOVE 40 TO indic1
MOVE 40 TO indic2
DISPLAY "FETCH C14827 INTO :gr, :flt1:indic1,
- " :flt2:indic2;"
EXEC SQL FETCH C14827 INTO :gr, :flt1:indic1, :flt2:indic2
END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "gr should be 13; its value is ", gr
MOVE flt1 TO FLT-1
DISPLAY "flt1 should be 44 +- 0.1; its value is ", FLT-1
MOVE flt2 TO FLT-1
DISPLAY "flt2 should be 555 +- 0.1; its value is ", FLT-1 if (gr NOT = 13) then
MOVE 0 TO flag
END-IF if (flt1 < 43.9 OR flt1 > 44.1) then
MOVE 0 TO flag
END-IF if (flt2 < 554.9 OR flt2 > 555.1) then
MOVE 0 TO flag
END-IF
DISPLAY "FETCH C14827 INTO :gr, :flt1:indic1,
- " :flt2:indic2;"
EXEC SQL FETCH C14827 INTO :gr, :flt1:indic1, :flt2:indic2
END-EXEC
MOVE SQLCODE TO SQL-COD
DISPLAY "SQLCODE should be 100; its value is ", SQL-COD
DISPLAY "SQLSTATE should be 02000; its value is ", SQLSTATE
PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODE NOT = 100 OR NORMSQ NOT = "02000") then
MOVE 0 TO flag
END-IF if (NORMSQ = "02000" AND NORMSQ NOT = SQLSTATE)
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY " "
DISPLAY "ROLLBACK WORK;"
EXEC SQL ROLLBACK WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
******************** END TEST0844 ********************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
STOP RUN.
* **** 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
PERFORM VARYING 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
GO TO EXIT-NOSUBCLASS
END-IF
MOVE 4 TO norm1
*examining position 4 of char array NORMSQ
*valid characters are 0-9, A-Z
PERFORM VARYING 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
PERFORM VARYING 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-924.28 SQL-transactions, paragraph 2
if (NORMSQX(1) = "0" AND NORMSQX(2) = "1") then
MOVE "0" TO NORMSQX(2)
END-IF
.
EXIT-NOSUBCLASS.
EXIT.
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.32Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-11)
¤
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.