oracle woes
[prev]
[thread]
[next]
[Date index for 2004/07/14]
OK, I'm stumped, after staring at ->trace(3) traces for an hour or so.
My::DB::List->columns(Primary => 'id');
My::DB::Person->columns(Primary => 'id');
My::DB::Manager->columns(Primary => qw(list person));
My::DB::Manager->has_a(list => My::DB::List);
My::DB::Manager->has_a(person => My::DB::Person);
My::DB::Manager->columns(Other => qw(is_owner));
I have a Manager object, which I created with a List and Person. I
call ->is_owner on it to get the value. I can see at trace(3) that
I'm creating the SQL:
SELECT is_owner
FROM manager
WHERE list=? AND person=?
Under DBD::SQLite, I get:
-> execute for DBD::SQLite::st (DBIx::ContextualFetch::st=HASH(0x984630)~0x981ed8 My::DB::List=HASH(0x985338) My::DB::Person=HASH(0x983c64))
<- execute= '0E0' (magic-sg:t) at ContextualFetch.pm line 51 via /opt/perl/snap/lib/site_perl/5.8.5/DBIx/ContextualFetch.pm line 31
and all is well. It figures out the ID columns for both the List and
Person object, and then fetches the value I need.
But the very same code under DBD::Oracle, I get:
-> execute for DBD::Oracle::st (DBIx::ContextualFetch::st=HASH(0x6b926c)~0x6c4c14 My::DB::List=HASH(0x67c1fc) My::DB::Person=HASH(0x6abc50))
-- DBI::END
and then everything unwinds, die'ing with:
Can't bind a reference (My::DB::List=HASH(0x67c1fc)) at /ssa/homedirs/02/48/merlyn/.cpan/lib/perl5/site_perl/5.8.3/DBIx/ContextualFetch.pm line 51.
How come? Does DBD::Oracle not know how to view the ->id column
to get to the real value for the SQL? And if so, how should I have
written this?
And, unlike most of the little stuff I write, this is for a real client,
so I'm under the gun here, if anyone has any ideas or wants me to try
anything different.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <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!
|
oracle woes
merlyn (Randal L. Schwartz) 03:48 on 14 Jul 2004
|