![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Access to database/eval command | chriss_58 | Shell Programming and Scripting | 1 | 06-09-2008 05:05 AM |
| Help with ms access database and firebird | ncatdesigner | UNIX for Advanced & Expert Users | 0 | 05-14-2008 11:05 AM |
| Debea Database Access Library 1.2.0 (Default branch) | iBot | Software Releases - RSS News | 0 | 01-29-2008 11:00 AM |
| C program with Oracle database access | kavi | High Level Programming | 5 | 07-12-2002 04:48 AM |
| microsoft access database on Unix | spiderling | UNIX for Dummies Questions & Answers | 1 | 03-07-2002 06:43 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Perl Database access
Hi,
I tried to run this code but it isnt giving me any output or errors. My aim is to retrieve the row based on the flag name(this is the primary key). flag_test is my table This is how i ran it: perl read_db.pl flag1 flag1 is the criteria in where clause -------- this is my code: #!/usr/bin/perl use DBI; sub read_db { $dbh = DBI -> connect('DBI:Oracle:mercury','student','learn') || die "unable to connect:$DBI::errstr"; my $dbh = DBI->connect(); my $sql = qq/select flag_name, f_name, l_name from flag_test where flag_name =?/; my $sth = $dbh->prepare($sql); $sth->execute(); my ($col1, $col2, $col3); $sth->bind_col(1, \$col1); $sth->bind_col(2, \$col2); $sth->bind_col(3, \$col3); while ($sth->fetch) { print "$col1, $col2, $col3\n"; } } could somebody help me with this? thanks, mercury |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|