Re: perl DBI oracle and error ORA 06502



It could be in perl but if this is the case I would need the exact procedure, schema, some data and the exact perl code that calls it.

However to start please set the dbh->debug(6) before you call your code and send me the results. There might be
a var that Perl is croaking on and this is one way to see where it dies.

Again I do not hold out much hope for this as it is a Oracle error that is being returned not a DBI/DBD one.

I would also need the name of and version your OS, perl, DBI, DBD::Oracle, The Oracle client you are running and the Oracle DB itself

cheers
John Scoles

Pompiliu wrote:
Thanks a lot John.

The problem is that this is a company code and data,
and I would have to go through 'legal' or get cover
from a director or higher to show them outside; great,
huh? -- insert heavy sarcasm here ;-)

I found what the error means though this does not help
because:

(a) Calling that particular package from sqlplus works
fine and I get lots more rows in the output.
(b) The problem shows in the perl code.

The perl code is written in the usual/generic way (see
the examples in CPAN and elsewhere). Basically I do a
connect, $dbh->func(1000000000, 'dbms_output_enable');
prepare (with a string containing a call to a PL/SQL
package), bind params (2 of them), execute, and then
start getting results with dbms_output_get (which is
simply DBMS_OUTPUT.GET_LINE underneath, according to
the doc).

I used DBI quite a bit before running
selects/inserts/updates (simple SQL) with DB2 and
Oracle, and it worked like a charm in all cases.

Pompiliu

--- John Scoles <scoles@xxxxxxxxxxx> wrote:

Ah yes the APPLE][ error for those of us who are old
enough to remember those things

here is what the error code means

*ORA-06502:* PL/SQL: numeric or value error
/string/
*Cause:* An arithmetic, numeric, string,
conversion, or constraint error occurred. For example, this error occurs if an
attempt is made to assign the value NULL to a variable declared NOT
NULL, or if an attempt is made to assign an integer larger than 99 to a
variable declared NUMBER(2).
*Action:* Change the data, how it is manipulated,
or how it is declared so that values do not violate constraints.


So I would first have a look at your data looks like
there is something in the PSQL of the packge dbms_output_get that is
giving you the error. In this case DBI and DBD::Oracle are simply
working as they should returning an error message from the database.

cheers
John Scoles
Pompiliu wrote:
Hi,

I am running DBI and Oracle DB; I am executing a
package and using $dbh->func('dbms_output_get') as in
my $row;
while (($row = $dbh->func('dbms_output_get')))
{
print "$row\n";
}
if ($sth->err) {
print STDERR "ERROR: $DBI::errstr";
}
to pull the output; I did set $dbh->func(1000000000, 'dbms_output_enable');
right after connect.
The problem is that I am getting only part of the
result and the error I am getting is ORA 06502.

Everything works fine up to here. How can I fix
this?
Please email.
Thanks. P


____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs



____________________________________________________________________________________
Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
.



Relevant Pages

  • RE: perl DBI oracle and error ORA 06502
    ... procedure, schema, some data and the exact perl code that calls it. ... I would also need the name of and version your OS, perl, DBI, ... DBD::Oracle, The Oracle client you are running and the Oracle DB ... The problem shows in the perl code. ...
    (perl.dbi.users)
  • Re: perl DBI oracle and error ORA 06502
    ... Again I do not hold out much hope for this as it is a Oracle error that is being returned not a DBI/DBD one. ... I would also need the name of and version your OS, perl, DBI, DBD::Oracle, The Oracle client you are running and the Oracle DB itself ... The problem shows in the perl code. ... package), bind params, execute, and then ...
    (perl.dbi.users)
  • perl script for extracting csv files on the fly
    ... This may be of some use; I use it all the time (RH E 4; Oracle ... Save the perl code below and make sure you can execute it. ... Change the host, sid, port, user and password variables as needed. ... Or if you want clean formatted output: ...
    (comp.databases.oracle.server)
  • Problem compiling Perl code from Linux machine
    ... I facing a problem while compiling a perl code from my Linux machine. ... for module DBI: ... please destroy and notify sender. ...
    (perl.dbi.users)
  • Re: Tracing SQL queries done via DBI (mod_perl)
    ... (80k+ of perl code, mod_perl) ... I have one entry point whose job is to give the database ... There is a tracemethod on DBI, however, it does not properly print ...
    (comp.lang.perl.misc)