[rochester-pm-list] Check This :)
Pat
havoc at shell1.eznet.net
Thu Dec 2 12:57:38 CST 1999
2 things
1) you can always check DBI->errstr
2) I think Oracle requires a commit statement, $dbh->commit right before the disconnect should do it.
2a) Or use {AUTOCOMMIT=>1} in the connect statement
Good Luck!
--Pat
On Thu, Dec 02, 1999 at 10:25:12AM -0500, Fred Edmister wrote:
> Here's the code I'm using this morning... SO close... Please tell me why
> it doesn't write the info in... :) Anyone know?
>
> {begin code}
> use DBI;
>
> my $dbh = DBI->connect('DBI:Oracle:pkcom2','test1','tiger1')
> or die "Couldn't connect to database: " . DBI->errstr;
> my $sth=$dbh->prepare('INSERT INTO perl_test (fname,lname,pwd) VALUES
> (?,?,?)')
> or die "Couldn't Connect To Database: " . DBI->errstr;
>
> print "Enter First Name>";
> my $fname = <>; chomp($fname);
> print "Enter Last Name>";
> my $lname = <>; chomp($lname);
> print "Enter Password>";
> my $pwd = <>; chomp($pwd);
>
> $sth->execute($fname,$lname,$pwd);
>
> $sth->end;
> $dbh->disconnect;
> {end code}
>
> Thank you all in advance!
>
> Fred
>
>
More information about the Rochester-pm
mailing list