premjhere has asked for the wisdom of the Perl Monks concerning the following question:

Monks,
$sth->bind_param(':Memno',$Num,{ora_type=>ORA_NUMBER});
is anything wrong with the above code ?
when i execute it , i get the error :
can't bind :Memno . ora_type 2 not supported by DBD::Oracle
what should be the reason ?
what am i missing ?
help me monks.

Replies are listed 'Best First'.
Re: cant bind ORA_NUMBER in DBD::Oracle ?
by dws (Chancellor) on Jul 18, 2002 at 03:09 UTC
    DBD::Oracle doesn't come right out and say so, it does restrict the types you can bind. From the driver code (dbdimp.c),
    static int oratype_bind_ok(dbtype) /* It's a type we support for placeholders +*/ int dbtype; { /* basically we support types that can be returned as strings */ switch(dbtype) { case 1: /* VARCHAR2 */ case 5: /* STRING */ case 8: /* LONG */ case 23: /* RAW */ case 24: /* LONG RAW */ case 96: /* CHAR */ case 97: /* CHARZ */ case 106: /* MLSLABEL */ case 102: /* SQLT_CUR OCI 7 cursor variable */ case 112: /* SQLT_CLOB / long */ case 113: /* SQLT_BLOB / long */ case 116: /* SQLT_RSET OCI 8 cursor variable */ return 1; } return 0; }
    I'm guessing that NUMBER isn't on this list because Oracle's numbers are in a funky, multiple-byte packed fixed-point format. They won't necessarily fit into any of Perl's native types.

    Bind a string instead. It'll be automagically converted.

      Thanx a lot DWS . got it .