Where does "MoveNext" belong to?

Where does "MoveNext" belong to?

am 06.02.2007 14:23:14 von patrixdiradja

Dear my friends....

I am writing a program use activeperl 5.8, MSSQL and
on Win32 Env.

Here is my code:
===
#!/usr/bin/perl
use Tk;
use Cwd;
use DBI::ADO;
use WriteExcel;
use strict;
use Win32::OLE qw( in );

my $dsn="sigma";
my $uname="sa";
my $pword="penguin";
my @bd4l=("AprovaApp1");

my $strsqltab4l="select name from sys.tables";
my $dbh2 = DBI->connect("dbi:ADO:$dsn", $uname,
$pword)
|| die "Could not open SQL connection.";
my $rsnya = $dbh2->prepare($strsqltab4l);
$rsnya->execute();

while(!$rsnya->{EOF}){
my $tab4l = $rsnya->fetchrow_array;
print "\$tab4l: $tab4l \n";
$rsnya->movenext;
}
====
but than comes problem that I can not solve.

The error message is:
"
Can't get DBI::st=HASH(0x1d2d3f4)->{EOF}: unrecognised
attribute name at C:/Perl/site/lib/DBD/ADO.pm line
1277.
Can't locate object method "movenext" via package
"DBI::st" at Untitled1 line 23.
"

Please tell me why.

Thank you very much in advance.




________________________________________________________
Kunjungi halaman depan Yahoo! Indonesia yang baru!
http://id.yahoo.com/

Re: Where does "MoveNext" belong to?

am 06.02.2007 14:58:59 von rroggenb

I do not know anything special about ADO, but try the more usual way to fetch
results:

my $tab4l;
while ( ($tab4l) = $rsnya->fetchrow_array) {

print "\$tab4l: $tab4l \n";

}

Does it work this way?

Best regards

Robert



Patrix Diradja schrieb:
> Dear my friends....
>
> I am writing a program use activeperl 5.8, MSSQL and
> on Win32 Env.
>
> Here is my code:
> ===
> #!/usr/bin/perl
> use Tk;
> use Cwd;
> use DBI::ADO;
> use WriteExcel;
> use strict;
> use Win32::OLE qw( in );
>
> my $dsn="sigma";
> my $uname="sa";
> my $pword="penguin";
> my @bd4l=("AprovaApp1");
>
> my $strsqltab4l="select name from sys.tables";
> my $dbh2 = DBI->connect("dbi:ADO:$dsn", $uname,
> $pword)
> || die "Could not open SQL connection.";
> my $rsnya = $dbh2->prepare($strsqltab4l);
> $rsnya->execute();
>
> while(!$rsnya->{EOF}){
> my $tab4l = $rsnya->fetchrow_array;
> print "\$tab4l: $tab4l \n";
> $rsnya->movenext;
> }
> ====
> but than comes problem that I can not solve.
>
> The error message is:
> "
> Can't get DBI::st=HASH(0x1d2d3f4)->{EOF}: unrecognised
> attribute name at C:/Perl/site/lib/DBD/ADO.pm line
> 1277.
> Can't locate object method "movenext" via package
> "DBI::st" at Untitled1 line 23.
> "
>
> Please tell me why.
>
> Thank you very much in advance.
>
>
>
>
> ________________________________________________________
> Kunjungi halaman depan Yahoo! Indonesia yang baru!
> http://id.yahoo.com/
>

Balasan: Re: Where does "MoveNext" belong to?

am 06.02.2007 15:43:17 von patrixdiradja

Hallo Robert,

Vielen Dank fuer Ihre Antwort.
But I don't think it's enough for my demand to use
fetching of ResultSet that way.

Could you help me more, please tell me where I can get
to use the "MoveNext" and "->{EOF}" from.

I wrote the very simple sample to ease my friends here
to understand my problem but practically I am writing
a database dumping tool for my boss.

Please help me.

Thank you very much in advance.
--- Robert Roggenbuck
wrote:

> I do not know anything special about ADO, but try
> the more usual way to fetch
> results:
>
> my $tab4l;
> while ( ($tab4l) = $rsnya->fetchrow_array) {
>
> print "\$tab4l: $tab4l \n";
>
> }
>
> Does it work this way?
>
> Best regards
>
> Robert
>
>
>
> Patrix Diradja schrieb:
> > Dear my friends....
> >
> > I am writing a program use activeperl 5.8, MSSQL
> and
> > on Win32 Env.
> >
> > Here is my code:
> > ===
> > #!/usr/bin/perl
> > use Tk;
> > use Cwd;
> > use DBI::ADO;
> > use WriteExcel;
> > use strict;
> > use Win32::OLE qw( in );
> >
> > my $dsn="sigma";
> > my $uname="sa";
> > my $pword="penguin";
> > my @bd4l=("AprovaApp1");
> >
> > my $strsqltab4l="select name from sys.tables";
> > my $dbh2 = DBI->connect("dbi:ADO:$dsn", $uname,
> > $pword)
> > || die "Could not open SQL connection.";
> > my $rsnya = $dbh2->prepare($strsqltab4l);
> > $rsnya->execute();
> >
> > while(!$rsnya->{EOF}){
> > my $tab4l = $rsnya->fetchrow_array;
> > print "\$tab4l: $tab4l \n";
> > $rsnya->movenext;
> > }
> > ====
> > but than comes problem that I can not solve.
> >
> > The error message is:
> > "
> > Can't get DBI::st=HASH(0x1d2d3f4)->{EOF}:
> unrecognised
> > attribute name at C:/Perl/site/lib/DBD/ADO.pm line
> > 1277.
> > Can't locate object method "movenext" via package
> > "DBI::st" at Untitled1 line 23.
> > "
> >
> > Please tell me why.
> >
> > Thank you very much in advance.
> >
> >
> >
> >
> >
>
________________________________________________________
>
> > Kunjungi halaman depan Yahoo! Indonesia yang baru!
>
> > http://id.yahoo.com/
> >
>
>
>




________________________________________________________
Kunjungi halaman depan Yahoo! Indonesia yang baru!
http://id.yahoo.com/

Re: Balasan: Re: Where does "MoveNext" belong to?

am 09.02.2007 12:56:06 von rroggenb

Dear Patrix,

to give You more help I need to understand why You (or Your boss) insists of
using MoveNext and ->{EOF}. The functionality of these 'functions' is part of
the DBI fetching-methods.
And when You need to dump data there are fetchall_arrayref() and
selectall_arrayref(), or even dump_results() (depending of the purpose of the
dumping).

Best regards

Robert


Patrix Diradja schrieb:
> Hallo Robert,
>
> Vielen Dank fuer Ihre Antwort.
> But I don't think it's enough for my demand to use
> fetching of ResultSet that way.
>
> Could you help me more, please tell me where I can get
> to use the "MoveNext" and "->{EOF}" from.
>
> I wrote the very simple sample to ease my friends here
> to understand my problem but practically I am writing
> a database dumping tool for my boss.
>
> Please help me.
>
> Thank you very much in advance.
> --- Robert Roggenbuck
> wrote:
>
>> I do not know anything special about ADO, but try
>> the more usual way to fetch
>> results:
>>
>> my $tab4l;
>> while ( ($tab4l) = $rsnya->fetchrow_array) {
>>
>> print "\$tab4l: $tab4l \n";
>>
>> }
>>
>> Does it work this way?
>>
>> Best regards
>>
>> Robert
>>
>>
>>
>> Patrix Diradja schrieb:
>>> Dear my friends....
>>>
>>> I am writing a program use activeperl 5.8, MSSQL
>> and
>>> on Win32 Env.
>>>
>>> Here is my code:
>>> ===
>>> #!/usr/bin/perl
>>> use Tk;
>>> use Cwd;
>>> use DBI::ADO;
>>> use WriteExcel;
>>> use strict;
>>> use Win32::OLE qw( in );
>>>
>>> my $dsn="sigma";
>>> my $uname="sa";
>>> my $pword="penguin";
>>> my @bd4l=("AprovaApp1");
>>>
>>> my $strsqltab4l="select name from sys.tables";
>>> my $dbh2 = DBI->connect("dbi:ADO:$dsn", $uname,
>>> $pword)
>>> || die "Could not open SQL connection.";
>>> my $rsnya = $dbh2->prepare($strsqltab4l);
>>> $rsnya->execute();
>>>
>>> while(!$rsnya->{EOF}){
>>> my $tab4l = $rsnya->fetchrow_array;
>>> print "\$tab4l: $tab4l \n";
>>> $rsnya->movenext;
>>> }
>>> ====
>>> but than comes problem that I can not solve.
>>>
>>> The error message is:
>>> "
>>> Can't get DBI::st=HASH(0x1d2d3f4)->{EOF}:
>> unrecognised
>>> attribute name at C:/Perl/site/lib/DBD/ADO.pm line
>>> 1277.
>>> Can't locate object method "movenext" via package
>>> "DBI::st" at Untitled1 line 23.
>>> "
>>>
>>> Please tell me why.
>>>
>>> Thank you very much in advance.
>>>
>>>
>>>
>>>
>>>
> ________________________________________________________
>>> Kunjungi halaman depan Yahoo! Indonesia yang baru!
>>> http://id.yahoo.com/
>>>
>>
>>
>
>
>
>
> ________________________________________________________
> Kunjungi halaman depan Yahoo! Indonesia yang baru!
> http://id.yahoo.com/
>

--

===================================================
Robert Roggenbuck, M.A.
Konrad Zuse Zentrum fuer Informationstechnik Berlin
Takustr. 7 D-14195 Berlin
roggenbuck@zib.de
http://www.mathematik-21.de/
http://www.zib.de/

Buero:
Universitaet Osnabrueck
Fachbereich Mathematik / Informatik
Albrechtstr. 28a Fon: ++49 (0)541/969-2735
D-49069 Osnabrueck Fax: ++49 (0)541/969-2770
http://www.mathematik.uni-osnabrueck.de/
===================================================

Balasan: Re: Balasan: Re: Where does "MoveNext" belong to?

am 01.03.2007 23:34:49 von patrixdiradja

Dear Robert,

OK, I believe this thread should be enough for me
actually. I only should more patient-accurate for
doing coding.

I implement your method without "movenext" and you are
right.

Thank you very much Robert. You're nice.
--- Robert Roggenbuck
wrote:

> Dear Patrix,
>
> to give You more help I need to understand why You
> (or Your boss) insists of
> using MoveNext and ->{EOF}. The functionality of
> these 'functions' is part of
> the DBI fetching-methods.
> And when You need to dump data there are
> fetchall_arrayref() and
> selectall_arrayref(), or even dump_results()
> (depending of the purpose of the
> dumping).
>
> Best regards
>
> Robert
>
>
> Patrix Diradja schrieb:
> > Hallo Robert,
> >
> > Vielen Dank fuer Ihre Antwort.
> > But I don't think it's enough for my demand to use
> > fetching of ResultSet that way.
> >
> > Could you help me more, please tell me where I can
> get
> > to use the "MoveNext" and "->{EOF}" from.
> >
> > I wrote the very simple sample to ease my friends
> here
> > to understand my problem but practically I am
> writing
> > a database dumping tool for my boss.
> >
> > Please help me.
> >
> > Thank you very much in advance.
> > --- Robert Roggenbuck
> > wrote:
> >
> >> I do not know anything special about ADO, but try
> >> the more usual way to fetch
> >> results:
> >>
> >> my $tab4l;
> >> while ( ($tab4l) = $rsnya->fetchrow_array) {
> >>
> >> print "\$tab4l: $tab4l \n";
> >>
> >> }
> >>
> >> Does it work this way?
> >>
> >> Best regards
> >>
> >> Robert
> >>
> >>
> >>
> >> Patrix Diradja schrieb:
> >>> Dear my friends....
> >>>
> >>> I am writing a program use activeperl 5.8, MSSQL
> >> and
> >>> on Win32 Env.
> >>>
> >>> Here is my code:
> >>> ===
> >>> #!/usr/bin/perl
> >>> use Tk;
> >>> use Cwd;
> >>> use DBI::ADO;
> >>> use WriteExcel;
> >>> use strict;
> >>> use Win32::OLE qw( in );
> >>>
> >>> my $dsn="sigma";
> >>> my $uname="sa";
> >>> my $pword="penguin";
> >>> my @bd4l=("AprovaApp1");
> >>>
> >>> my $strsqltab4l="select name from sys.tables";
> >>> my $dbh2 = DBI->connect("dbi:ADO:$dsn", $uname,
> >>> $pword)
> >>> || die "Could not open SQL connection.";
> >>> my $rsnya = $dbh2->prepare($strsqltab4l);
> >>> $rsnya->execute();
> >>>
> >>> while(!$rsnya->{EOF}){
> >>> my $tab4l = $rsnya->fetchrow_array;
> >>> print "\$tab4l: $tab4l \n";
> >>> $rsnya->movenext;
> >>> }
> >>> ====
> >>> but than comes problem that I can not solve.
> >>>
> >>> The error message is:
> >>> "
> >>> Can't get DBI::st=HASH(0x1d2d3f4)->{EOF}:
> >> unrecognised
> >>> attribute name at C:/Perl/site/lib/DBD/ADO.pm
> line
> >>> 1277.
> >>> Can't locate object method "movenext" via
> package
> >>> "DBI::st" at Untitled1 line 23.
> >>> "
> >>>
> >>> Please tell me why.
> >>>
> >>> Thank you very much in advance.
> >>>
> >>>
> >>>
> >>>
> >>>
> >
>
________________________________________________________
> >>> Kunjungi halaman depan Yahoo! Indonesia yang
> baru!
> >>> http://id.yahoo.com/
> >>>
> >>
> >>
> >
> >
> >
> >
> >
>
________________________________________________________
>
> > Kunjungi halaman depan Yahoo! Indonesia yang baru!
>
> > http://id.yahoo.com/
> >
>
> --
>
> ===================================================
> Robert Roggenbuck, M.A.
> Konrad Zuse Zentrum fuer Informationstechnik Berlin
> Takustr. 7 D-14195 Berlin
> roggenbuck@zib.de
> http://www.mathematik-21.de/
> http://www.zib.de/
>
> Buero:
> Universitaet Osnabrueck
> Fachbereich Mathematik / Informatik
> Albrechtstr. 28a Fon: ++49 (0)541/969-2735
> D-49069 Osnabrueck Fax: ++49 (0)541/969-2770
> http://www.mathematik.uni-osnabrueck.de/
> ===================================================
>




________________________________________________________
Kunjungi halaman depan Yahoo! Indonesia yang baru!
http://id.yahoo.com/