I have my database defined and full of data.
I want to prompt the user to insert one tuple into a table.
After acquiring the data from the user
i have to check if the tuple that is going to be inserted has the same primary key with one of the existing in the database.

Do i have to use cursors to accomplish this???

What i have thought is to "run" an SQL SELECT statement with the fields data provided by the user and if it doesn't return a tuple ( by checking the sqlca.sqlerrd[2] value) then it is safe to INSERT it, otherwise it shouldn't be inserted.

What do you think of the above????

P.S. There are no referential integrity constraints.