Hi,

This is my first effort at perl scripting so forgive my innocence. What I am
trying to do is extract schema and data info from a proprietary database
into flat files, format those files and import the data and schema into an
Oracle database. 

The initial part of this is capturing the table names into an array and then
using that array to query the database and dump the results to flat files.
Where I'm having trouble is in using a bound parameter in the sql statement.
If I use a table name directly it works without a problem but when I
parameterise it I get a Parse Error.

foreach $i (@table_arr){
      $content = $i;
#     print ("table name is:  $i \n");
      open( CONTENT, ">$content" ) || die "Can't open file $content";
      my $sth = $dbh->prepare("select * from ?");
      $sth->bind_param(1, $i);

      my $row;

      $sth->execute or die "Can't execute SQL statement: ", $sth->errstr(),
"\n";
      $row = $sth->dump_results(80, "\n", ':',\*CONTENT);
     }

Any ideas where I could be going wrong?

Cheers

Shane

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to