in reply to calling Oracle stored procedures

A small comment on the interface: why not store the database handle in a package global e.g.
use Oracle::Procedures qw(sysdate); $Oracle::Procedures::DBH = DBI->connect(.....); print sysdate();
so you don't have to pass the dbh to each of your functions.

Replies are listed 'Best First'.
Re^2: calling Oracle stored procedures
by Thilosophy (Curate) on Nov 24, 2004 at 10:30 UTC
    $Oracle::Procedures::DBH = DBI->connect(.....);

    If you could set the package global only once at program startup and then be done with it (which you cannot because there might be more than one connection, and connections sometimes have to be re-opened) that would be sweet.

    But as you cannot, you have to set it every time you call one of Oracle::Procedures' functions, and then there is no gain (in code prettiness) compared to just passing it in every time.

Re^2: calling Oracle stored procedures
by exussum0 (Vicar) on Nov 25, 2004 at 15:29 UTC
    What if you are connecting to two oracle databases at once then? Globals suck :) Or package wide, static like variables.

    ----
    Then B.I. said, "Hov' remind yourself nobody built like you, you designed yourself"