Re: Number of results

From: Anthony Baratta (Anthony@Baratta.com)
Date: Thu Oct 14 1999 - 03:13:17 EST


Christopher Stephens wrote:
>
> Hi,
>
> Is there any way in the Perl API to determine the number of results
> returned by a query? I can see how to do this within the C API, but can't
> find anything similar in Perl.

        ## Opening Connection to Database
        $DatabaseString = "DBI:mSQL:database=dbname;hostname=";
        $DatabaseConnection = DBI->connect($DatabaseString, undef,
undef);

        ##Setting Up Query
        $QueryString = "SELECT * FROM tablename WHERE colOne='text data'
AND colTwo=Number";
        $QueryProcess = $DatabaseConnection->prepare("$QueryString");
        $ReturnValue = $QueryProcess->execute;

        $ReturnValue is equal to the number of rows returned by your
query.

-- 
Anthony Baratta
President
KeyBoard Jockeys
                    South Park Speaks Version 3 is here!!!
                       http://www.baratta.com/southpark
                              Powered by Tsunami
-------------------------------------------------------------------------
To unsubscribe, go to http://www.Hughes.com.au/extras/email/



This archive was generated by hypermail 2b30 : Mon Mar 04 2002 - 09:03:51 EST