Pro*C help needed
From: Jamie O'Shaughnessy <oshaughj_at_p4.cs.man.ac.uk>
Date: 24 Jan 92 13:29:26 GMT
Message-ID: <oshaughj.696259766_at_p4.cs.man.ac.uk>
Date: 24 Jan 92 13:29:26 GMT
Message-ID: <oshaughj.696259766_at_p4.cs.man.ac.uk>
I've got a table called BRONZES with a key attribute called ACC_NO.
A user inputs an ACC_NO and I want to check if a tuple exists in the DB with that ACC_NO already.
Easy : just do
EXEC SQL SELECT ACC_NO FROM BRONZES WHERE ACC_NO = uservar_ACC_NO;
I guess I use a PREPARE, OPEN AND FETCH dynamic query and build a string up containing :
"SELECT ACC_NO FROM tablename WHERE ACC_NO = :user_acc_no"
and then
EXEC SQL PREPARE S1 FROM :above_string;
EXEC SQL DECLARE C1 CURSOR FOR S1;
EXEC SQL OPEN C1;
EXEC SQL FETCH C1 INTO :variable_of_acc_no_type;
Is this the right idea???? Come on someone, give us a clue!!!!
- Jamie O'Shaughnessy