Re: [HELP]: Problem using views to drive cursors

From: wareing pti <p0070621_at_brookes.ac.uk>
Date: 13 Jul 1994 10:24:28 +0100
Message-ID: <300bsc$2f9_at_cs3.brookes.ac.uk>


Neil Greene (neil_at_kynug.org) wrote:
> 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?

Everything is working correctly, except your definition of correct :) Yes, the problem is exactly as you describe: opening the cursor freezes the data it can see. The simplest solution is to execute a single SELECT for each potential applicant. The alternative is for your program to check it's inputs and only process the first one in each non-unique set.

--
Tommy Wareing
p0070621_at_brookes.ac.uk
Received on Wed Jul 13 1994 - 11:24:28 CEST

Original text of this message