Re: open cursor with hold question

From: Jim Cromie (jcromie_at_divsol.com)
Date: 05/10/04


Date: Mon, 10 May 2004 13:47:31 -0600
To: "James D. White" <jdw@ou.edu>

James D. White wrote:

> You could try using two connect calls with two different DB handles.
> Prepare the select using one
> DB handle and insert with the other. A commit on the second DB handle
> should not close the
> fetchrow_array cursor on the first.
>
> James D. White (jdw@ou.edu)
> Department of Chemistry and Biochemistry
> University of Oklahoma
> 101 E. Constellation, SRTC 2100
> Norman, OK 73019
> Phone: (405) 325-4912, FAX: (405) 325-7762
>
>
>
> Liu, Jenny wrote:
>
>> Hi,
>>
>> How could I declare an open cursor with hold in a perl DBI program?
>>
>> I have to do a commit for every 30000 insertion to avoid long
>> transaction.
>> But the commit will close my ($patkey,$extid) = $sth->fetchrow_array)
>> cursor. I got an SQL error 400.
>

Hmm - Im missing something (so take this as a WAG, potential
reddherring, etc)

I was suprised that it wasnt $sth->commit(),
 but I checked, youre right (ie Pod agrees).

did you by any chance try $sth->commit() ? would you ?

The DBI supports various methods on several different handle-types,
this might just be one of them.

for curiosity, what DBD are you using, do you have another to test
your code against ?



Relevant Pages

  • Re: Opinions on approach, please...
    ... Code conversion is much more tricky. ... to update more than 32k records without a commit in-between. ... I advise you to do cursor definitions on working storage). ... I don't want to see ANY SQL code in them. ...
    (comp.lang.cobol)
  • Re: Very strange problem.
    ... end loop; ... Because the number of record is very large, so I want to commit every 1000 ... rows, but after commit for the first time, the cursor is not availible any ... >>cursor icur is ...
    (comp.databases.oracle.server)
  • Re: Arrow doesn`t move on monitor?
    ... 'James' wrote: ... | Does anyone on this group know what should be done when the arrow is ... I assume you mean the cursor, and that you use a mouse. ... As to turning the computer off with the 'Power OFF' switch; ...
    (microsoft.public.windowsxp.basics)
  • [git pull] drm
    ... This is mostly KMS related fixes, with a GEM related fix that stable also ... commit a75f28419a7efff611a81293d41d0e2137d7591e ... For KMS drivers, we really need to cleanup the driver before disabling ... Pin cursor bo and unpin old bo when setting cursor. ...
    (Linux-Kernel)
  • Re: Performance improvment -loop update.
    ... For c1_rec in c1 Loop ... table Ems_Currentsoexpedite_Tmp is having 8000 records and cursor ... of a "Job Jar" that only seemed to return one job for him to do ...
    (comp.databases.oracle.tools)