![]() |
|
|
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 |
| Help! "Bus error" and "CPU Panic" box wont boot | hcclnoodles | SUN Solaris | 3 | 10-05-2006 05:38 PM |
| shared object "undefined symbol: fstat" error | marcus121 | High Level Programming | 5 | 04-24-2006 08:11 PM |
| dbx error ("Executable contains object file compiled on ...") | Sabari Nath S | High Level Programming | 0 | 08-04-2005 06:03 PM |
| Error : "No data written to object that was write locked" | nileshkarania | UNIX for Dummies Questions & Answers | 1 | 06-07-2003 12:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Can't locate object method "fetchrow_array" Error
Hi,
I have a perl script which is interacting with Database. I have following line of code : ================================================= sub BEGIN { #use Getopt::Std; #getopt ('S'); #($STEAP)=($opt_S); use lib ("/home/perl_lib"); use NewSybDBLib; use Sybase::DBlib; use IniFileUtil; use ErrMsgUtil; use strict; } sub main(); main(); print "\nMESSAGE:\n"; $dbh->SetSQLCmd("select * from test "); @result=$dbh->ExecSQL(); if($dbh->{message_text}) { print "DB MESSAGE\n"; print $dbh->{message_text} . "\n"; $dbh->{message_text}=""; } if($dbh->{error_text}) { $db_error_text=$dbh->{error_text}; $dbh->Delete; die "ERROR: \n" . $db_error_text . "\n"; } while (@result = $dbh->fetchrow_array()) { my $tablename = $result[1]; my $firstrun = $result[2]; my $firstsuccess = $result[3]; print " $tablename $firstrun $firstsuccess \n"; } The SQL command is getting records from table test . If i omit my while loop at the end which is using fetchrow_array then script is running perfectly but when i tried to get the records one by one using fetch_row_array() i got the Error : Can't locate object method "fetchrow_array" via package "NewSybDBLib" I use the package use Sybase::DBlib but it is not working. Any idea what might be the solution. rawat Last edited by vino; 05-23-2007 at 09:01 AM.. Reason: Disabled smilies |
|
||||
|
Re: Can't locate object method "fetchrow_array" Error
Hey Rawat,
As far as I know, the fetchrow_array is used with the statement handle ($sth) rather than database handle ($dbh). Try to differentiate $dbh and $sth, and put $sth in the appropriate places. Let me know if that works out!! Regards, Kuks |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|