in reply to Re: Can't execute statements with DBD::Oracle
in thread Can't execute statements with DBD::Oracle
#!usr/bin/perl use DBI; use strict; #$ENV {"ORACLE_HOME"} ="C:\\oraclexe\\app\\oracle\\product\\10.2.0\\"; #my $file = "npi1.txt"; my $dsn = 'DBI:Oracle:XE'; my $user = 'scott'; my $pass = 'tiger'; my $dbh; my $sth; $dbh = DBI->connect($dsn, $user, $pass, {RaiseError => 1, PrintError = +> 0}) || die $dbh->errstr; #open(IN,$file); #my $line = <IN>; #my $count = 0; #while (<IN>) #{ # my $n = 'physician'; # $sth = $dbh->prepare('insert into :table-name (:values)'); $sth = $dbh->prepare('select npi, entity_type_code from system.phy +sician where npi = 1326041310'); # $sth->bind_param(":table-name", $n); # $sth->bind_param(":values", $_); $sth->execute(); # $count++; while( my @line = $sth->fetchrow_array ) {print @line;} #} #close(IN); $sth->finish(); $dbh->disconnect();
|
|---|