spork has asked for the wisdom of the Perl Monks concerning the following question:
Looking under the hood we find that indeed $sth is not valued, but oddly enough when sth_to_objects() is called (from within C::D itself) $sth is not even passed.
Obviously it must be something that I am doing wrong if there is plenty documentation on how to use the module, but nothing on the strange behavior experience by this humble monk.
Any advice?
Code and results...
The base class...
The test programpackage user::user; use base 'Class::DBI::Sybase'; user::user->set_db('Main', 'DBI:Sybase:database=YYYYYY;server=127.0.0. +1;textsize=4550', 'xxxxxxxx', 'xxxxxxxx'); __PACKAGE__->table('users'); __PACKAGE__->columns(All => 'recnum', 'firstname', 'lastname', 'email' +); 1;
The results#!/usr/bin/perl -w use strict; use user::user; use Data::Dumper; my @cols = user::user->columns; print "COLUMNS:\n"; print "$_\n" foreach @cols; print "\n\nAnd now the table data...\n"; my @obj = user::user->search(recnum =>1); print "$_\n" foreach @obj;
COLUMNS: lastname firstname email recnum And now the table data... sth_to_objects needs a statement handle at ./cdbi_tst.pl line 38
Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Clarification on Class::DBI wackiness
by Joost (Canon) on Aug 03, 2005 at 16:11 UTC | |
by spork (Monk) on Aug 03, 2005 at 16:21 UTC | |
by Joost (Canon) on Aug 03, 2005 at 16:26 UTC | |
|
Re: Clarification on Class::DBI wackiness
by cees (Curate) on Aug 03, 2005 at 16:57 UTC | |
by spork (Monk) on Aug 03, 2005 at 17:37 UTC | |
by cees (Curate) on Aug 03, 2005 at 18:19 UTC |