Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I tired to use place holders and i am getting following error :
Here is my code:ORA-01008: not all variables bound (DBD ERROR: error possibly near <*> + indicator
can any one help me with this? column1, column2 being target table columns and COL1, COL2 being source table columns.use DBI; use DBD::Oracle qw(:ora_types); use DBD::ODBC; use Getopt::Long; main(); ########################################################### sub main { $dbh = DBI->connect("dbi:ODBC:$DSN"); $sqlstatement="SELECT * from test_table"; $dbh->{LongReadLen} = 140000; $sth = $dbh->prepare($sqlstatement); $sth->execute || DIE("Could not execute SQL statement ... maybe invalid?"); $row_access=0; while (@row=$sth->fetchrow_array) { $c1 = func("COL1",0,1); $c2 = func("COL2",1,2); $INSERT_SQL="INSERT INTO trg_table(". "column1,". "column2". ") VALUES ". "(?,". "?)"; $INSERT_CURSOR=$LDA_DB->prepare($INSERT_SQL); $rv = $INSERT_CURSOR->execute(); $INSERT_CURSOR->finish; $row_access++; } $INSERT_CURSOR->finish; $LDA_DB->disconnect; close(W); } ########################################################### sub func { # if there is no value it replaces with " " otherwise it replaces wi +th value. } ###########################################################
while using place holders, what all things i need to take care of?
thanks.....
edit (broquaint): added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to use place holders?
by gellyfish (Monsignor) on Aug 03, 2005 at 19:39 UTC | |
|
Re: how to use place holders?
by Enlil (Parson) on Aug 03, 2005 at 19:42 UTC | |
by Anonymous Monk on Aug 03, 2005 at 21:14 UTC | |
|
off-topic: using q() and qq() to improve readability
by Codon (Friar) on Aug 04, 2005 at 00:01 UTC | |
|
Re: how to use place holders?
by Joost (Canon) on Aug 03, 2005 at 19:50 UTC |