so it is a number inside a char(12) ...
try ... max(to_number()) and see if it works
Raj
______________________________________________________
Rajendra Jamadagni MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.
QOTD: Any clod can have facts, but having an opinion is an art!
-----Original Message-----
From: Jesse, Rich [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 10:29 AM
To: Multiple recipients of list ORACLE-L
Subject: ORA-6502 with cursor and MAX function
OK, severe brain fart here. On 8.1.7.4, the following fails:
declare
v_wo wip.workorderno%TYPE;
cursor c1 is
select max(workorderno) wok
from wip
where assypartno = '33626';
begin
for aa in c1 loop
v_wo := aa.wok;
dbms_output.put_line(v_wo);
end loop;
end;
...on the "v_wo := aa.wok" line with "ORA-6502 PL/SQL: numeric or value
error: character string buffer too small". Huh? I've got no idea how to
fix this. It doesn't appear to be the declaration of "v_wo" either, as I've
tried to make it CHAR(1000) and VARCHAR2(2000) to no avail.
"wip.workorderno" is CHAR(12).
This works fine without the MAX function and also works by converting the
procedure to use an anonymous block instead of a cursor. That would be
fine, except I'm using this to do 10046 trace comparisons of anonymous
blocks and implicit cursors. One other possible culprit is our
CURSOR_SHARING=FORCE, but I've changed the session to EXACT with the same
results. Also, I get the same error in TOAD v7.4 and SQL*Plus.
Anyone? I could use the excuse that I'm getting over a cold or flu here but
this is ridiculous!
TIA,
Rich
Rich Jesse System/Database Administrator
[EMAIL PROTECTED] Quad/Tech International, Sussex, WI USA
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Jesse, Rich
INET: [EMAIL PROTECTED]
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
*********************************************************************This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*********************************************************************1