Re: A note on "Programming the Perl DBI (Tim Bunce)"




-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


<< Can't locate object method "pg_oid_status" via package "DBI::db" >>

This is triggered by my command << $bag{$dbh->pg_oid_status} = 1; >>
where I use the oid as index in a structure of my own.

pg_oid_status is an *attribute* of the statement handle, and not a *method*.
So accessing it should be:

$sth->{pg_oid_status};

and thus your particular query would be:

$bag{ $sth->{pg_oid_status} } = 1;

DBI::db in this case refers to the database handle, which is the item
returned by the DBI->connect method: many people follow the standard
name of $dbh, which I assume you have done here. The database handle
does not contain the pg_oid_status attribute, however, the statement
handle does.

Having said all of that, OIDs have been severely deprecated and are not
even turned on by default in recent versions of Postgres. So it is
unlikely that you want to even rely on this attribute except under
very rare and specific cases. You might also want to check the DBI
or DBD::Pg docs for the last_insert_id() method, which may be helpful
in whatever you are trying to do.

- --
Greg Sabino Mullane greg@xxxxxxxxxxxx
End Point Corporation
PGP Key: 0x14964AC8 200707250928
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFGp1IrvJuQZxSWSsgRA524AKDd1DTHEsRGT0wI8JGioU4akKms+ACgq/yV
FVmdhCfyLSXfeJGewGV/SR0=
=pPOD
-----END PGP SIGNATURE-----


.



Relevant Pages

  • Re: Database or large array faster?
    ... >> database is updated. ... but I my money is on the hash. ... I will probably retrieve the other data using $oid as the hash key, ... it in the referenced array, ...
    (comp.lang.perl.misc)
  • Re: fetch the column/rows and fields into hash from dbi
    ... database using several different fields. ... $sth->execute; #executes the query ... Then you can specify either which key you want to get out of the hash ...
    (perl.beginners)
  • Re: what are keys and surrogates?
    ... Let's consider a minimal genealogy database: every person has a father, ... a mother, and a name, but no other attributes. ... What's the OID of the A you are ...
    (comp.databases.theory)
  • Re: Hashing OIDs
    ... unsigned hash = 0 ... for component in (all bytes or integers of the OID): ... So if your OIDs have a binary representation, ... with bit 8 in each "digit" set if there are more digits ...
    (comp.programming)
  • Re: Hashing OIDs
    ... unsigned hash = 0 ... for component in (all bytes or integers of the OID): ... So if your OIDs have a binary representation, ... with bit 8 in each "digit" set if there are more digits ...
    (comp.programming)