Well, it's the same code, I just took out the comments. Edit: anyway, I reinstalled both DBI and DBD::Oracle and I think it's working now. Thanks.
#!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();
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.