- IDENTIFICATION DIVISION.
- PROGRAM-ID. PGM1.
- ENVIRONMENT DIVISION.
- DATA DIVISION.
- WORKING-STORAGE SECTION.
EXEC SQL
INCLUDE PGM1
END-EXEC.
EXEC SQL
INCLUDE SQLCA
END-EXEC.
PROCEDURE DIVISION.
EXEC SQL
SELECT EMP_ID,EMP_NAME,EMP_SAL INTO :EMP
WHERE EMP_ID = ‘101234’
End-EXEC.
DISPLAY :EMP.
STOP RUN.
Note:
- All Host Variables which are coded with SQL Statements must be prefixed with (:)
- No of colns, No of Host variables must be same with data type length.
ConversionConversion EmoticonEmoticon