Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl # Set constants use strict; use DBI; my @array = ('"dbi:Oracle:host=localhost;sid=nms"','user', 'password') +; my $dsn = "@array[0], '@array[1]', '@array[2]'"; my $dbh = DBI->connect($dsn); my $sth = $dbh->prepare("select neid from ne_table"); $sth->execute(); my $arrayref = $sth->fetchall_arrayref(); foreach my $aref ( @$arrayref ) { print @$aref,"\n"; } $sth->finish(); $dbh->disconnect;
my $dbh = DBI->connect( "dbi:Oracle:host=localhost;sid=nms", 'user', ' +password');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: no database driver specified and DBI_DSN env var not set at
by Corion (Patriarch) on Aug 08, 2007 at 14:03 UTC | |
by Anonymous Monk on Aug 08, 2007 at 14:38 UTC | |
by Corion (Patriarch) on Aug 08, 2007 at 14:46 UTC | |
by Anonymous Monk on Aug 08, 2007 at 14:54 UTC | |
|
Re: no database driver specified and DBI_DSN env var not set at
by technojosh (Priest) on Aug 08, 2007 at 16:53 UTC |