[CDBI] Question

Randal L. Schwartz merlyn at stonehenge.com
Thu Sep 8 11:57:31 BST 2005

>>>>> "Tyler" == Tyler Rorabaugh <trorabaugh at gmail.com> writes:

Tyler> 1) Is there a way to return a hashref of data from a cdbi module
Tyler> without knowing the column names? Say for instance you want to
Tyler>     send a hashref to Soap::Lite or other cpan soap related modules.
Tyler>            For example:
Tyler>                If you wanted to call a cdbi module remotely via say
Tyler> .Net j2ee etc by using a method of a class that returns a cdbi object

Tyler>    I have tried the internal method called _data_hash but for tables
Tyler> that have Foreign Keys it appears as though it will only return
Tyler> the blessed hashref of that data.

my %data = map { $_ => $object->get($_) } $object->columns;

Beware that some values of %data will be inflated objects.

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

More information about the ClassDBI mailing list