sasrs99 has asked for the wisdom of the Perl Monks concerning the following question:
sub insert_preSOF_records { my ($dbh, $planner, $sum, $output_array) = @_; my $id = "1.0"; my $msg = "PROMO ORDER"; my @bind_params = (); for my $i ( 0 .. $#output_array ) { + my $row = [ @{$output_array[$i]} ]; # # $row->[0] = LOC # $row->[1] = ITEM # $row->[2] = QTY # $row->[3] = P_DLRNET # $row->[4] = P_DLRSPLRCODE push @bind_params, ( $id, $row->[4], $row->[0], $row->[1], $ro +w->[2], $row->[3], $msg, $planner, $sum ); #print Dumper(@bind_params); $dbh = DBI->connect("dbi:Oracle:$instance", "pac", "pac", \%attr) +or die "Can't connect to Oracle!", $DBI::errstr, "\n"; my $insert_handle = $dbh->prepare("INSERT INTO pac.presof (id , dlr +splrcode , loc , ite +m , qty , dlr +net , mes +sage , pla +nnercode , sum +) VALUES (?, +?,?,?,?,?,?,?,?)"); die "Couldn't prepare queries; aborting" unless defined $inse +rt_handle; $insert_handle->execute( @bind_params ) or die LogMsg("There +is a problem with the insert into PAC.PRESOF " . $dbh->errstr); #$dbh->commit; $insert_handle->finish; @bind_params = (); } $dbh->disconnect(); return 1; # Success }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with INSERT statement
by imp (Priest) on Dec 19, 2006 at 21:23 UTC | |
by sasrs99 (Acolyte) on Dec 19, 2006 at 21:46 UTC | |
|
Re: Problem with INSERT statement
by bart (Canon) on Dec 19, 2006 at 20:49 UTC | |
by sasrs99 (Acolyte) on Dec 19, 2006 at 21:16 UTC | |
|
Re: Problem with INSERT statement
by perrin (Chancellor) on Dec 19, 2006 at 21:04 UTC |