Problem with PL/SQL

From: Suresh R Puli <srp5_at_Ra.MsState.Edu>
Date: 24 Feb 95 09:13:33 GMT
Message-ID: <3ik7vt$bba_at_NNTP.MsState.Edu>


I am currently using Pro C to insert values into the table, the problem i am facing is

Error: ORA-01400: mandatory (NOT NULL) column is missing or NULL

this is how i have created my table

CREATE TABLE ROOM  (    HNO        VARCHAR(3),
                        RNO        VARCHAR(3),
                        NOP        VARCHAR(3));

the values in the table are     

HNO RNO NOP
--- --- ---
212 1 0
212 2 1
212 3 2
212 4 0
212 5 2
210 1 2
210 2 1
210 3 0
210 4 2
210 5 0

10 rows selected.  

the condition is to retrieve RNO where HNO = 212 and NOP = 1 and this is how i had written the Pro C script

int	hallno = 212;
int     rno;

DECLARE
CURSOR sroom_cursor IS SELECT RNO,NOP FROM ROOM

                WHERE HNO = :hallno AND NOP = 1;

FOR info IN sroom_cursor LOOP
                IF info.NOP = 1 THEN
                    :rno := info.RNO;
		    EXIT;
		END IF;

END LOOP; I am presently working on ORACLE 6.0, ORACLE Precompiler:Version 1.3.18.1.1

Can anyone help me how to solve this problem, I would greately appreciate if you would mail to me at suresh_at_cs.msstate.edu

Thankyou,
.                     Received on Fri Feb 24 1995 - 10:13:33 CET

Original text of this message