Tim Bunce wrote:
On Tue, Sep 11, 2007 at 02:15:27AM +0400, Alexander V Alekseev wrote:
On Mon, 10 Sep 2007, Tim Bunce wrote:
There's no need for all that. You could just do this:
$sth->bind_param_inout(":mytable", [EMAIL PROTECTED] , 10 , ... )
Don't you think, it's better to use the first format ?
It's not really a question of one backslash vs two. It's more a question
of the principle behind the design of the API. Consistency trumps beauty
in the long run.
Annoyingly for me I can argue it both ways in this case.
Here's a question for you: what happens when the returnd value is NULL?
How can you distinguish that from an empty array?
Hmmm... In this particular case, Oracle object "TABLE OF ...
INDEX BY BINARY INTEGER" can't be NULL. As far, as I know, it's
impossible in Oracle.
Be careful here. Nested table and varray types in PL/SQL can by null. Googling
on 'Until you initialize it, a nested table or varray is atomically null'
leads to clear documentation of this.
With the current API you could do this:
$sth->bind_param_inout(":mytable", \my $ary = [EMAIL PROTECTED] , 10 ,
... )
die "got null" if !$ary;
(I'll admit I've made that rather terse, but that's not the point here.)
Ok. I'll change docs in my patch.
Hey, don't give in so easily! You can still persuade me. I'm teetering
on the end.
Anyone else have any opinions?
Do any other databases support array types? Can they be NULL?
Oracle supports array types which can by NULL, both in PL/SQL and
in SQL.
I strong agree with Tim's position before he teetered.
--
Charles Jardine - Computing Service, University of Cambridge
[EMAIL PROTECTED] Tel: +44 1223 334506, Fax: +44 1223 334679