You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jochen Lillich <jl...@teamlinux.de> on 2001/06/05 18:15:10 UTC
Store DBIx::Recordset inside an object
Hi,
I'd like to store an DBIx::Recordset typeglob inside a data object. All
methods of the object shall have access to this RS.
I tried
$self->{RECORDSET} = DBIx::Recordset->Setup(...)
but it didn't work. When I use $self->{RECORDSET}, it doesn't behave
like a typeglob any more. What's the right way to do this?
I'm afraid I haven't really understood the concept of typeglobs so
far, so I'd be more than happy to get some help from you.
Greetings,
Jochen
--
----------------------------------------------------------------
*Jochen Lillich*, Consultant/Trainer @ /TeamLinux GbR/
Rheinstr. 26, 76676 Graben-Neudorf, Germany
Tel. +49 7255 76784-12, Fax -50, http://www.teamlinux.de
----------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Store DBIx::Recordset inside an object
Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
> I'd like to store an DBIx::Recordset typeglob inside a data object. All
> methods of the object shall have access to this RS.
>
> I tried
>
> $self->{RECORDSET} = DBIx::Recordset->Setup(...)
>
> but it didn't work. When I use $self->{RECORDSET}, it doesn't behave
> like a typeglob any more. What's the right way to do this?
>
typeglob's are real magic...
For your above case you simply have to dereference $self->{RECORDSET}, i.e.
$self->{RECORDSET}->{fieldname} # hash access
$self->{RECORDSET}->[$row]{fieldname} # array access
${$self->{RECORDSET}} -> Search (...) ; # call a method
Hope this helps
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org