[HELP]: Problem using views to drive cursors

From: Neil Greene <neil_at_kynug.org>
Date: Tue, 12 Jul 1994 18:10:54 GMT
Message-ID: <1994Jul12.181054.21783_at_KYnug.org>


Consider this a vehicle licensing application where you have motorists with fname, lname, birthdate, social security and a primary key generated by the system. Someone now submits a data file with vehicle registration information along with the applicant information. You want to create a new master record if the person is not found in your database and you want to add the registration information to the correct applicant in your system finds the applicant.

I have a view which I use to drive a cursor. This view merges our applicants table with a submission table to see if the applicant being submitted is already in our database. An outer join is performed in the view to revel the primary key of the applicant in our database and of course this field is NULL if the applicant is not found in our database.

PROBLEM: The problem I am having is when multiple licenses are submitted on the same applicant, creating duplicate master records.

The first submission sees the primary key field as NULL and the applicant record is added and committed to our database. However, the cursor accessing the view does not recognize this and creates another master record if more then one license is submitted on the same applicant.

I have tried issuing a commit right after inserting the applicant record, thinking my view would now see the update. But no good. Is my problem in the fact that the cursor has already fetched the records and began processing. So that although the driving tables have been updated and the views are actually working correctly, the cursor is not?

Suggestions?

-- 
Neil Greene
benchMark Developments, Inc. [NeXT VAR]
2040 Regency Road, Suite C Lexington, KY 40503
Phone: 606-231-6599 / Fax: 606-254-4864
Received on Tue Jul 12 1994 - 20:10:54 CEST

Original text of this message