Numeric or value error problem

Hi,
I created the following function on Oracle 8i:
create or replace function get_pub_info(p_inbox in varchar2)
return varchar2 deterministic is
cursor c_pub(p_inb varchar2) is
select a.pub_name,
a.pub_code,
     b.fprocess_id
from pub a, fprocess b
where b.inbox_id = p_inb
and a.pub_code = b.pub_code;
v_inbox varchar2(25) default p_inbox;
v_pubn pub.pub_name%type;
v_pubc pub.pub_code%type;
v_fprocid fprocess.fprocess_id%type;
v_info varchar2(4000);
begin
open c_pub(trim(v_inbox));
v_info := '[';
loop
fetch c_pub into v_pubn, v_pubc, v_fprocid;
exit when c_pub%notfound;
if (v_pubn is not null) and (v_pubc is not null) and (v_fprocid is not null) then
v_info := v_info || '{PUB_PROCESS_ID=>"' || trim(v_fprocid) || '", PUB_CODE=>"' || trim(v_pubc) || '", PUB_NAME=>"'|| trim(v_pubn) ||'"},';
end if;
end loop;
close c_pub;
if v_info is not null then
if length(v_info) <= 1 then
v_info := '';
else
v_info := substr(v_info,1,length(v_info)-1)||']';
end if;
else
v_info := '';
end if;
return v_info;
end;
This function is used to generate a view column, and when I type "select * from view_name" on SQL*Plus, I get the error:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "ISI_PUBS.GET_PUB_INFO", line 25
ORA-06512: at line 1
Can anybody give me a hand with this? Why this error happens?
I would really appreciate your help.
Thanks in advance.
-eric-

Wednesday, May 15, 2002 1:29pm ADT
Hi Eric,
Can't recreate your error.... I did the following (see SQL*PLUS output at end of this post):
(1) created the PUB table using info you provided
(2) inserted a row into PUB table and commited
(3) created the FPROCESS table using info you provided
(4) inserted a row into FPROCESS table and commited
(5) selected from PUB table
(6) selected from FPROCESS table
(7) executed the get_pub_info() function
What happens when you just try the following?:
select get_pub_info('whatever') from dual;
Regards,
Phany
Moncton, NB, Canada
OUTPUT FROM SQL*PLUS
======================
SQL> CREATE TABLE PUB (P_INB VARCHAR2(1), PUB_NAME VARCHAR2(1), PUB_CODE VARCHAR2(1));
Table created.
SQL> INSERT INTO PUB VALUES('A','B','C');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> CREATE TABLE FPROCESS (INBOX_ID VARCHAR2(1), FPROCESS_ID VARCHAR2(1), PUB_CODE VARCHAR2(1));
Table created.
SQL> INSERT INTO FPROCESS VALUES ('A','B','C');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> CREATE OR REPLACE function get_pub_info(p_inbox in varchar2)
2 RETURN varchar2 deterministic
3 IS
4 cursor c_pub(p_inb varchar2)
5 is
6 select a.pub_name, a.pub_code, b.fprocess_id
7 from pub a, fprocess b
8 where b.inbox_id = p_inb
9 and a.pub_code = b.pub_code;
10
11 v_inbox varchar2(25) default p_inbox;
12 v_pubn pub.pub_name%type;
13 v_pubc pub.pub_code%type;
14 v_fprocid fprocess.fprocess_id%type;
15 v_info varchar2(4000);
16 BEGIN
17 open c_pub(trim(v_inbox));
18
19 v_info := '[';
20
21 loop
22 fetch c_pub into v_pubn, v_pubc, v_fprocid;
23 exit when c_pub%notfound;
24
25 if (v_pubn is not null) and (v_pubc is not null) and (v_fprocid is not null) then
26 v_info := v_info || '{PUB_PROCESS_ID=>"' || trim(v_fprocid) || '", PUB_CODE=>"' || trim(v_pubc) || '", PUB_NAME=>"'|| trim(v_pubn) ||'"},';
27 end if;
28 end loop;
29
30 close c_pub;
31
32 if v_info is not null
33 then
34 if length(v_info) <= 1 then
35 v_info := '';
36 else
37 v_info := substr(v_info,1,length(v_info)-1) || ']';
38 end if;
39 else
40 v_info := '';
41 end if;
42
43 return v_info;
44 END;
45 /
Function created.
SQL> select * from pub;
P P P
A B C
SQL> select * from fprocess;
I F P
A B C
SQL> SELECT get_pub_info('A') FROM dual;
GET_PUB_INFO('A')
[{PUB_PROCESS_ID=>"B", PUB_CODE=>"C", PUB_NAME=>"B"}]
SQL>
======================

Similar Messages

  • Problem with error ORA-06502: PL/SQL: numeric or value error string

    Hi,
    I am running a loop to just spool output data using 'dbms_output.put_line' and I keep getting this error after a few records. I resorted it and it happen at a different interval. Could it have to do with the length of the item I am trying to spool? Thanks.
    ORA-06502: PL/SQL: numeric or value error string

    SD wrote:
    Hi,
    I am running a loop to just spool output data using 'dbms_output.put_line' and I keep getting this error after a few records. I resorted it and it happen at a different interval. Could it have to do with the length of the item I am trying to spool? Thanks.
    ORA-06502: PL/SQL: numeric or value error stringyes, it is a data dependent error.
    Handle:     SD
    Status Level:     Newbie
    Registered:     Nov 21, 2001
    Total Posts:     289
    Total Questions:     189 (183 unresolved)
    why do you waste time here when you rarely get your questions answered?

  • Report error: ORA-06502: PL/SQL: numeric or value error: NULL index table k

    Hi everybody,
    I have two Distinct Databases on two distinct servers. (Oracle Ent. Release 10.2.0.3.0 on AIX 5.3). After I install the latest patch last week, One of the APEX installation has some problems on Home>Application Builder Page. The error message is very random and
    report error:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value.
    When i change the view (details to icons), everything goes to normal. This error message is reflected some of the pages (report region) of some of my applications randomly. When it appears in a report region, i deselect the order method of the region, the result is normal.
    But the other APEX application on the other instance has no problem. It is a bug? or Should i re-install the APEX instance?
    Thank you for your interest?
    Gökhan ÇATALKAYA

    No, but we have a reproducible test case now so we're working on it. See ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    Scott

  • ORA-06502:Numeric or value error ORA-01403: No data found --6502

    Dear All
    I am using Forms 10g.
    I am calling a report from my form.
    but when i am calling then it is showing this error:
    ORA-06502:Numeric or value error ORA-01403: No data found --6502
    My code is in Print Button :
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    plid ParamList;
    vParamValue number;
    BEGIN
    plid := Get_parameter_List('tmp');
    IF NOT Id_Null(plid) THEN
    Destroy_parameter_List( plid );
    END IF;
    plid := Create_parameter_List('tmp');
    Add_Parameter(PLid, 'P_Block', Text_Parameter, :block_query.item_block);
    Add_Parameter(PLid, 'P_Category', Text_Parameter, :block_query.item_category);
    Add_Parameter(PLid, 'P_Dept', Text_Parameter, :block_query.item_dept);
    Add_Parameter(PLid, 'P_sub_Category', Text_Parameter, :block_query.item_sub_category);
    Add_Parameter(PLid, 'P_FLOOR', Text_Parameter, :block_query.item_floor);
    Add_Parameter(PLid, 'P_IP', Text_Parameter, :block_query.item_ip);
    Add_Parameter(PLid, 'P_Room', Text_Parameter, :block_query.item_room);
    Add_Parameter(PLid, 'P_Userid', Text_Parameter, :block_query.item_usr_id);
    Add_Parameter(PLid, 'PARAMFORM', Text_Parameter, 'NO');
    repid := FIND_REPORT_OBJECT('rp_report');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_oracleapps_eHOpeAS');
    v_rep := RUN_REPORT_OBJECT(repid,plid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')      
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?
    '||'server=rep_oracleapps_eHOpeAS');
    Exception
         When others then
         message(Sqlerrm||'-'||sqlcode);
    End;
    Edited by: Sandip Mohapatra on Feb 8, 2010 12:44 AM

    hi
    u can write for all no problem.
    here is an example please modify it with u r requirements.
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    plid ParamList;
    vParamValue number;
    BEGIN
    plid := Get_parameter_List('tmp');
    IF NOT Id_Null(plid) THEN
    Destroy_parameter_List( plid );
    END IF;
    plid := Create_parameter_List('tmp');
    add_parameter(plid,'P_code',text_parameter,to_char(:hr.employee_code));
    add_parameter(plid,'P_name',text_parameter,to_char(:hr.name));
    add_parameter(plid,'P_fname',text_parameter,to_char(:hr.fname));
    add_parameter(plid,'P_gender',text_parameter,to_char(:hr.gender));
    add_parameter(plid,'P_married',text_parameter,to_char(:hr.marital_status));
    add_parameter(plid,'P_job',text_parameter,to_char(:hr.job));
    add_parameter(plid,'P_sal',text_parameter,to_char(:hr.sal));
    add_parameter(plid,'P_dob',text_parameter,to_char(:hr.dob));
    add_parameter(plid,'P_country',text_parameter,to_char(:hr.country));
    add_parameter(plid,'P_nationality',text_parameter,to_char(:hr.nationality));
    add_parameter(plid,'P_address',text_parameter,to_char(:hr.address));
    add_parameter(plid,'p_imagecode',text_parameter,to_char(:images.employee_code));
    Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
    repid := FIND_REPORT_OBJECT('REPORT6');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
    SET_APPLICATION_PROPERTY(CURSOR_STYLE,'NORMAL');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
    v_rep := RUN_REPORT_OBJECT(repid,plid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://sarah:8890/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver&P_code='||:hr.employee_code||'&P_name'
    ||:hr.name ||'&P_fname'|| :hr.fname  ||'&P_gender'||:hr.gender||'&P_married'||:hr.marital_status||'&P_job'||:hr.job||'&P_sal'||:hr.sal||'&P_dob'||:hr.dob||
    '&p_country'||:hr.country||'&p_natioanlity'||:hr.nationality||'&p_address'||:hr.address||'&p_image'||:images.employee_code||'&paramform=no','_SELF');
    END;sarah

  • OAS 4.0.8 PL/SQL Catridge exception ORA-6502 (Numeric or value error)

    Hello,
    Out product is using OAS 4.0.8.2 on UNIX running SOlaris. We are using Oracles Web Toolkit for application development and
    presentation. I am basically trying to fill up some HTML form fields and calling
    an HTTP post procedure in response
    to a user clicking a submit button.
    For some reason the PL/SQL cartridge throws an ORA-6502 error(Numeric or value error). Is there any restrictions to the
    string types that can be passed to an HTTP
    post procedure ??
    Any pointers would be greatly appreciated ?
    Thanks,
    Ricko
    null

    We have fixed the problem !!! :-DDD
    Thanks to all Oracle analysts who replied this issue.
    aLeX
    [email protected]

  • ORA-06502: PL/SQL: numeric or value error:  Only in APEX

    I have a routine that works well in SQL Plus and Toad.
    begin
    XXXXXX.process_message(1);
    end;
    Now when I call it via APEX on a submit of a button, it comes back with an error.
    "ORA-06502: PL/SQL: numeric or value error: character to number Error"
    Any pointers to what might because this only in APEX and not on toad.
    Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Prod
    PL/SQL Release 10.1.0.5.0 - Production
    CORE 10.1.0.5.0 Production
    TNS for Linux: Version 10.1.0.5.0 - Production
    NLSRTL Version 10.1.0.5.0 - Production
    ----------------

    I have updated my profile. I am a development lead at Dell.
    The procedure I am calling is calling create service request pub, update service request up.
    It is just a wrapper around the all these API's and invoking it from APEX on insert of certain values.
    The problem is , this wrapper API works fine with SQL Plus/ TOAD and not via APEX.
    I cannot replicate the error in APEX.oracle.com because it is calling custom ebiz code in our 11.5.10 instance.

  • -6502 ORA-06502: PL/SQL: numeric or value error when using 'Create CAPI Definition'

    I get an error when I try to create a CAPI definition with Headstart untilities (6i). I use HSU_CAPI revision 6.5.2.0
    The detailed information says the following:
    Message
    BLAPI.OPEN_ACTIVITY
    Start HSU_CAPI.run
    Number of Tables to create CAPI for 1
    Initial checks for table KCS_TENDERS with id 692754610572409851363604771392473242
    HSU_CAPT.initial_checks for table KCS_TENDERS
    HSU_CAPF.initial_checks for table KCS_TENDERS
    HSU_CAPC.initial_checks Custom Services for table KCS_TENDERS
    HSU_CAPB.initial_checks BRDD for table KCS_TENDERS
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDIPLS
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    KCS_TENDERS Business Rule Design Definition BR_TNR001_CEV does not have any Trigger Columns. Rule will fire when any column is updated.
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDIPLS
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    Creating CAPI for table KCS_TENDERS with id 692754610572409851363604771392473242
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Insert-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Update-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Insert-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Update-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Delete-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-row, Save old data.
    Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCODE number of text lines = 404 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Insert, Call CAPI.
    Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCODE number of text lines = 4 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Update, Call CAPI.
    Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCODE number of text lines = 4 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Delete, Call CAPI.
    Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCODE number of text lines = 17 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Insert, Call CAPI.
    Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCODE number of text lines = 7 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Update, Call CAPI.
    Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCODE number of text lines = 144 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Delete, Call CAPI.
    Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCODE number of text lines = 282 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    HSU_CAPF.create_or_find_capi_pack
    hsu_capi.find_plm (kcs_tnr_capi, 692754610572409851363604771392473242, CAPI).
    capi package found in the context folder
    BLPLM.UPD
    FREE_FORMAT_TEXT_FLAG......... = Y
    IMPLEMENTATION_NAME........... = kcs_tnr_capi
    PLSQL_MODULE_TYPE............. = PACKAGE
    SCOPE......................... = PUBLIC
    COMPLETION_STATUS............. = COMPLETED
    NAME.......................... = kcs_tnr_capi
    PURPOSE....................... = Custom API package for implementing Business Rules and supporting TAPI
    Recreated Package KCS/ KCS_TNR_CAPI, preserving only the Revision History.
    HSU_CAPF.add_tags_er_av
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    HSU_CAPF.create_specification
    HSU_CAPF.create_c_tabalias
    HSU_CAPF.create_c_tabalias_all
    HSU_CAPF.create_aggregate_value
    HSU_CAPF.create_aggregate_value
    HSU_CAPF.create_aggregate_value
    Activity aborted with ORACLE internal errors.
    -6502 ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    What can I do about it???
    Thanks in advance.
    Menno Hoogsteen

    Working on the same project as Menno, I had the time to look into the problem.
    The problem is caused by the creation of the capi-function agregate_char_value in the packages hsu_capf. While creating this function the following code is executed:
    add(' -- allowable values:');
    add(' -- '||l_col_name_list);
    This last statement causes the problem because this table is very big. L_col_name_list contains 2391 characters wich is 393 characters to long. So i changed this code into:
    add(' -- allowable values:');
    add(' -- '||substr(l_col_name_list,1,1990));
    add(' -- '||substr(l_col_name_list,1990));
    and everything works fine. Perhaps something for a patch?
    Kind regards,
    Ruben Spekle

  • Pl/Sql numeric or value error

    Hi All,
    Does any one know if there is a bug in Oracle 8 related to date variable?
    This is the second time I am seeing very peculiar problem with date package variable as well as local variable.
    1) Few weeks back, I encountered problem with Date package variable, which is giving pl/sql numeric or value error,if you leave the session idle for few hours. When you connect back, the query runs just fine without any problem. To fix this I had to remove the date package variable.
    2)And now I am seeing that my job which calls the above package failing after running for long hours. It fails due to a local date variable with Pl/sql numeric or value error. Now, I am going to remove this variable also.
    Anyone has thoughts on this?
    Thanx for any inputs.

    Hi,
    I have solved by adding the following statement.
    DBMS_LOB.CREATETEMPORARY(theClob,cache=>false);
    Thanks,
    Rammu

  • Numeric or value error: hex to raw conversion error , pls help

    I am having problem with a sproc which accepts a Raw parameter.
    I have a table called Profile:
    CREATE TABLE PROFILES
    PROFILEID INTEGER NOT NULL,
    USERID INTEGER NOT NULL,
    PROFILE RAW(255)
    and a sproc named addprofile
    CREATE OR REPLACE PROCEDURE addprofile
    profile IN RAW,
    userName IN VARCHAR2
    AS
    userId INT;
    BEGIN
    GetUserIdByName( userName, userId);
    INSERT INTO Profiles
    ( ProfileID,userId , profile )
    VALUES ( Profiles_ProfileID_SEQ.NEXTVAL,AddProfile.userId ,
    AddProfile.profile );
    END;
    I am calling the Ent Library's Insert profile method which is part of DbProfileProvider.cs (Security App block). It is trying to persist a serialized profile object into the database.
    private void InsertProfile(string userName, byte[] serializedProfile,
    Data.Database securityDb, IDbTransaction transaction)
    DBCommandWrapper cmd = securityDb.GetStoredProcCommandWrapper
    (SPAddProfile);
    cmd.AddInParameter("userName", DbType.String, userName);
    cmd.AddInParameter("profile", DbType.Binary, serializedProfile);
    securityDb.ExecuteNonQuery(cmd, transaction);
    I get the following error:
    Any suggestion on what needs to be changed to get this working? thanks!
    Exception Details: Oracle.DataAccess.Client.OracleException: ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error ORA-06512: at line 1
    Stack trace:
    [OracleException: ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error
    ORA-06512: at line 1]
    Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
    Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
    Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
    Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DBCommandWrapper command)
    Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DBCommandWrapper command, IDbTransaction transaction)
    Microsoft.Practices.EnterpriseLibrary.Security.Database.DbProfileProvider.InsertProfile(String userName, Byte[] serializedProfile, Database securityDb, IDbTransaction transaction)
    Microsoft.Practices.EnterpriseLibrary.Security.Database.DbProfileProvider.SetProfile(IIdentity identity, Object profile)
    [InvalidOperationException: Error saving the profile for the following user 'test'.]
    Microsoft.Practices.EnterpriseLibrary.Security.Database.DbProfileProvider.SetProfile(IIdentity identity, Object profile)
    EntLibSecuritySample.DFO.Security.SecurityHelper.SetUserProfile(IIdentity identity, Object Profile) in C:\DFO\Sample\Security\EntLibSecuritySample\SecurityHelper.vb:285
    [ApplicationException: An error has occurred saving profile object to Datastore. See stack trace for further information]
    EntLibSecuritySample.DFO.Security.SecurityHelper.SetUserProfile(IIdentity identity, Object Profile) in C:\DFO\Sample\Security\EntLibSecuritySample\SecurityHelper.vb:287
    EntLibSecuritySample.ProfilePage.cmdSaveProfile_Click(Object sender, EventArgs e) in C:\DFO\Sample\Security\EntLibSecuritySample\profile.aspx.vb:59
    System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    System.Web.UI.Page.ProcessRequestMain() +1292

    Harsh,
    I am not a user of the Enterprise Library so I can not speak to the specifics of that. However, here is a short sample that is based on the information you've provided. Perhaps it will be useful.
    Database:
    create table profiles
      profileid integer not null,
      userid    integer not null,
      profile   raw(255)
    create or replace procedure addprofile
      p_profileid in integer,
      p_userid    in integer,
      p_profile   in raw
    as
    begin
      insert into
        profiles (profileid, userid, profile)
        values (p_profileid, p_userid, p_profile);
    end;
    /C# code:
    using System;
    using System.Data;
    using System.Text;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    namespace HarshTest
      /// <summary>
      /// Summary description for Class1.
      /// </summary>
      class Class1
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
          // connect to local db using o/s authentication
          OracleConnection con = new OracleConnection("User ID=/; Pooling=False");
          con.Open();
          // create command object and set properties
          OracleCommand cmd = new OracleCommand();
          cmd.Connection = con;
          cmd.CommandText = "ADDPROFILE";
          cmd.CommandType = CommandType.StoredProcedure;
          // parameter object for profileid
          OracleParameter p_profileid = new OracleParameter();
          p_profileid.OracleDbType = OracleDbType.Int32;
          p_profileid.Value = 1;
          p_profileid.Direction = ParameterDirection.Input;
          // parameter object for userid
          OracleParameter p_userid = new OracleParameter();
          p_userid.OracleDbType = OracleDbType.Int32;
          p_userid.Value = 1;
          p_userid.Direction = ParameterDirection.Input;
          // create a byte array for the raw value
          ASCIIEncoding encoder = new ASCIIEncoding();
          byte[] byteArray = encoder.GetBytes("TestProfile");
          // parameter object for profile
          OracleParameter p_profile = new OracleParameter();
          p_profile.OracleDbType = OracleDbType.Raw;
          p_profile.Value = byteArray;
          p_profile.Direction = ParameterDirection.Input;
          // add parameters to collection
          cmd.Parameters.Add(p_profileid);
          cmd.Parameters.Add(p_userid);
          cmd.Parameters.Add(p_profile);
          // execute the stored procedure
          try
            cmd.ExecuteNonQuery();
          catch (OracleException ex)
            Console.WriteLine(ex.Message);
          // clean up objects
          p_profile.Dispose();
          p_userid.Dispose();
          p_profileid.Dispose();
          cmd.Dispose();
          con.Dispose();
    }Maybe the part about creating the byte array is what you are missing...
    - Mark

  • Numeric or value error: character string buffer too small

    Hi,
    I have no problem with this code :
    select htmldb_item.text(3,nom,20) nom,
    htmldb_item.select_list_from_query(9,v_urba_rue.ref_fantoir,'select distinct(nom_voie),v_urba_rue.ref_fantoir from adresse,v_urba_rue where adresse.ref_fantoir(+)=v_urba_rue.ref_fantoir and ref_commune=20 and v_urba_rue.ref_fantoir between 1280 and 1370') rue
    from personne,participe,adresse,v_urba_rue
    where ...
    but when i modify :
    ...and v_urba_rue.ref_fantoir between 1280 and 1400') rue...
    i have this error :
    ORA-06502 PL/SQL: numeric or value error: character string buffer too small
    any solution?
    thank you very much

    Is this the same posting as
    ORA-06502 numeric or value error string

  • Numeric or value error

    I've got a question that hopefully I can ask here. I am working on a VB.Net windows application using the System.Data.Oracle client.
    I am trying to call one of our Oracle Package procedures we have. One of the parameters to the procedure is defined as a NUMBER. This parameter is later being stored into a variable that is defined as a NUMBER(7,6).
    The program is passing in a value of 9.999999 to this parameter which then produces the error "ORA-06502: PL/SQL: numeric or value error: number precision too large" when it tries to put the input parameter into the variable.
    Under VB6 using ADO calling this same procedure with the same data works fine.
    Does anyone know why this does not work under ADO.NET?

    Disregard this plea for help... I found my problem. I mistakenly set the parameter for the procedure call to an Int32 instead of to a Double (or Single). Strange I would have thought this would have given me the error just in calling the procedure and not give me an error of the procedure internal in setting the variable.

  • Numeric or value error: character to number conversion error

    I'm having problems inserting a value from a date picker field (DD-MON-YYYY HH MI )
    i'm submitting this value to a packaged procedure that accepts this field as VARCHAR2 .
    on the insert, i do a to_date( P_DATE, 'DD-MON-YYYY HH:MI PM' )
    and i get the numeric conversion error.
    If I change the to_date on the procedure side, I get the :could not read the end of the format mask - which I've found threads about on this site.
    I've tried using HH24 and different formats, but I get one of the two above errors on the insert.
    If I don't fill in the datepicker field at all, it works fine.
    help is appreciated !
    Bill

    Here is the trace anyway:
    *** ACTION NAME:(application 4000, page 1) 2004-09-24 12:58:44.052
    *** MODULE NAME:(HTML DB) 2004-09-24 12:58:44.052
    *** SERVICE NAME:(TOPS) 2004-09-24 12:58:44.052
    *** SESSION ID:(151.1) 2004-09-24 12:58:44.052
    *** 2004-09-24 12:58:44.052
    ksedmp: internal or fatal error
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Current SQL statement for this session:
    declare
    rc__ number;
    begin
    owa.init_cgi_env(:n__,:nm__,:v__);
    htp.HTBUF_LEN := 255;
    null;
    null;
    null;
    null;
    f(p=>:p);
    if (wpg_docload.is_file_download) then
    rc__ := 1;
    wpg_docload.get_download_file(:doc_info);
    null;
    null;
    null;
    commit;
    else
    rc__ := 0;
    null;
    null;
    null;
    commit;
    owa.get_page(:data__,:ndata__);
    end if;
    :rc__ := rc__;
    end;
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    6A3C4A00 532 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A3C4A00 2502 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A3C4A00 2748 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A0E63C8 991 package body FLOWS_010500.WWV_FLOW_FORMS
    6A11675C 932 package body FLOWS_010500.WWV_FLOW_DISP_PAGE_PLUGS
    6A11675C 247 package body FLOWS_010500.WWV_FLOW_DISP_PAGE_PLUGS
    6A4B54E0 8341 package body FLOWS_010500.WWV_FLOW
    6A2A99F0 102 procedure FLOWS_010500.F
    6A2B9E54 10 anonymous block
    ----- Call Stack Trace -----
    calling call entry argument values in hex
    location type point (? means dubious value)
    ksedmp+524          CALLrel  ksedst+0 1
    ksedmptracecb+15 CALLrel _ksedmp+0            C
    _ksddoa+118          CALLreg  00000000             C
    ksdpcg+143          CALLrel  ksddoa+0
    ksdpec+180          CALLrel  ksdpcg+0 1966 6D7D208 1
    __PGOSF3__ksfpec+11 CALLrel _ksdpec+0            0
    8
    _kgerev+77           CALLreg  00000000             7474210 1966
    kgerec1+18          CALLrel  kgerev+0 7474210 6DCE5EC 1966 1
    6D7D260
    peirve+465          CALLrel  kgerec1+0
    pevmCVTCN+346 CALLrel _peirve+0           
    pfrinstrCVTCN+36 CALLrel pevmCVTCN+0 6E6E604 71CE370 7160F0C
    pfrrunno_tool+51 CALL??? 00000000
    pfrrun+1834         CALLrel  pfrrun_no_tool+0 6E6E604 6A3C010A 6E6E640
    plsqlrun+1051 CALLrel _pfrrun+0            6E6E604
    peicnt+179          CALLrel  plsql_run+0 6E6E604 1 0
    kkxexe+477          CALLrel  peicnt+0
    opiexe+4896         CALLrel  kkxexe+0 6A2B9E54
    kpoal8+1705         CALLrel  opiexe+0 49 3 6D7E06C
    _opiodr+977          CALLreg  00000000             5E 14 6D7E7CC
    _ttcpip+1827         CALLreg  00000000             5E 14 6D7E7CC 0
    _opitsk+1098         CALL???  00000000            
    opiino+938          CALLrel  opitsk+0 0 0 747ABC0 6DEFB14 D8 0
    _opiodr+977          CALLreg  00000000             3C 4 6D7FBBC
    opidrv+479          CALLrel  opiodr+0 3C 4 6D7FBBC 0
    sou2o+45            CALLrel  opidrv+0 3C 4 6D7FBBC
    opimai+237          CALLrel  sou2o+0
    OracleThreadStart@  CALLrel  opimai+0
    4+899
    77E7D338 CALLreg 00000000

  • Numeric or value error when Attribute Usage Retrieve is set to Yes

    When using the Business Rule Design Transformer in Headstart Utilities a Numeric or value error occurs when one of the attribute usages of an entity has the operation Retrieve set to Yes.

    Sandra,
    Thanks for your quick response!
    The following debug detail info is logged:
    -- START --
    Transformation of Business Rule BR_3ARE1007_CEV.
    Determine rule type for BR_3ARE1007_CEV.
    BR_3ARE1007_CEV is change event with DML.
    Stage 1: Populate in memory table with all triggering tables and columns.
    Triggering event CREATE ARTICLE found.
    Checking attribute usages for business rule 724784 and entity 720389
    Attribute: PRIORITY
    Column is:
    Checking relationship usages for business rule 724784 and entity 720389
    Stage 2: loop over all tables found and create BRDD.
    ...Create BRDD for table XPS_ARTICLES.
    hsu_capi.find_plm
    Business Rule Design Definition for BR_3ARE1007_CEV
    Activity aborted with ORACLE internal errors.
    -6502 ORA-06502: PL/SQL: numeric or value error
    -- END --
    If you want to reproduce the problem use the following data:
    EVENT:
    Name = CREATE test
    Type = Change
    On condition = CREATE
    Entity = test
    BUSINESS FUNCTION <BR_..>
    Triggered by = Above event
    Using entities = test
    Using attributes = test_att
    Retrieve? = Yes
    This should create the error...

  • Numeric or value error when submitting form

    I have a form based of a stored procedure. The form has about 20 fields on it. For some reason the form only allows data entry on only about 10 of them. If I put data in any of the other 10, I get: "An unexpected error occurred: ORA-06502: PL/SQL: numeric or value error (WWV-16016)"
    I have looked everywhere to see what's going on. I checked the procedure to make sure its parameters are good. It takes takes all VARCHAR2's, so thats OK. I checked the fields in the form editor for validation, and none are being validated, so thats OK. I made sure all the fields are updatable and they are. I even checked the table to make sure that the data can go into the fields, even though I know that the error returned there would be through the procedure, not Portal. I am stumped. What am I missing?
    Rich

    Follow Up: While troubleshooting this, I filled in all the fields with one character each and the form submitted. I added characters little by little to each field until I got the error. It seems like Portal has a problem when I pass X amount of characters from a form. I say "Portal" because I thought this might be an OS parameter, but I get the same error in both Win2000 and Solaris.
    Any ideas where this setting is? Or how to change it?
    Rich

  • Error:numeric or value error : buffer too small

    hi
    can any one please help me?
    i am developing the application in HTMLDB. i have an error numeric or value error: char buffer too small.
    i have an attributes plan_name,type......att_header1 in the database. The data's were inserted to the database, without the att_header item but if i have the item att_header int the HTMLDB then the insertion is not working. and also i was able to insert the data into the database for the field att_header1 through sql command . i think the problem is onle in my HTMLDB application.
    please tell me the solution for this error.
    thanx in advance
    valli
    Message was edited by:
    valli

    Valli,
    I don't think you understood my post, above:
    Can you please create an application that shows the problem on apex.oracle.com? Then we'll be able to see all your code together with the database tables, etc.
    If you do not have a workspace you can request one.
    Please request a workspace on apex.oracle.com. After your workspace request is approved, create an application there that shows this problem you are having. Create the necessary tables, packages, and other database objects in the database to support the example.
    As the last step, post here the workspace name, the application ID, and detailed instructions explaining how to use your application to demonstrate the problem.
    Scott

Maybe you are looking for

  • Time-out problems with RV320 (after upgrade from RV042)

    config: dual wan WAN1: 4G router (DHCP) - approx 25Mbit/ 8Mbit WAN2: PPOE (DSL) - 1 Mbit/ 0.2 Mbit worked with a RV042 before and upgraded to a RV320 now. all other things are unchanged. 3 problems - 2 solved/ not critical - one still open: a) not cr

  • Alternative payee for ATI "Temporary Allocation of Companies" group

    Hey everybody, May you please help me to define a solution to handle the following situation? There are many ATI group vendors, each of them is constituted by one assignee, different invoicing parties and one payment recipient corresponding to the as

  • Database connectivity in struts ( EJB) with Oracle 9

    hi, We are developing a Banking application using Struts & EJB, & I need to use Oracle 9 as a database. Could anyone please let me know, the professional way of connecting this application to the oracle database using Struts and EJB. A good example w

  • Need Urgent Help... Essbase service is stopping automatically

    Hello All, In our production box essbase service is stopping automatically. Can you please help me to resolve this issue... OS : Windows Server 2003 Hyperion : 11.1.1.3 SharedServices_Security_Client.log 2013-12-09 01:17:25,609 INFO  [main] CSS is in

  • P.O automatic mail genration pdf to word/text.

    Hi  everyone, this is regarding the automatic mail generation in smartforms. Its like when you process the smartforms the mails are automatically shooted to the address maintained for eg usually to the vendors. So what I need is incase I proces my sm