-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 26 April 2002 12:02 pm, Shao, Chunning wrote:
> I need to plot a result set from DBI.  Before I can do that, I need to know
> how many rows are returned, so I can set up my x, y axis right.

my $number_rows = $csr->rows;

easy ;D

Jayce^
>
> I am doing
> #######################################################
> $csr = $dbh->prepare($sql);
> $csr->execute();
>
> #get the number that how many rows returned
> my $number_rows = 0;
> while (my @rows = $csr->fetchrow_array )
> {
>         $number_rows +=1;
> }
> Set my x,y axis accordingly............
>
> #begin to plot the data
> my ($x_definition,$y_definition);
> while (my @row = $csr->fetchrow_array )
> {
>         $counter = 0;
>         foreach my $data (@row)
>         Plot the data
> }
> ########################################################
> but I got an error
> 281
> DBD::Oracle::st fetchrow_array failed: ERROR no statement executing
> (perhaps you need to call execute first) at ./test.pl line 162.
>
> Do I have to make a second db call, or there is better way of doing it?
>
> Thanks
>
> chunning
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8ycKVoTgdT9hhlCIRAnSIAKCWxJOOBYrZB4XKRh9hDRLlsF5KeQCfVuf7
DGWkSlbO2mw05Cld3S5hEws=
=rZlN
-----END PGP SIGNATURE-----

Reply via email to