Hi Nina,

A couple of things:
  1. Where in the perldocs did you find the part about setting
AutoCommit
      off would fix your problem?  Was that in DBD::Ingres?

      I haven't used DBI in a while, but I don't remember having a
problem
     using a database connection with one statement handle to read
from
     one table, and a different statement handle to write to a
different table -
      so I'm curious why setting AutoCommit off would affect that. 
I've
      never used DBD::Ingres so if the info was in there then I can
understand.

  2. I've attached new_make_action.pl with a few sections labelled
           ##########
           ### HM ###
           ##########

       to show you how you can do things a little differently using
       placeholders - prepare your insert once, and then when you
       need to insert, your insert doesn't have to prepare the same
       basic insert over and over again - you can just execute it,
giving
       the values for the placeholders.  This method is much more
       efficient.  Read about "Placeholders" in the perldocs by doing
 
               perldoc DBI

        at a command prompt.

>>> Nina Markova <[EMAIL PROTECTED]> 01/19/05 3:11 PM >>>
Hi,

How to use select and insert at  the same time?

I select information from one table, process and reorganize it and want
to 
insert it in another table.  I receive error :

DBD::Ingres::st execute failed: E_US08B4 No MST is currently in
progress, cannot 
declare another cursor.
    (Wed Jan 19 14:55:58 2005) at ../make_action.pl line 69.
DBD::Ingres::st fetchrow_hashref failed: E_LQ0058 Cursor 
's0_ticketdescriptionfro' not open for 'fetch' command. at
../make_action.pl 
line 123.
Use of uninitialized value in concatenation (.) or string at
../make_action.pl 
line 158.
DBI::db=HASH(0x14f070)->disconnect invalidates 1 active statement
handle (either 
destroy statement handles or call finish on them before disconnecting)
at 
../make_action.pl line 160.

Usually I use 
 1) perl dbi script for processing which writes to a text file f.txt
 2) load data with 'copy table from f.txt' statement
 
 This time information I reorganize is a large text field, which
includes new 
lines. When I'm trying to load with 'copy from ...', new lines blow
Ingres 
eroors. I don't know how to preserve this formating  and at the same
time be 
able to load data, so decided to insert directly from same perl
script.
 
 Code attached.
 
 This is the exaple of formating I'd like to keep:
 --------------------------------------------------
Unused partition found, added in to directory tree at:

/web1/htdocs/nehp/hplots

This does two things, one keeps the file structure the same for
applications 
writing heliplot files and two gives the operations phone a break from
/web1 
diskspace messages for atleast a handful of months.

Thanks in advance,

Nina Markova
DBA

Attachment: new_make_action.pl
Description: Perl program

Reply via email to