in reply to Importing files with perl::dbi
use DBI qw(:sql_types); my $dsn = "DBI:Oracle:foobar"; my $user = "foobar"; my $pass = "baz"; my $textfile = "testing.txt"; open (TEXT, "$textfile") or die "Couldn't open textfile: $!"; my $longText = join('', <TEXT>); close(TEXT); $dbh = DBI->connect($dsn, $user, $pass,{ RaiseError => 1}) or die "Could not connect to database! $DBI::errstr"; $sth = $$dbh->prepare( 'INSERT INTO table_name (key_name, long_description) VALUES (?, ?) +'; $sth->bind_param( 1, 42); $sth->bind_param(2, $longText, SQL_BLOB); $sth->execute();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Importing files with perl::dbi
by httptech (Chaplain) on Jun 23, 2000 at 15:30 UTC | |
by johannz (Hermit) on Jun 23, 2000 at 18:59 UTC | |
by httptech (Chaplain) on Jun 23, 2000 at 19:27 UTC |