C Copyright © Oracle Corporation 1995. All Rights Reserved. SUBROUTINE rdbdollarmissing C--------------------------------------------- C This subroutine demonstrates how to use C the RDB$MISSING value clause to mark a C field as missing. C--------------------------------------------- IMPLICIT NONE INTEGER*4 year_given CHARACTER employee_id*5,college_code*4,degree*3,degree_field*15 CHARACTER confirm &RDB& DATABASE EXTERNAL pers = FILENAME 'MF_PERSONNEL' &RDB& DBKEY SCOPE IS FINISH WRITE (6,90) 90 FORMAT ('1',T25,'**** STORE DEGREES ****'///) 100 TYPE 110 110 FORMAT ('$',' Please enter the ID of the 1 Employee or type exit: ') ACCEPT 120, employee_id 120 FORMAT (A) C-------------------------------------------- C Prompt the user for values to store C in the COLLEGES relation. C------------------------------------------- DO WHILE ((employee_id .NE. 'EXIT ') .AND. (employee_id .NE. 'exit ')) confirm = 'N' DO WHILE (confirm .EQ. 'N') TYPE 1000 1000 FORMAT ('$',' Please enter the college code: ') ACCEPT 1010, college_code 1010 FORMAT (A) TYPE 2000 2000 FORMAT ('$',' Please enter the year the 1degree was granted: ') ACCEPT 2010, year_given 2010 FORMAT (I) TYPE 3000 3000 FORMAT ('$',' Please enter the degree: ') ACCEPT 3010, degree 3010 FORMAT (A) C----------------------------------------------------- C Direct user to enter a question mark if he or she is C uncertain of the DEGREE_FIELD for the record C being stored. C---------------------------------------------------- TYPE 5000 5000 FORMAT ('/',' Please enter the field in which 1the degree was granted: ') TYPE 5005 5005 FORMAT ('$',' If unknown, enter ?: ') ACCEPT 5010, degree_field 5010 FORMAT (A) PRINT *, ' ' TYPE 10000 10000 FORMAT ('$',' Have you entered all data correctly? (Y/N): ') ACCEPT 10010, confirm 10010 FORMAT (A) END DO &RDB& START_TRANSACTION READ_WRITE &RDB& RESERVING DEGREES FOR SHARED WRITE C--------------------------------------------------- C Store the record in the DEGREES relation. If the C user entered a question mark for DEGREE_FIELDS, the C missing value defined for DEGREE_FIELD will be C stored, otherwise the value specified by the user C will be stored. C--------------------------------------------------- IF (degree_field .EQ. '?') THEN &RDB& GET &RDB& degree_field = RDB$MISSING(DEGREES.DEGREE_FIELD) &RDB& END_GET END IF &RDB& STORE D IN DEGREES USING &RDB& D.EMPLOYEE_ID = employee_id; &RDB& D.COLLEGE_CODE = college_code; &RDB& D.YEAR_GIVEN = year_given; &RDB& D.DEGREE = degree; &RDB& D.DEGREE_FIELD = degree_field &RDB& END_STORE &RDB& COMMIT PRINT *, ' ' TYPE 110 ACCEPT 120, employee_id END DO RETURN END