On Tue, Jun 25, 2002 at 01:38:05PM +0100, Sreeji K Das wrote:
> Hi
> Oracle.xs has:
> I32
> constant(name=Nullch)
>     char *name
>     PROTOTYPE:
> 
> The above defines an empty prototype, so the following
> fails:
> perl -MDBD::Oracle -e 'print
> DBD::Oracle::ORA_RSET(10), "\n";'
> Too many arguments for DBD::Oracle::ORA_RSET at -e
> line 1, near "10)"

But ORA_RSET doesn't take a parameter so it should fail :)

> I know I'm not supposed to run it as above. However,
> the AUTOLOAD in Oracle.pm has:
> my $val = constant($constname);
> 
> which would always fail, if called.
> Basically PROTOTYPE: defines empty prototyping,
> whereas that's not the intended requirement, as the
> xsub constant() can also handle a param conditionally.
> 
> I just commented out PROTOTYPE and it works fine.
> Tim, can this go into sources ? It'd be great if it
> does, so that we don't have to patch it & maintain the
> (though simple) patch.

Sure. Though I'm not clear about why you're the only person to
have had this problem.

You ought to be doing

        use DBD::Oracle qw(:ora_types);

to get the values defined as compile-time constants.

Tim.

Reply via email to