05-23-2007
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
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
I was able to solve my previous problem (link directory)... but now i have this following problem.
I have mounted a disk from other machine using "mount -F nfs" command. When i run a batch which generates some files in that drive.... after a certain number of files i get... (1 Reply)
Discussion started by: nileshkarania
1 Replies
2. Programming
Hi,
We are trying to run dbx on a core file for which we have the original executable and libs, but not the source / object tree. We have recompiled the objects from the original source, but dbx complains that they were compiled at a different time, and refuses to read them:
Object file:... (0 Replies)
Discussion started by: Sabari Nath S
0 Replies
3. Programming
Didn't have this problem in AIX, but ported to Linux with GCC compiler and am now getting a runtime error:
tssutil: symbol lookup error: /work/agility/devel/bin/libagam.so: undefined symbol: fstat
I'm sure most of you know that fstat is an intrinsic function just like printf, memcpy, etc. When I... (5 Replies)
Discussion started by: marcus121
5 Replies
4. Programming
Hi,
i am working in C in Fedora Eclipse 3.3.0 with gdb debugger. I am geting segmentation fault with an error message "mi_cmd_var_create: unable to create variable object" on debugging the program.
What should I do to solve this problem?
rgds,
Dona_m (14 Replies)
Discussion started by: dona_m
14 Replies
5. Solaris
At times I have unknown applications that hang for long periods of time over and over again after a network glitch. These are sometimes nfs4 but usually nfs3 clients and are always solaris10 systems.
nfs: NFS server hostname not responding still trying
nfs: NFS server hostname ok
nfs: NFS... (1 Reply)
Discussion started by: HPAVC
1 Replies
6. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
7. Solaris
After a memory upgrade all network interfaces are misconfigued. How do i resolve this issue. Below are some out puts.thanks.
ifconfig: plumb: SIOCLIFADDIF: eg000g0:2: no such interface
# ifconfig eg1000g0:2 plumb
ifconfig: plumb: SIOCLIFADDIF: eg1000g0:2: no such interface
# ifconfig... (2 Replies)
Discussion started by: andersonedouard
2 Replies
8. Emergency UNIX and Linux Support
Hi,
I am running a perl script to automate a process and I keep running into a error can't find the "value"
Can't call method "value" on an undefined value at process_file.pl line 44.
file is CVS
cell is ifdfdxrfmp.ksh
Here is the script I have also attached it as well:
... (2 Replies)
Discussion started by: vpundit
2 Replies
9. OS X (Apple)
OS-X 10.8.4
Using locate I get these results:
10:~ mize$ locate /Users/mize/*.sh
/Users/mize/Zend/workspaces/DefaultWorkspace/SLM/vendor/ZF2/bin/check-cs.sh
/Users/mize/copy_ascii_upload.sh
/Users/mize/copy_ascii_upload_to_server.sh
/Users/mize/copy_form_functions_php_to_jpl.sh... (7 Replies)
Discussion started by: Gary Mize
7 Replies
LEARN ABOUT DEBIAN
anyevent::forkobject
AnyEvent::ForkObject(3pm) User Contributed Perl Documentation AnyEvent::ForkObject(3pm)
NAME
AnyEvent::ForkObject - Async access on objects.
SYNOPSIS
use AnyEvent::ForkObject;
use DBI;
my $fo = new AnyEvent::ForkObject;
$fo->do(
module => 'DBI',
method => 'connect',
args => [ 'dbi:mysql...' ],
cb => sub {
my ($status, $dbh) = @_;
$dbh->selectrow_array('SELECT ?', undef, 1 + 1, sub {
my ($status, $result) = @_;
print "$result
"; # prints 2
});
}
);
use AnyEvent::Tools qw(async_repeat);
$dbh->prepare('SELECT * FROM tbl', sub {
my ($status, $sth) = @_;
$sth->execute(sub {
my ($status, $rv) = @_;
# fetch 30 rows
async_repeat 30 => sub {
my ($guard) = @_;
$sth->fetchrow_hashref(sub {
my ($status, $row) = @_;
undef $guard;
# do something with $row
});
};
});
});
DESCRIPTION
There are a lot of modules that provide object interface. Using the module You can use them in async mode.
METHODS
new
Constructor. Creates an instance that contains fork jail.
do
Creates an object inside jail. It receives the following named arguments:
require
Do require inside jail. If the argument is exists, module, method and wantarray arguments will be ignored.
module
Module name. For example 'DBI'.
method
Constructor name. Default value is 'new'.
wantarray
Context for method. Default is 0 (SCALAR).
cb Done callback. The first argument is a status:
die The method has thrown exception. The next argument contains $@.
fatal
A fatal error was occured (for example fork jail was killed).
ok Method has done. The following arguments contain all data that were returned by the method.
If "method" returns blessed object, it will provide all its methods in modified form. Each method will receive one or two additional
arguments:
result callback
A callback that will be called after method has done.
wantarray
Context flag for method. Default value is 0 (SCALAR).
All objects provide additional method fo_attr to access their field. Example:
# set attribute
$dbh->fo_attr(RaiseError => 1, sub { my ($status, $attr) = @_; ... });
# get attribute
$dbh->fo_attr('RaiseError', sub { my ($status, $attr) = @_; ... });
AUTHOR
Dmitry E. Oboukhov, <unera@debian.org>
COPYRIGHT AND LICENSE
Copyright (C) 2011 by Dmitry E. Oboukhov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or,
at your option, any later version of Perl 5 you may have available.
VCS
The project is placed in my git repo: http://git.uvw.ru/?p=anyevent-forkobject;a=summary <http://git.uvw.ru/?p=anyevent-
forkobject;a=summary>
perl v5.12.4 2011-07-29 AnyEvent::ForkObject(3pm)