Re: from pgsql_perl5 to DBD-Pg

Sean Davis <sdavis2-2loH/[email protected]>
Newsgroups gmane.comp.db.postgresql.dbdpg
Organization NIH
Message-ID <[email protected]>
On Tuesday 27 February 2007 11:43, Bob Hunter wrote:
> I have a better question for you.
>
> I make extensive use of the following Pg method, which
> returns the value of the given record and field
> number:
>
> $sth->getvalue($rn,$fn)
>
> In particular, I use statements like
>
> $sth->getvalue($rn+$i,$fn-$j)
>
> where the the number of record/field are displaced by
> variables. As far as I can see DBI has a method to
> work one row at the time, in sequence. This is way too
> simple to handle the case above. I looked for a more
> powerful DBI method, but it does not seem to exist. Is
> it so? Does DBI have an equivalent to Pg' method
> "getvalue"?

You can simply load all the data into an array (using a variation of 
fetchall_...) of arrays or hashes and access via the array.  DBI allows you 
to choose the data structure coming back--hash-based or array-based.  

Sean
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.