ORA-06502

Gurus,
Can you please clarify me this ...
I have created a procedure and I am calling from the form ... Now the problem is, when I am calling the procedure from the form I am getting error *"ORA-6502 PL/SQL numeric or value error"* ... For this procedure, there are two input and 8 output parameters ... I have checked data types and sizes of input and output parameters. They are matching, yet I am getting error ...
That procedure when I am executing at the back end, its working perfectly ...
Another thing, what I did is I have declared another output parameter both in the Form as well as back end .. In the procedure (back end), for every select statement, I am passing some value like 'test1', 'test2', etc., .. I have displayed using message function the input parameters too .. They are going correct ...Once the input parameters are displayed, I am getting error .. I feel that the control is not going into the procedure ..
Please suggest the solution
Earliest suggestion is appreciated
Regards

Pasting the code below .. Let me know where am I going wrong
Form Level
================
Declare
L_user          VARCHAR2(30);
L_order_no          NUMBER(8);
L_role          VARCHAR2(20);
L_app_check      VARCHAR2(1);
Lv_app_check      NUMBER(1);
Lv_otb_check      NUMBER(1);
L_amt          NUMBER(5);
L_list          VARCHAR2(255);
L_err_msg          VARCHAR2(1);
L_var           VARCHAR2(100);
Begin
AFE_CHECK_SUBMIT(L_user,l_order_no,L_role,L_app_check,Lv_app_check,Lv_otb_check,L_amt,L_list,L_err_msg,L_error_message,L_var);
End;
Procedure
=========
PROCEDURE AFE_CHECK_SUBMIT (I_u_id IN VARCHAR2,
               I_ord_num IN NUMBER,
               O_rol OUT VARCHAR2,
               O_app_check OUT Varchar2,
               O_v_app_check OUT NUMBER,
               O_v_otb_check OUT NUMBER,
               O_amt OUT NUMBER,
               O_list OUT VARCHAR2,
               O_err_msg OUT VARCHAR2,
               O_error_message IN OUT varchar2,
               O_var OUT VARCHAR2 ) IS
Now the declaration of the form and procedure is the same .. Including the data types .. Now can you suggest me, where am i going wrong ?
Tell me one thing .. Whatever the Output parameters which are declared, I amnt declaring those variables in the package, I am directly initializing the values .. Since the size isnt defined, is it causing any error ?
Regards
Edited by: Seshu on Aug 25, 2008 3:25 AM
Edited by: Seshu on Aug 25, 2008 3:32 AM

Similar Messages

  • ORA-06502 on "Help Text" region when changing pages on a tabular form

    Hello everybody,
    We are developing an application on Apex 4.1.0.00.32. This application have some pages with tabular forms and these pages uses a page zero as template. In this page zero, we have added two sidebar regions: a list region to navigate on the application and a help text to describe how to use our application.
    The problem occurs when the tabular split the records into pages (since it has more records that it can show on a single page). When the user clicks to change to another page, Apex raises an ORA-06502: PL/SQL: numeric or value error as described below:
    Erro ao renderizar a região "Ajuda". ORA-06502: PL/SQL: erro: erro de conversão de caractere em número numérico ou de valor
    Informações Técnicas (visível somente para desenvolvedores)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -6502
    ora_sqlerrm: ORA-06502: PL/SQL: erro: erro de conversão de caractere em número numérico ou de valor
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 2
    component.name: Ajuda
    error_backtrace:
    ORA-06512: em "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 3654
    ORA-06512: em "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 4204
    Obs: Our database is in Brazilian Portuguese, so I guess it will be hard for some people to understand the first two lines! :)
    We have tried to change the pagination style of the tabular form and change the region model of the help text but the problem still happens.
    Does anyone an ideia about what this may be?
    Thanks in advance!

    I am getting the exact same message, to the line number, also in APEX 4.1.0.0.32.
    Occurs when changing pages in a classic report, Standard region template, select list pagination, when selecting a different pagination set.
    In English:
    Error during rendering of region "Matched Participants Help & Hints".
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -6502
    ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 2
    component.name: <strong>Matched Participants</strong> Help & Hints
    error_backtrace:
    ORA-06512: at "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 3654
    ORA-06512: at "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 4204
    There are no conditions on the region, and no date string within the Help text. Some HTML <strong> tags, that's it.
    The Help region renders fine the first time.
    The Debug info does not help any:
    3.798360.00062Computation point: After Box Body4
    0
    3.798990.00081Processes - point: AFTER_BOX_BODY4
    0
    3.799790.00068Region: <strong>Matched Participants</strong> Help & Hints4
    0
    3.800470.00213Region rendered dynamically because request was not null4
    0
    3.802590.00096Add error onto error stack4
    0
    3.803550.00084...Error data:4
    0
    3.804400.00084......message: Error during rendering of region "<strong>Matched Participants</strong> Help & Hints".4
    0
    3.805240.00084......additional_info: ORA-06502: PL/SQL: numeric or value error: character to number conversion error4
    0
    3.806080.00081......display_location: ON_ERROR_PAGE4
    0
    3.806890.00081......is_internal_error: true4
    0
    3.807700.00084......apex_error_code: APEX.REGION.UNHANDLED_ERROR4
    0
    3.808540.00082......ora_sqlcode: -65024
    0
    3.809350.00234......ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number conversion error4
    0
    3.811700.00082......error_backtrace: ORA-06512: at "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 3654 ORA-06512: at "APEX_040100.WWV_FLOW_DISP_PAGE_PLUGS", line 4204 4
    0
    3.812510.00081......component.type: APEX_APPLICATION_PAGE_REGIONS4
    0
    3.813310.00110......component.id: 24
    0
    3.814420.00099......component.name: <strong>Matched Participants</strong> Help & Hints4
    0
    3.815400.00076...Show Error on Error Page4
    0
    3.816160.00344......Performing rollback4
    0
    3.819610.00225Processes - point: AFTER_ERROR_HEADER4
    0
    3.821850.00268Processes - point: BEFORE_ERROR_FOOTER4
    0
    3.82453-End Page Rendering
    Any thoughts on where to poke around for this one?
    Thanks - Karen

  • ORA-06502 error after SSO login

    Hi all.
    In our intranet i'm trying to use the AS 10g SSO
    as authentication with my HTML DB application.
    HTML DB is into a 9.2.0.4 database in a Alpha open VMS server.
    AS 10g infrastructure and AS 10g mid-tier on two difference Linux RedHat AS 2.1 servers.
    Infrastructure server: http://giedi.marinarinaldi.it:7779
    Mid-tier server: http://si.marinarinaldi.it:7778
    HTML DB application: http://si.marinarinaldi.it:7778/pls/htmldbSVIL/f?p=106:1
    I followed the related how-to document
    and the SSO login page shows correctly
    but when i click "login":
    Error     Error determining caller of process_success:l_owner::p_partner_app_name:HTML_DB Please contact administrator.
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    The SSO logi page is a our custom login page
    but it works perfectly with portal.
    The SSO partner application parameters:
    ID:     97F428BC
    Token:     4PW44GF797F428BC
    Encryption Key:     12E3971BE26C4E5D
    Login URL:     http://giedi.marinarinaldi.it:7779/pls/orasso/orasso.wwsso_app_admin.ls_login
    Single Sign-Off URL:     http://giedi.marinarinaldi.it:7779/pls/orasso/orasso.wwsso_app_admin.ls_logout
    Name:     HTML_DB
    Home URL: http://si.marinarinaldi.it:7778/pls/htmldbSVIL/f?p=106:1
    Success URL: http://si.marinarinaldi.it:7778/pls/htmldbSVIL/wwv_flow_custom_auth_sso.process_success
    Logout URL: http://si.marinarinaldi.it:7778/pls/htmldbSVIL/htmldb
    The parameters of regapp.sql script on the Alpha HTMLDB database:
    Enter value for listener_token: HTML_DB:si.marinarinaldi.it:7778
    Enter value for site_token: 4PW44GF797F428BC
    Enter value for site_id: 97F428BC
    Enter value for login_url: http://giedi.marinarinaldi.it:7779/pls/orasso/orasso.
    wwsso_app_admin.ls_login
    Enter value for cookie_version: v1.0
    Enter value for encryption_key: 12E3971BE26C4E5D
    Enter value for ip_check: N
    Thank you all in advance for help.

    SQL> select * from WWSEC_SSO_LOG$;
    1
    entry: papp_show_config
    05-AUG-04
    2
    IN papp_show_config: after the select.
    05-AUG-04
    3
    site name is 4PW44GF797F428BC
    05-AUG-04
    4
    exit: papp_show_config
    05-AUG-04
    5
    entry: urlencode
    05-AUG-04
    6
    encoded URL is http%3A%2F%2Fsi.marinarinaldi.it%3A7778%2Fpls%2FhtmldbSVIL%2Ff%3F
    p%3D106%3A1%3A6300852000501899701
    05-AUG-04
    7
    exit: urlencode
    05-AUG-04
    8
    entry: urlencode
    05-AUG-04
    9
    encoded URL is http%3A%2F%2Fsi.marinarinaldi.it%3A7778
    05-AUG-04
    10
    exit: urlencode
    05-AUG-04
    11
    entry: encrypt_url_cookie
    05-AUG-04
    12
    Before bake_site2pstore_token: listener token: HTML_DB:si.marinarinaldi.it:7778u
    rlcookie_version: v1.0papp_url_cookie: http%3A%2F%2Fsi.marinarinaldi.it%3A7778%2
    Fpls%2FhtmldbSVIL%2Ff%3Fp%3D106%3A1%3A6300852000501899701~http%3A%2F%2Fsi.marina
    rinaldi.it%3A7778enabler_config.site_token: 4PW44GF797F428BCkey: 12E3971BE26C4E5
    D
    05-AUG-04
    13
    entry: bake_site2pstore_token
    05-AUG-04
    14
    entry get_enabler_config
    05-AUG-04
    15
    site token is 4PW44GF797F428BC
    05-AUG-04
    16
    exit: get_enabler_config
    05-AUG-04
    17
    In hash string. Input is 308-05-2004 10:06:52
    05-AUG-04
    18
    In hash string. Input is ud)xc`8L`GJd~4PW44GF797F428BC~20040805100652~http%3A%2F
    %2Fsi.marinarinaldi.it%3A7778%2Fpls%2FhtmldbSVIL%2Ff%3Fp%3D106%3A1%3A63008520005
    01899701~http%3A%2F%2Fsi.marinarinaldi.it%3A7778
    05-AUG-04
    19
    temp site2pstoretoken is :ud)xc`8L`GJd~4PW44GF797F428BC~20040805100652~http%3A%2
    F%2Fsi.marinarinaldi.it%3A7778%2Fpls%2FhtmldbSVIL%2Ff%3Fp%3D106%3A1%3A6300852000
    501899701~http%3A%2F%2Fsi.marinarinaldi.it%3A7778~5169F5D95694EE7F4EEC7D80056B56
    A5
    05-AUG-04
    20
    entry: encrypt_des
    05-AUG-04
    21
    Key is: 12E3971BE26C4E5D
    05-AUG-04
    22
    before rpad
    05-AUG-04
    23
    pre mask: 503504C465CC51FDD7EBB62850973AF1503504C465CC51FDD7EBB62850973AF1503504
    C465CC51FDD7EBB62850973AF1503504C465CC51FDD7EBB62850973AF1503504C465CC51FDD7EBB6
    2850973AF1503504C465CC51FDD7EBB62850973AF1503504C465CC51FDD7EBB628
    05-AUG-04
    24
    post mask: 45FBB10E9AABB801ABAC1C861EBF9AE645FBB10E9AABB801ABAC1C861EBF9AE645FBB
    10E9AABB801ABAC1C861EBF9AE645FBB10E9AABB801ABAC1C861EBF9AE645FBB10E9AABB801ABAC1
    C861EBF9AE645FBB10E9AABB801ABAC1C861EBF9AE645FBB10E9AABB801ABAC1C86
    05-AUG-04
    25
    exit: bake_site2pstore_token
    05-AUG-04
    26
    After bake_site2_pstore_token. Value is: C061F10FBDDAACCB4A5B536D036656AF013D33B
    17261B66BD9C46A02004CF08081B0EB68834FA1594884A2088A6E1829A35EEA97ECF7B0F9B728B60
    B7DDEFEC846EA96CDB4208783B26F7DE976B3E7912554A8FA2B383EBF0C4221858C88B10A00A2789
    65C85703BEF6C3C1E3F069FF9C41059B5982CBADB7F662D481C9812EBCD7B44A7E24819CD152BB29
    9F2B40F08138F7DAE05BCC58CF87FECFA89B1BEE195FB2A314699AA2C8D406AC52FCE4F5B6DCE910
    A4B31714D99918BEC39E3E067BE031F5E9DF031192064B1ECAE0B100775AD76EF4D478844
    05-AUG-04
    27
    Redirect URL generated is : http://giedi.marinarinaldi.it:7779/pls/orasso/orasso
    .wwsso_app_admin.ls_login?site2pstoretoken=v1.0~97F428BC~C061F10FBDDAACCB4A5B536
    D036656AF013D33B17261B66BD9C46A02004CF08081B0EB68834FA1594884A2088A6E1829A35EEA9
    7ECF7B0F9B728B60B7DDEFEC846EA96CDB4208783B26F7DE976B3E7912554A8FA2B383EBF0C42218
    58C88B10A00A278965C85703BEF6C3C1E3F069FF9C41059B5982CBADB7F662D481C9812EBCD7B44A
    7E24819CD152BB299F2B40F08138F7DAE05BCC58CF87FECFA89B1BEE195FB2A314699AA2C8D406AC
    52FCE4F5B6DCE910A4B31714D99918BEC39E3E067BE031F5E9DF031192064B1ECAE0B100775AD76E
    F4D478844
    05-AUG-04

  • Java.sql.SQLException: ORA-06502: PL/SQL in EBS R12

    Hi everyone,
    May you please help me diagnose the problem.
    Oracle EBS 12.0.0.6, DB(10.2.0.3) on one machine and App(forms, concurrent manager, etc) on other machine, both AIX 5.3.
    I have following failed concurrent request:
    *====================================================*
    Payables: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    APPPBR module: AP Prepayment Balance Report
    Current system time is 12-MAY-2010 15:33:36
    XDO Data Engine Version No: 5.6.3
    Resp: 50661
    Org ID : 81
    Request ID: 449826
    All Parameters: ORG_ID_PARAM=81:COA_ID_PARAM=50328:FROM_DATE_PARAM="2010/05/12 00:00:00":TO_DATE_PARAM=:PERIOD_FROM_PARAM=JUL-09:PERIOD_TO_PARAM=MAY-
    10:CURR_CODE_PARAM=:ACCOUNT_FROM_PARAM=:ACCOUNT_TO_PARAM=:SUPPLIER_FROM_PARAM=Adel Bin Abdullah Bin Taha Al
    Hadad:SUPPLIER_TO_PARAM=:PAID_ONLY_PARAM=:POSTED_ONLY_PARAM=:DUMMY_PARAM=2
    Data Template Code: APPPBR
    Data Template Application Short Name: SQLAP
    Debug Flag: N
    {ORG_ID_PARAM=81, PERIOD_FROM_PARAM=JUL-09, CURR_CODE_PARAM=, DUMMY_PARAM=2, PAID_ONLY_PARAM=, PERIOD_TO_PARAM=MAY-10, POSTED_ONLY_PARAM=,
    ACCOUNT_FROM_PARAM=, SUPPLIER_FROM_PARAM=Adel Bin Abdullah Bin Taha Al Hadad, SUPPLIER_TO_PARAM=, TO_DATE_PARAM=, ACCOUNT_TO_PARAM=,
    FROM_DATE_PARAM=2010/05/12 00:00:00, COA_ID_PARAM=50328}
    Calling XDO Data Engine...
    [051210_033341921][][STATEMENT] Start process Data
    [051210_033341922][][STATEMENT] Process Data ...
    [051210_033341924][][STATEMENT] Executing data triggers...
    [051210_033341924][][STATEMENT] BEGIN
    AP_BAL_PKG.ORG_ID_PARAM := :ORG_ID_PARAM ;
    AP_BAL_PKG.COA_ID_PARAM := :COA_ID_PARAM ;
    AP_BAL_PKG.FROM_DATE_PARAM := :FROM_DATE_PARAM ;
    AP_BAL_PKG.TO_DATE_PARAM := :TO_DATE_PARAM ;
    AP_BAL_PKG.PERIOD_FROM_PARAM := :PERIOD_FROM_PARAM ;
    AP_BAL_PKG.PERIOD_TO_PARAM := :PERIOD_TO_PARAM ;
    AP_BAL_PKG.CURR_CODE_PARAM := :CURR_CODE_PARAM ;
    AP_BAL_PKG.ACCOUNT_FROM_PARAM := :ACCOUNT_FROM_PARAM ;
    AP_BAL_PKG.ACCOUNT_TO_PARAM := :ACCOUNT_TO_PARAM ;
    AP_BAL_PKG.SUPPLIER_FROM_PARAM := :SUPPLIER_FROM_PARAM ;
    AP_BAL_PKG.SUPPLIER_TO_PARAM := :SUPPLIER_TO_PARAM ;
    AP_BAL_PKG.PAID_ONLY_PARAM := :PAID_ONLY_PARAM ;
    AP_BAL_PKG.POSTED_ONLY_PARAM := :POSTED_ONLY_PARAM ;
    AP_BAL_PKG.DUMMY_PARAM := :DUMMY_PARAM ;
    :XDO_OUT_PARAMETER := 1;
    END;
    [051210_033341927][][STATEMENT] 1:81 :
    [051210_033341928][][STATEMENT] 2:50328 :
    [051210_033341928][][STATEMENT] 3:2010/05/12 00:00:00 :
    [051210_033341928][][STATEMENT] 4: :
    [051210_033341928][][STATEMENT] 5:JUL-09 :
    [051210_033341928][][STATEMENT] 6:MAY-10 :
    [051210_033341928][][STATEMENT] 7: :
    [051210_033341928][][STATEMENT] 8: :
    [051210_033341928][][STATEMENT] 9: :
    [051210_033341928][][STATEMENT] 10:Adel Bin Abdullah Bin Taha Al Hadad :
    [051210_033341928][][STATEMENT] 11: :
    [051210_033341928][][STATEMENT] 12: :
    [051210_033341929][][STATEMENT] 13: :
    [051210_033341929][][STATEMENT] 14:2 :
    [051210_033341940][][EXCEPTION] SQLException encounter while executing data trigger....
    java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 11
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
         at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:965)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3445)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4395)
         at oracle.apps.xdo.dataengine.XMLPGEN.executeTriggers(XMLPGEN.java:650)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:262)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:348)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 449826 on node EBSCL1 at 12-MAY-2010 15:33:42.
    Post-processing of request 449826 failed at 12-MAY-2010 15:33:42 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 12-MAY-2010 15:33:42
    *====================================================*
    When I look at OPP Log, following is the info:
    *====================================================*
    [5/12/10 3:33:42 PM] [OPPServiceThread0] Post-processing request 449826.
    [5/12/10 3:33:42 PM] [28164:RT449826] Executing post-processing actions for request 449826.
    [5/12/10 3:33:42 PM] [28164:RT449826] Starting XML Publisher post-processing action.
    [5/12/10 3:33:42 PM] [28164:RT449826]
    Template code: APPPBR
    Template app: SQLAP
    Language: en
    Territory: US
    Output type: RTF
    [5/12/10 3:33:42 PM] [UNEXPECTED] [28164:RT449826] java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:615)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeParse(XSLT10gR1.java:517)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:224)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:177)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1044)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:997)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:212)
         at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1665)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:975)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5926)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3458)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3547)
         at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:259)
         at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:172)
    Caused by: oracle.xdo.parser.v2.XMLParseException: Start of root element expected.
         at oracle.xdo.parser.v2.XMLError.flushErrors1(XMLError.java:337)
         at oracle.xdo.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:343)
         at oracle.xdo.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:285)
         at oracle.xdo.parser.v2.XMLParser.parse(XMLParser.java:289)
         ... 17 more
    [5/12/10 3:33:42 PM] [28164:RT449826] Completed post-processing actions for request 449826.
    *====================================================*
    Br,
    Anjum

    Hi,
    It seems like a bug as per metalink note:
    APPPBR : AP Prepayment Balance Report Error Out java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 11 [ID 827325.1]
    Anyway, if you have any relevant information, please share.
    Br,
    Anjum

  • Large DDL causes ORA-06502 in several Applications

    I Created a Table with
    CREATE TABLE large_table (
    c001 VARCHAR(2) NOT NULL
    and added columns with
    ALTER TABLE large_table ADD c002 VARCHAR(2) NOT NULL;
    ALTER TABLE large_table ADD c060 VARCHAR(2) NOT NULL;
    The DDL of this table cannot be executed eg. in SqlDeveloper, sqlplus, ... and it cannot be imported from a dump with exp! Importing causes:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set
    . importing RLODEVEL's objects into RLODEVEL
    . importing RLODEVEL's objects into RLODEVEL
    IMP-00017: following statement failed with ORACLE error 604:
    "CREATE TABLE "LARGE_TABLE" ("C001" VARCHAR2(2) NOT NULL ENABLE, "C002" VARC"
    "HAR2(2) NOT NULL ENABLE, "C003" VARCHAR2(2) NOT NULL ENABLE, "C004" VARCHAR"
    "2(2) NOT NULL ENABLE, "C005" VARCHAR2(2) NOT NULL ENABLE, "C006" VARCHAR2(2"
    ") NOT NULL ENABLE, "C007" VARCHAR2(2) NOT NULL ENABLE, "C008" VARCHAR2(2) N"
    "OT NULL ENABLE, "C009" VARCHAR2(2) NOT NULL ENABLE, "C010" VARCHAR2(2) NOT "
    "NULL ENABLE, "C011" VARCHAR2(2) NOT NULL ENABLE, "C012" VARCHAR2(2) NOT NUL"
    "L ENABLE, "C013" VARCHAR2(2) NOT NULL ENABLE, "C014" VARCHAR2(2) NOT NULL E"
    "NABLE, "C015" VARCHAR2(2) NOT NULL ENABLE, "C016" VARCHAR2(2) NOT NULL ENAB"
    "LE, "C017" VARCHAR2(2) NOT NULL ENABLE, "C018" VARCHAR2(2) NOT NULL ENABLE,"
    " "C019" VARCHAR2(2) NOT NULL ENABLE, "C020" VARCHAR2(2) NOT NULL ENABLE, "C"
    "021" VARCHAR2(2) NOT NULL ENABLE, "C022" VARCHAR2(2) NOT NULL ENABLE, "C023"
    "" VARCHAR2(2) NOT NULL ENABLE, "C024" VARCHAR2(2) NOT NULL ENABLE, "C025" V"
    "ARCHAR2(2) NOT NULL ENABLE, "C027" VARCHAR2(2) NOT NULL ENABLE, "C026" VARC"
    "HAR2(2) NOT NULL ENABLE, "C028" VARCHAR2(2) NOT NULL ENABLE, "C029" VARCHAR"
    "2(2) NOT NULL ENABLE, "C030" VARCHAR2(2) NOT NULL ENABLE, "C031" VARCHAR2(2"
    ") NOT NULL ENABLE, "C032" VARCHAR2(2) NOT NULL ENABLE, "C033" VARCHAR2(2) N"
    "OT NULL ENABLE, "C034" VARCHAR2(2) NOT NULL ENABLE, "C035" VARCHAR2(2) NOT "
    "NULL ENABLE, "C036" VARCHAR2(2) NOT NULL ENABLE, "C037" VARCHAR2(2) NOT NUL"
    "L ENABLE, "C038" VARCHAR2(2) NOT NULL ENABLE, "C039" VARCHAR2(2) NOT NULL E"
    "NABLE, "C040" VARCHAR2(2) NOT NULL ENABLE, "C041" VARCHAR2(2) NOT NULL ENAB"
    "LE, "C042" VARCHAR2(2) NOT NULL ENABLE, "C043" VARCHAR2(2) NOT NULL ENABLE,"
    " "C044" VARCHAR2(2) NOT NULL ENABLE, "C045" VARCHAR2(2) NOT NULL ENABLE, "C"
    "046" VARCHAR2(2) NOT NULL ENABLE, "C047" VARCHAR2(2) NOT NULL ENABLE, "C048"
    "" VARCHAR2(2) NOT NULL ENABLE, "C049" VARCHAR2(2) NOT NULL ENABLE, "C050" V"
    "ARCHAR2(2) NOT NULL ENABLE, "C051" VARCHAR2(2) NOT NULL ENABLE, "C052" VARC"
    "HAR2(2) NOT NULL ENABLE, "C053" VARCHAR2(2) NOT NULL ENABLE, "C054" VARCHAR"
    "2(2) NOT NULL ENABLE, "C055" VARCHAR2(2) NOT NULL ENABLE, "C056" VARCHAR2(2"
    ") NOT NULL ENABLE, "C057" VARCHAR2(2) NOT NULL ENABLE, "C058" VARCHAR2(2) N"
    "OT NULL ENABLE, "C059" VARCHAR2(2) NOT NULL ENABLE, "C060" VARCHAR2(2) NOT "
    "NULL ENABLE) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL"
    " 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS"
    "" LOGGING NOCOMPRESS"
    IMP-00003: ORACLE error 604 encountered
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 25
    Import terminated successfully with warnings.
    I'm quite sure, this problem is well known, but I did not find a hint in metalink or the rest of the internet.

    Sorry, the example has not been tested well :(
    But I just had to duplicate the number of columns to get the error both in SqlDeveloper, SqlPlus and (still) imp. That sqlplus and imp have different limits in DDL-size confuses me even more :-/
    CREATE TABLE LARGE_TABLE (
    C001 VARCHAR2(2) NOT NULL , C002 VARCHAR2(2) NOT NULL , C003 VARCHAR2(2) NOT NULL , C004 VARCHAR2(2) NOT NULL ,
    C005 VARCHAR2(2) NOT NULL , C006 VARCHAR2(2) NOT NULL , C007 VARCHAR2(2) NOT NULL , C008 VARCHAR2(2) NOT NULL ,
    C009 VARCHAR2(2) NOT NULL , C010 VARCHAR2(2) NOT NULL , C011 VARCHAR2(2) NOT NULL , C012 VARCHAR2(2) NOT NULL ,
    C013 VARCHAR2(2) NOT NULL , C014 VARCHAR2(2) NOT NULL , C015 VARCHAR2(2) NOT NULL , C016 VARCHAR2(2) NOT NULL ,
    C017 VARCHAR2(2) NOT NULL , C018 VARCHAR2(2) NOT NULL , C019 VARCHAR2(2) NOT NULL , C020 VARCHAR2(2) NOT NULL ,
    C021 VARCHAR2(2) NOT NULL , C022 VARCHAR2(2) NOT NULL , C023 VARCHAR2(2) NOT NULL , C024 VARCHAR2(2) NOT NULL ,
    C025 VARCHAR2(2) NOT NULL , C027 VARCHAR2(2) NOT NULL , C026 VARCHAR2(2) NOT NULL , C028 VARCHAR2(2) NOT NULL ,
    C029 VARCHAR2(2) NOT NULL , C030 VARCHAR2(2) NOT NULL , C031 VARCHAR2(2) NOT NULL , C032 VARCHAR2(2) NOT NULL ,
    C033 VARCHAR2(2) NOT NULL , C034 VARCHAR2(2) NOT NULL , C035 VARCHAR2(2) NOT NULL , C036 VARCHAR2(2) NOT NULL ,
    C037 VARCHAR2(2) NOT NULL , C038 VARCHAR2(2) NOT NULL , C039 VARCHAR2(2) NOT NULL , C040 VARCHAR2(2) NOT NULL ,
    C041 VARCHAR2(2) NOT NULL , C042 VARCHAR2(2) NOT NULL , C043 VARCHAR2(2) NOT NULL , C044 VARCHAR2(2) NOT NULL ,
    C045 VARCHAR2(2) NOT NULL , C046 VARCHAR2(2) NOT NULL , C047 VARCHAR2(2) NOT NULL , C048 VARCHAR2(2) NOT NULL ,
    C049 VARCHAR2(2) NOT NULL , C050 VARCHAR2(2) NOT NULL , C051 VARCHAR2(2) NOT NULL , C052 VARCHAR2(2) NOT NULL ,
    C053 VARCHAR2(2) NOT NULL , C054 VARCHAR2(2) NOT NULL , C055 VARCHAR2(2) NOT NULL , C056 VARCHAR2(2) NOT NULL ,
    C057 VARCHAR2(2) NOT NULL , C058 VARCHAR2(2) NOT NULL , C059 VARCHAR2(2) NOT NULL , C060 VARCHAR2(2) NOT NULL ,
    C101 VARCHAR2(2) NOT NULL , C102 VARCHAR2(2) NOT NULL , C103 VARCHAR2(2) NOT NULL , C104 VARCHAR2(2) NOT NULL ,
    C105 VARCHAR2(2) NOT NULL , C106 VARCHAR2(2) NOT NULL , C107 VARCHAR2(2) NOT NULL , C108 VARCHAR2(2) NOT NULL ,
    C109 VARCHAR2(2) NOT NULL , C110 VARCHAR2(2) NOT NULL , C111 VARCHAR2(2) NOT NULL , C112 VARCHAR2(2) NOT NULL ,
    C113 VARCHAR2(2) NOT NULL , C114 VARCHAR2(2) NOT NULL , C115 VARCHAR2(2) NOT NULL , C116 VARCHAR2(2) NOT NULL ,
    C117 VARCHAR2(2) NOT NULL , C118 VARCHAR2(2) NOT NULL , C119 VARCHAR2(2) NOT NULL , C120 VARCHAR2(2) NOT NULL ,
    C121 VARCHAR2(2) NOT NULL , C122 VARCHAR2(2) NOT NULL , C123 VARCHAR2(2) NOT NULL , C124 VARCHAR2(2) NOT NULL ,
    C125 VARCHAR2(2) NOT NULL , C127 VARCHAR2(2) NOT NULL , C126 VARCHAR2(2) NOT NULL , C128 VARCHAR2(2) NOT NULL ,
    C129 VARCHAR2(2) NOT NULL , C130 VARCHAR2(2) NOT NULL , C131 VARCHAR2(2) NOT NULL , C132 VARCHAR2(2) NOT NULL ,
    C133 VARCHAR2(2) NOT NULL , C134 VARCHAR2(2) NOT NULL , C135 VARCHAR2(2) NOT NULL , C136 VARCHAR2(2) NOT NULL ,
    C137 VARCHAR2(2) NOT NULL , C138 VARCHAR2(2) NOT NULL , C139 VARCHAR2(2) NOT NULL , C140 VARCHAR2(2) NOT NULL ,
    C141 VARCHAR2(2) NOT NULL , C142 VARCHAR2(2) NOT NULL , C143 VARCHAR2(2) NOT NULL , C144 VARCHAR2(2) NOT NULL ,
    C145 VARCHAR2(2) NOT NULL , C146 VARCHAR2(2) NOT NULL , C147 VARCHAR2(2) NOT NULL , C148 VARCHAR2(2) NOT NULL ,
    C149 VARCHAR2(2) NOT NULL , C150 VARCHAR2(2) NOT NULL , C151 VARCHAR2(2) NOT NULL , C152 VARCHAR2(2) NOT NULL ,
    C153 VARCHAR2(2) NOT NULL , C154 VARCHAR2(2) NOT NULL , C155 VARCHAR2(2) NOT NULL , C156 VARCHAR2(2) NOT NULL ,
    C157 VARCHAR2(2) NOT NULL , C158 VARCHAR2(2) NOT NULL , C159 VARCHAR2(2) NOT NULL , C160 VARCHAR2(2) NOT NULL
    PCTFREE 10
    PCTUSED 40
    INITRANS 1
    MAXTRANS 255
    STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE USERS
    LOGGING
    NOCOMPRESS
    CREATE TABLE LARGE_TABLE (
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 25

  • 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?

  • Problem with XML in APEX ORA-06502

    i, I have a problem with XML generation, I developed an application in APEX, and in a html page I have this process:
    declare
    l_XML varchar2(32767);
    begin
    select xmlElement
    "iva",
    xmlElement("numeroRuc",J.RUC),
    xmlElement("razonSocial", J.RAZON_SOCIAL),
    xmlElement("idRepre", J.ID_REPRE),
    xmlElement("rucContador", J.RUC_CONTADOR),
    xmlElement("anio", J.ANIO),
    xmlElement("mes", J.MES),
    xmlElement
    "compras",
    select xmlAgg
    xmlElement
    "detalleCompra",
    --xmlAttributes(K.ID_COMPRA as "COMPRA"),
    xmlForest
    K.COD_SUSTENTO as "codSustento",
    K.TPLD_PROV as "tpldProv",
    K.ID_PROV as "idProv",
    K.TIPO_COMPROBANTE as "tipoComprobante",
    to_char(K.FECHA_REGISTRO, 'DD/MM/YYYY') as "fechaRegistro",
    K.ESTABLECIMIENTO as "establecimiento",
    K.PUNTO_EMISION as "puntoEmision",
    K.SECUENCIAL as "secuencial",
    to_char(K.FECHA_EMISION, 'DD/MM/YYYY') as "fechaEmision",
    K.AUTORIZACION as "autorizacion",
    to_char(K.BASE_NO_GRA_IVA, 9999999999.99) as "baseNoGraIva",
    to_char(K.BASE_IMPONIBLE, 9999999999.99) as "baseImponible",
    to_char(K.BASE_IMP_GRAV, 9999999999.99) as "baseImpGrav",
    to_char(K.MONTO_ICE, 9999999999.99) as "montoIce",
    to_char(K.MONTO_IVA, 9999999999.99) as "montoIva",
    to_char(K.VALOR_RET_BIENES, 9999999999.99) as "valorRetBienes",
    to_char(K.VALOR_RET_SERVICIOS, 9999999999.99) as "valorRetServicios",
    to_char(K.VALOR_RET_SERV_100, 9999999999.99) as "valorRetServ100"
    xmlElement
    "air",
    select xmlAgg
    xmlElement
    "detalleAir",
    xmlForest
    P.COD_RET_AIR as "codRetAir",
    to_char(P.BASE_IMP_AIR, 9999999999.99) as "baseImpAir",
    to_char(P.PORCENTAJE_AIR, 999.99) as "porcentajeAir",
    to_char(P.VAL_RET_AIR, 9999999999.99) as "valRetAir"
    from ANEXO_COMPRAS P
    where P.ID_COMPRA = K.ID_COMPRA
    AND P.ID_INFORMANTE_XML = K.ID_INFORMANTE_XML
    xmlElement("estabRetencion1", K.ESTAB_RETENCION_1),
    xmlElement("ptoEmiRetencion1", K.PTO_EMI_RETENCION_1),
    xmlElement("secRetencion1", K.SEC_RETENCION_1),
    xmlElement("autRetencion1", K.AUT_RETENCION_1),
    xmlElement("fechaEmiRet1", to_char(K.FECHA_EMI_RET_1,'DD/MM/YYYY')),
    xmlElement("docModificado", K.DOC_MODIFICADO),
    xmlElement("estabModificado", K.ESTAB_MODIFICADO),
    xmlElement("ptoEmiModificado", K.PTO_EMI_MODIFICADO),
    xmlElement("secModificado", K.SEC_MODIFICADO),
    xmlElement("autModificado", K.AUT_MODIFICADO)
    from SRI_COMPRAS K
    WHERE K.ID IS NOT NULL
    AND K.ID_INFORMANTE_XML = J.ID_INFORMANTE
    AND K.ID BETWEEN 1 AND 25
    ).getClobVal()
    into l_XML
    from ANEXO_INFORMANTE J
    where J.ID_INFORMANTE =:P3_MES
    and J.RUC =:P3_ID_RUC
    and J.ANIO =:P3_ANIO
    and J.MES =:P3_MES;
    --HTML
    sys.owa_util.mime_header('text/xml',FALSE);
    sys.htp.p('Content-Length: ' || length(l_XML));
    sys.owa_util.http_header_close;
    sys.htp.print(l_XML);
    end;
    Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
    I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
    declare
    l_XML CLOB;
    begin
    --Oculta XML
    sys.htp.init;
    wwv_flow.g_page_text_generated := true;
    wwv_flow.g_unrecoverable_error := true;
    --select XML
    select xmlElement
    from SRI_COMPRAS K
    WHERE K.ID IS NOT NULL
    AND K.ID_INFORMANTE_XML = J.ID_INFORMANTE
    ).getClobVal()
    into l_XML
    from ANEXO_INFORMANTE J
    where J.ID_INFORMANTE =:P3_MES
    and J.RUC =:P3_ID_RUC
    and J.ANIO =:P3_ANIO
    and J.MES =:P3_MES;
    --HTML
    sys.owa_util.mime_header('text/xml',FALSE);
    sys.htp.p('Content-Length: ' || length(l_XML));
    sys.owa_util.http_header_close;
    sys.htp.print(l_XML);
    end;
    The error generated is ORA-06502: PL/SQL: numeric or value error+_
    Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+

    JohannaCevallos07 wrote:
    Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
    I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
    The error generated is ORA-06502: PL/SQL: numeric or value error+_
    Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+The likeliest explanation for this is that length of the XML exceeds 32K, which is the maximum size that <tt>htp.p</tt> can output. A CLOB can store much more than this, so it's necessary to buffer the output as shown in +{message:id=4497571}+
    Help us to help you. When you have a problem include as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    And always post code wrapped in <tt>\...\</tt> tags, as described in the FAQ.
    Thanks

  • XML publisher report using dbms_xmlgen (ORA-06502)

    Dear All,
    I have written the below code to generate xml output in Oracle Apps. The code is working fine for less records. But when CLOB size is more than 32k, then
    it giving the ORA-06502 error as fnd_file.put_line(fnd_file.output,v_result) can only write 32k at a time.
    Can anyone let me know how to handle this? Any help on this would be highly appreciated.
    PROCEDURE MAIN ( errbuf OUT VARCHAR2
    ,retcode OUT NUMBER
    ) IS
    TYPE g_query_ref IS REF CURSOR;
    v_query_ref g_query_ref;
    v_handle dbms_xmlgen.ctxhandle;
    v_result clob;
    BEGIN
    OPEN v_query_ref FOR
    SELECT invoice_num,
    description,
    customer_no,
    customer_name
    FROM XX_INVOICE_DETAILS;
    v_handle := dbms_xmlgen.newContext(v_query_ref);
    DBMS_XMLGEN.SETROWTAG (v_handle , 'INVOICE');
    v_result := dbms_xmlgen.getXML(v_handle);
    fnd_file.put_line(fnd_file.output,v_result);
    EXCEPTION
    when others then
    errbuf := sqlerrm;
    retcode := sqlcode;
    fnd_file.put_line(fnd_file.log,’sqlerrm ‘||sqlerrm);
    END MAIN;
    Thanks in Advance.
    Regards,
    Astik

    What you need to do is to chop your CLOB up into smaller strings, something like:
    l_size := DBMS_LOB.getlength (l_clob);
    IF (NVL (l_size, 0) = 0) THEN
    raise_application_error (-20001, 'CLOB is NULL');
    END IF;
    l_offset := 1;
    -- Loop
    WHILE (l_offset <= l_size) LOOP
    l_char := DBMS_LOB.SUBSTR (l_clob,1,l_offset);
    IF (l_char = CHR (10)) THEN
    FND_FILE.NEW_LINE(FND_FILE.output, 1);
    ELSE
    FND_FILE.PUT(FND_FILE.output, l_char);
    END IF;
    -- Increment Offset.
    l_offset:= l_offset+1;
    END LOOP;
    FND_FILE.NEW_LINE(fnd_file.output, 1);

  • ORA-06502: PL/SQL: numeric or value error: character string buffer too smal

    Hi Guys I am getting error ORA-06502: PL/SQL: numeric or value error: character string buffer too small as it said i thought it would be issue with length of feild but i tried to change is nothihg work i am posing code here if any one can please help me on this
    PROCEDURE REPORT
    p_rpt_from_dt in varchar2,
    p_rpt_to_dt in varchar2,
    p_apvr_id in tc_wkr.tc_row_id%type default NULL,
    p_rpt_type in varchar2 default NULL,
    p_backto_pg in varchar2 default NULL
    IS
    v_rpt_from_dt date := var_to_date(p_rpt_from_dt);
    v_rpt_to_dt date := var_to_date(p_rpt_to_dt);
    v_time_str varchar2(15);
    cursor period_cur
    cp_from_dt date,
    cp_to_dt date
    is
    select beg_dt, end_dt
    from jmcs_wk_tprd
    where beg_dt <= cp_to_dt -- report end date
    and end_dt >= cp_from_dt -- report start date
    BEGIN
    if sys_security('tcsys', 'tc_reports') != 'GRANTED' then
    apps_main.access_denied;
    return;
    end if;
    if lg_debug_fl then
    v_time_str := to_char(lg_sysdate, 'hh:mi:ss a.m.');
    else
    v_time_str := tc_time(lg_sysdate);
    end if;
    /* get the time card time periods applicable to the report */
    lga_tc_strt_dt := lga_null_date;
    for recs in period_cur(v_rpt_from_dt, v_rpt_to_dt) loop
    lga_tc_strt_dt(lga_tc_strt_dt.count+1) := recs.beg_dt;
    lga_tc_end_dt(lga_tc_end_dt.count+1) := recs.end_dt;
    end loop;
    --if p_apvr_id is NULL then
    if p_rpt_type != 'D' then
    tc_reporting.reports_header
    1,
    'Time Card Status Report',
    'for '||dd_mon_yyyy(v_rpt_from_dt)||' through '||dd_mon_yyyy(v_rpt_to_dt)||'<BR>'||
    'Report Date: '||dd_mon_yyyy(lg_sysdate)||' Time: '||v_time_str,
    NULL,
    NULL,
    NULL,
    'javascript:window.close()', /* Backto */
    'alert(''Reminder! Click on logo when you are ready to return to previous page'')'
    end if;
    if p_apvr_id is NULL then
    sub_STATUS_BD_ALPHA (v_rpt_from_dt, v_rpt_to_dt, TRUE, p_rpt_type, p_apvr_id);
    else
    htp.p('<!-- Selected Approver ('||p_apvr_id||') -->');
    sub_STATUS_BD_APVR (v_rpt_from_dt, v_rpt_to_dt, p_rpt_type, p_apvr_id);
    end if;
    htp.p('</body></html>');
    EXCEPTION
    WHEN OTHERS THEN
    error_proc(SQLERRM, SQLCODE, owa_util.get_cgi_env('PATH_INFO'));
    htp.p('Error Code is :'||SQLERRM);
    END REPORT;
    This package in trun call other procedure like below
    PROCEDURE sub_STATUS_BD_ALPHA
    p_rpt_from_dt in date,
    p_rpt_to_dt in date,
    p_display_hdr in boolean,
    p_rpt_type in varchar2 default 'B',
    p_apvr_id in tc_wkr.tc_row_id%type default NULL,
    p_tcs_user_id in tc_wkr.tc_row_id%type default NULL
    IS
    v_time_str varchar2(15);
    v_apvr_id tc_wkr.tc_row_id%type := 0;
    v_a_user_id tc_wkr.tc_row_id%type; -- approver tcs_user_id
    v_cnt integer := 0;
    v_people_cnt integer := 0;
    v_stat_cd varchar2(2000);
    v_display_fl boolean := FALSE;
    /*===========================================================================*/
    cursor people_cur
    cp_from_dt in date,
    cp_to_dt in date
    is
    select
    d_full_nm_lfm as name,
    tc_row_id as tcs_user_id,
    tcw_typ as pay_typ,
    tcw_id as pay_id,
    sys_strt_date as sys_strt_dt,
    sys_end_dt
    from tc_wkr
    where sys_strt_date <= cp_to_dt
    and nvl(sys_end_dt, cp_to_dt) >= cp_from_dt
    order by upper(d_full_nm_lfm);
    /* find the current or the most recent (if no current) approver */
    cursor apvr_cur
    cp_tcs_user_id in tc_wkr.tc_row_id%type
    is
    select
    a.f_tc_apvr_id as fk_tcs_apvr_id,
    w.d_full_nm_lfm as apvr_name,
    w.tcw_typ as apvr_pay_typ,
    w.tcw_id as apvr_pay_id,
    a.strt_dt,
    a.end_dt
    from tc_wkr w, tc_ap_asmt a
    where a.f_tc_wkr_id = cp_tcs_user_id
    and w.tc_row_id = a.f_tc_apvr_id
    order by a.strt_dt desc;
    /* list of existing time cards UNION required time cards */
    cursor tc_cur
    cp_tcs_user_id in tc_wkr.tc_row_id%type, /* who's time cards */
    cp_from_dt in date, /* report period from date */
    cp_to_dt in date /* report period to date */
    is
    select
    stat_cd,
    strt_dt,
    end_dt
    from tc
    where strt_dt <= cp_to_dt
    and end_dt >= cp_from_dt
    and fk_tc_wkrtcw_id = cp_tcs_user_id
    UNION
    select
    'Required' as stat_cd,
    beg_dt as strt_dt,
    end_dt
    from jmcs_wk_tprd
    where beg_dt <= cp_to_dt
    and end_dt >= cp_from_dt
    and beg_dt not in (
    select strt_dt
    from tc
    where strt_dt <= cp_to_dt
    and end_dt >= cp_from_dt
    and fk_tc_wkrtcw_id = cp_tcs_user_id
    order by strt_dt;
    BEGIN
    if lg_debug_fl then
    v_time_str := to_char(lg_sysdate, 'hh:mi:ss a.m.');
    else
    v_time_str := tc_time(lg_sysdate);
    end if;
    if p_apvr_id > 0 then
    lga_report_out := lga_report_out_null;
    v_apvr_id := p_apvr_id;
    lga_apvr := lga_apvr_null;
    select
    d_full_nm_lfm,
    tc_row_id,
    tcw_id,
    tcw_typ
    into
    lga_apvr(1).apvr_name,
    lga_apvr(1).apvr_tcs_id,
    lga_apvr(1).apvr_pay_id,
    lga_apvr(1).apvr_pay_typ
    from tc_wkr
    where tc_row_id = v_apvr_id;
    if lga_apvr(1).apvr_pay_typ != 'S' then
    select decode(bend_empl_fl, 'Y', 'E', 'W')
    into lga_apvr(1).apvr_pay_typ
    from empl
    where empl_id = lga_apvr(1).apvr_pay_id;
    end if;
    end if;
    if p_display_hdr then
    if lga_tc_strt_dt.count > 6 then /* more than 6 time periods (1 month) */
    lga_width(1) := to_char(.15 * lg_page_width_standard);
    lga_width(2) := to_char(.08 * lg_page_width_standard);
    for i in 1..lga_tc_strt_dt.count loop
    lga_width(lga_width.count+1) := to_char(.09 * lg_page_width_standard);
    end loop;
    lg_page_width_standard := to_number(lga_width(1)) + to_number(lga_width(2));
    if nvl(p_apvr_id, 0) = 0 then
    lg_page_width_standard := lg_page_width_standard * 2;
    end if;
    htp.p('<!-- page width = '||lg_page_width_standard||'-->');
    for i in 3..lga_width.count loop
    lg_page_width_standard := lg_page_width_standard + to_number(lga_width(i));
    htp.p('<!-- page width = '||lg_page_width_standard||'-->');
    end loop;
    lg_page_width := to_char(lg_page_width_standard);
    else
    lga_width(1) := '15%';
    lga_width(2) := '8%';
    lga_width(3) := '9%';
    lga_width(4) := '9%';
    lga_width(5) := '9%';
    lga_width(6) := '9%';
    lga_width(7) := '9%';
    lga_width(8) := '9%';
    end if;
    sub_DETAIL_PAGE_HD(p_apvr_id);
    end if;
    /* cursor loop */
    for p in people_cur(p_rpt_from_dt, p_rpt_to_dt) loop
    /* is/was this person assigned to the selected approver for the report period */
    v_display_fl := FALSE;
    if nvl(p_tcs_user_id, 0) > 0 then
    if p_tcs_user_id = p.tcs_user_id then
    htp.p('<br>Selected User');
    v_display_fl := TRUE;
    end if;
    elsif nvl(p_apvr_id, 0) = 0 then
    if nvl(p_apvr_id, 0) = 0 then
    v_display_fl := TRUE;
    elsif p_apvr_id > 0 or p_apvr_id = -1 then
    v_display_fl := fct_ASSIGNED_APVR(p.tcs_user_id, p_apvr_id, p_rpt_from_dt, p_rpt_to_dt);
    end if;
    if v_display_fl then
    v_people_cnt := v_people_cnt + 1;
    lg_tcs_owner_info.USER_ID := p.tcs_user_id;
    lg_tcs_owner_info.PAY_ID := p.pay_id;
    lg_tcs_owner_info.PAY_TYPE := p.pay_typ;
    lg_tcs_owner_info.SYS_STRT_DT := p.sys_strt_dt;
    lg_tcs_owner_info.TERM_DT := p.sys_end_dt;
    if p.pay_typ = 'S' then
    begin
    select wrk_hire_dt
    into lg_tcs_owner_info.hire_dt
    from subcntr
    where sub_id = p.pay_id;
    exception
    when no_data_found then
    tc_debug.html_message('subcntr.pay_id('||p.pay_id||')');
    end;
    else
    select
    wrk_hire_dt,
    decode(bend_empl_fl, 'Y', 'E', 'W')
    into
    lg_tcs_owner_info.hire_dt,
    lg_tcs_owner_info.pay_type
    from empl
    where empl_id = lg_tcs_owner_info.PAY_ID;
    end if;
    if lga_report_out.count = 0 then
    lga_report_out(lga_report_out.count+1) := '<table border="1" cellpadding="3" width="'||lg_page_width||'">';
    end if;
    if mod(v_people_cnt,2) = 1 then
    lga_report_out(lga_report_out.count+1) := ('<tr bgcolor="'||lg_odd_bgcolor||'">');
    else
    lga_report_out(lga_report_out.count+1) := ('<tr bgcolor="'||lg_even_bgcolor||'">');
    end if;
    lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>'||p.name||'</font></td >');
    lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>'||p.pay_typ||'-'||lpad(p.pay_id,4,'0')||'</font></td >');
    if nvl(p_apvr_id, 0) > 0 then /* Single Approver */
    /* need approver ID for time card "status" */
    lga_apvr := lga_apvr_null; /* clear the approver id array */
    lga_apvr(1).apvr_tcs_id := p_apvr_id;
    elsif nvl(p_apvr_id, 0) = 0 then /* ALL Approvers */
    lga_apvr := lga_apvr_null; /* clear the approver id array */
    v_cnt := 0;
    for ap in apvr_cur (p.tcs_user_id) loop
    if v_cnt = 0 then
    /* most recent approver may not be the applicable approver */
    v_cnt := 1;
    lga_apvr(v_cnt).apvr_name := ap.apvr_name; -- identify multiple approvers for the "status"
    lga_apvr(v_cnt).apvr_tcs_id := ap.fk_tcs_apvr_id; -- identify multiple approvers for the "status"
    lga_apvr(v_cnt).apvr_pay_id := ap.apvr_pay_id; -- identify multiple approvers for the "status"
    v_apvr_id := ap.fk_tcs_apvr_id;
    if ap.apvr_pay_typ = 'S' then
    lga_apvr(v_cnt).apvr_pay_typ := ap.apvr_pay_typ; -- identify multiple approvers for the "status"
    else
    select decode(bend_empl_fl, 'Y', 'E', 'W')
    into lga_apvr(1).apvr_pay_typ
    from empl
    where empl_id = lga_apvr(1).apvr_pay_id;
    end if;
    end if;
    if ap.strt_dt <= p_rpt_to_dt and nvl(ap.end_dt, p_rpt_to_dt) >= p_rpt_from_dt then
    /* approver record */
    lg_tcs_owner_info.APVR_ID := ap.fk_tcs_apvr_id;
    lg_tcs_owner_info.APVR_STRT_DT := ap.strt_dt;
    lg_tcs_owner_info.APVR_END_DT := ap.end_dt;
    don't enter same approver name multiple times
    when same approver has been assigned more than once
    Example: approver1, approver_2, approver_1 (change back to approver 1)
    for i in 1..lga_apvr.count loop
    v_apvr_id := ap.fk_tcs_apvr_id;
    if lga_apvr(i).apvr_tcs_id = ap.fk_tcs_apvr_id then
    /* don't add again */
    v_apvr_id := NULL;
    exit;
    end if;
    end loop;
    if v_apvr_id is not NULL then
    v_cnt := v_cnt + 1;
    lga_apvr(v_cnt).apvr_name := ap.apvr_name; -- identify multiple approvers for the "status"
    lga_apvr(v_cnt).apvr_tcs_id := ap.fk_tcs_apvr_id; -- identify multiple approvers for the "status"
    lga_apvr(v_cnt).apvr_pay_id := ap.apvr_pay_id; -- identify multiple approvers for the "status"
    lga_apvr(v_cnt).apvr_pay_typ := ap.apvr_pay_typ; -- identify multiple approvers for the "status"
    end if;
    end if;
    end loop;
    /* list approver pay IDs */
    lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>');
    if lga_apvr.count = 0 then
    lga_report_out(lga_report_out.count+1) := 'Approver Unassigned';
    else
    for i in 1..lga_apvr.count loop
    if i > 1 then
    lga_report_out(lga_report_out.count+1) := '<br>';
    end if;
    lga_report_out(lga_report_out.count+1) := (lga_apvr(i).apvr_name);
    end loop;
    end if;
    lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>');
    if lga_apvr.count = 0 then
    lga_report_out(lga_report_out.count+1) := 'N/A';
    else
    for i in 1..lga_apvr.count loop
    if i > 1 then
    lga_report_out(lga_report_out.count+1) := '<br>';
    end if;
    lga_report_out(lga_report_out.count+1) := (lga_apvr(i).apvr_pay_typ)||'-'||lpad(lga_apvr(i).apvr_pay_id,4,'0');
    end loop;
    end if;
    lga_report_out(lga_report_out.count+1) := ('</font></td >');
    end if;
    for t in tc_cur(p.tcs_user_id, p_rpt_from_dt, p_rpt_to_dt) loop
    htp.p('<! '||t.strt_dt||', '||t.end_dt||', '||t.stat_cd||' -->');
    --lga_report_out(lga_report_out.count+1) := ('<td valign="top"><font size=-2>');
    --lga_report_out(lga_report_out.count+1) := (t.stat_cd);
    --lga_report_out(lga_report_out.count+1) := ('</font></td >');
    /* has the selected approver has completed processing */
    if p_apvr_id > 0
    and v_apvr_id = p_apvr_id
    and v_a_user_id != p_apvr_id
    then
    exit;
    end if;
    for ap in apvr_cur (p.tcs_user_id) loop
    if apvr_cur%rowcount = 1 then
    /* most recent approver assigned */
    lg_tcs_owner_info.apvr_id := ap.fk_tcs_apvr_id;
    end if;
    if ap.strt_dt <= t.end_dt and nvl(ap.end_dt, t.end_dt) >= t.strt_dt then
    /* approver assigned during time card period */
    lg_tcs_owner_info.apvr_id := ap.fk_tcs_apvr_id;
    exit;
    end if;
    end loop;
    lg_tc_status.strt_dt := t.strt_dt;
    lg_tc_status.end_dt := t.end_dt;
    lg_tc_status.stat_cd := t.stat_cd;
    v_stat_cd := fct_TC_STATUS(nvl(p_apvr_id, 0));
    lga_report_out(lga_report_out.count+1) := ('<td align="center" valign="top" bgcolor="'||lg_tc_status.bg_color||'">');
    lga_report_out(lga_report_out.count+1) := ('<font size=-2 color='||lg_tc_status.font_color||'>');
    lga_report_out(lga_report_out.count+1) := v_stat_cd;
    lga_report_out(lga_report_out.count+1) := ('</font></td >');
    end loop;
    lga_report_out(lga_report_out.count+1) := '</tr>';
    end if; /* v_display_fl */
    end loop;
    if p_rpt_type in ('B', 'S') then
    lg_page_cnt := lg_page_cnt + 1;
    sub_DISPLAY_STATUS_SUMMARY;
    end if;
    if lga_report_out.count > 0 then
    lga_report_out(lga_report_out.count+1) := '</table>';
    end if;
    if lga_report_out.count > 0 then
    if p_rpt_type = 'B' or p_apvr_id > 0 then
    if p_display_hdr then
    if lg_page_cnt > 0 then
    if p_apvr_id > 0 then /* selected individual approver */
    htp.p('</table>');
    end if;
    htp.p('<br style="page-break-after:always">');
                        htp.p('<!-- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -->');
                        htp.p('<!-- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -->');
    end if;
    lg_page_cnt := lg_page_cnt + 1;
    tc_reporting.reports_header
    1,
    'Time Card Status Report',
    'for '||dd_mon_yyyy(p_rpt_from_dt)||' through '||dd_mon_yyyy(p_rpt_to_dt)||'<BR>'||
    'Report Date: '||dd_mon_yyyy(lg_sysdate)||' Time: '||v_time_str,
    NULL,
    NULL,
    NULL,
    NULL, -- p_backto_pg, /* Backto */
    'focus()',
    lg_page_cnt
    end if;
    end if;
    if p_rpt_type in ('B', 'D') then
    for i in 1..lga_report_out.count loop
    htp.p(lga_report_out(i));
    end loop;
    end if;
    end if;
    END sub_STATUS_BD_ALPHA;
    Some veriable
    type report_tc_rec is record
    tc_owner_name tc_wkr.d_full_nm_lfm%type,
    o_user_id tc_wkr.tc_row_id%type,
    o_pay_id varchar2(10),
    o_sys_strt_dt date,
    o_sys_end_dt date,
    tc_apvr_name tc_wkr.d_full_nm_lfm%type,
    a_pay_id varchar2(10),
    a_user_id tc_wkr.tc_row_id%type,
    tc_strt_dt date,
    tc_end_dt date,
    tc_stat_cd varchar2(50),
    ap_strt_dt date,
    ap_end_dt date
    /* time card owner information */
    TYPE tcs_owner_info_rec IS RECORD
    USER_ID tc_wkr.tc_row_id%type,
    PAY_ID tc_wkr.tcw_id%type,
    PAY_TYPE tc_wkr.tcw_typ%type,
    HIRE_DT date,
    SYS_STRT_DT date,
    TERM_DT date,
    APVR_ID tc_wkr.tc_row_id%type,
    APVR_STRT_DT date,
    APVR_END_DT date
    /* status code determines report cell font and background colors */
    TYPE tc_status_rec IS RECORD
    STRT_DT date,
    END_DT date,
    STAT_CD tc.stat_cd%type,
    FONT_COLOR varchar2(16),
    BG_COLOR varchar2(16)
    /* count of all time card status for report summary */
    TYPE tc_status_summary_rec IS RECORD
    APPROVED_CNT integer := 0,
    REJECTED_CNT integer := 0,
    SUBMITTED_CNT integer := 0,
    POSTED_CNT integer := 0,
    VERIFIED_CNT integer := 0,
    OPEN_CNT integer := 0,
    NEW_CNT integer := 0,
    REQUIRED_CNT integer := 0,
    TOTAL_CNT integer := 0
    /* determine multiple approvers for individual for selected report period */
    TYPE apvr_rec IS RECORD
    apvr_name tc_wkr.d_full_nm_lfm%type,
    apvr_tcs_id tc_wkr.tc_row_id%type,
    apvr_pay_id tc_wkr.tcw_id%type,
    apvr_pay_typ tc_wkr.tcw_typ%type
    TYPE apvr_id_array_table IS TABLE OF apvr_rec
    index by binary_integer;
    type output_array is table of varchar2(1000)
    index by binary_integer;
    type date_array is table of date
    index by binary_integer;
    type status_array is table of varchar2(1000)
    index by binary_integer;
    type apvr_array is table of number(8)
    index by binary_integer;
    lga_report_out output_array; /* array of HTML code to be output to browser */
    lga_report_out_null output_array; /* null array of HTML code */
    lga_tc_status status_array;
    lga_null_status status_array;
    lga_tc_strt_dt date_array;
    lga_tc_end_dt date_array;
    lga_tc_disp date_array; /* start dates of displayed TC for selected user */
    lga_null_date date_array; /* null array used to clear other date arrays */
    /* LOCAL GLOBAL VARIABLES */
    lg_tcs_owner_info tcs_owner_info_rec; /* time card owner information */
    lg_tc_status tc_status_rec; /* time card status information */
    lg_tc_status_summary tc_status_summary_rec; /* time card count by status */
    lg_tc_rec report_tc_rec; /* time card */
    lga_apvr apvr_id_array_table; /* array of approver Names and Payroll IDs */
    lga_apvr_null apvr_id_array_table; /* clear the lga_apvr array for each user */
    lg_sysdate date := sysdate;
    lg_debug_fl boolean := FALSE;
    lg_debug_owner_id tc_wkr.tc_row_id%type := 9905;
    lg_debug_apvr_id tc_wkr.tc_row_id%type := 1000;
    The chnages i have done its in bold
    Please Advice
    Thanks
    Edited by: Purvik on Aug 25, 2009 11:59 AM

    There is not a chance in the world, especially not knowing column definitions that I, and I suspect most anyone else, is going to wade through this much unformated code looking for an error you couldn't bother to copy in full.
    Either tell us, specifically, the line on which the error is occurring or, better yet, start whacking stuff out of your code until you find the offending definition. That is certainly what I would do. Commenting out sections is a marvelous way to quickly find an issue.
    Before you post again please read the FAQ. It will explain to you how to properly post and use the tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Import Export Error (ORA-06502)

    All,
    We are trying to migrate the code from windows 2000 HTMLDB 1.5.0.00.33 to solaris 9 HTMLDB 1.5.0.00.33 by using the export/import function. After migration, one report went wrong with the following message.
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    The tables definition are identical and there's no data in the production table. When we try to reduce the query length from 3000 to 2500 characters, the error message disappears on production.
    Is there any HTMLDB global variable controls the maximum length of the report "region source"?
    Any response would be appreciate.
    Thanks,
    Tony
    ===========================================
    PS: Here's our query:
    select
    x.supreq_id,
    DECODE(x.pk, null, 'Add new record:', ''||'<img src="#IMAGE_PREFIX#edit.gif" border="0" alt="Edit Icon">') edit,
    x.pk,
    x.request,
    x.subject,
    x.severity,
    x.priority,
    x.status,
    x.request_type,
    x.response,
    x.username,
    x.created_date,
    x.note,
    x.cks
    from (
    select
    htmldb_item.hidden(1,supreq_id) supreq_id,
    supreq_id edit,
    supreq_id pk,
    htmldb_item.text(3, request,'','','onFocus="javascript:window.status=this.value" onBlur="javascript:window.status=''Done''"') request,
    htmldb_item.select_list_from_lov(4,subject,'REQUEST_SUBJECT','','NO') subject,
    htmldb_item.select_list(5, severity, '3,2,1', 'style="width:40px"','NO') severity,
    htmldb_item.select_list_from_lov(6,priority,'REQUEST_PRIORITY','','NO') priority,
    htmldb_item.select_list_from_lov(7,status,'REQUEST_STATUS','','NO') status,
    htmldb_item.select_list_from_lov(8, request_type, 'SUPPORT_REQUEST_TYPE','', 'NO') request_type,
    htmldb_item.text(9, response,'','','onFocus=javascript:window.status=this.value;') response,
    htmldb_item.select_list_from_lov(10, username, 'USER_EMPLOYEE', 'style="width:100px"','NO') username,
    htmldb_item.date_popup(11, rownum,created_date, 'mm/dd/yyyy', 8) created_date,
    htmldb_item.text(12, note,'','','onFocus=javascript:window.status=this.value;') note,
    htmldb_item.md5_checksum(request, subject, severity, priority, status, request_type, response, username, created_date,note) cks
    from
    art_sup_requests
    where
    (:P319_PRIORITY IS NULL OR :P319_PRIORITY ='%' OR
    INSTR(UPPER(ART_SUP_REQUESTS.PRIORITY),UPPER(:P319_PRIORITY)) > 0)
    AND
    (:P319_SEVERITY IS NULL OR :P319_SEVERITY ='%' OR
    INSTR(UPPER(ART_SUP_REQUESTS.SEVERITY),UPPER(:P319_SEVERITY)) > 0)
    AND
    (:P319_SUBJECT IS NULL OR :P319_SUBJECT ='%' OR
    INSTR(UPPER(ART_SUP_REQUESTS.SUBJECT),UPPER(:P319_SUBJECT)) > 0)
    AND (:P319_CREATED_DATE IS NULL OR
    TRUNC(ART_SUP_REQUESTS.CREATED_DATE)=TO_DATE(:P319_CREATED_DATE,'MM/DD/YYYY'))
    AND (:P319_REQUEST_TYPE IS NULL OR :P319_REQUEST_TYPE ='%' OR
    INSTR(UPPER(ART_SUP_REQUESTS.REQUEST_TYPE),UPPER(:P319_REQUEST_TYPE)) > 0)
    AND (:P319_REQUEST IS NULL OR
    INSTR(UPPER(ART_SUP_REQUESTS.REQUEST),UPPER(:P319_REQUEST)) > 0)
    AND (:P319_USERNAME IS NULL OR :P319_USERNAME ='%' OR
    INSTR(UPPER(ART_SUP_REQUESTS.USERNAME),UPPER(:P319_USERNAME)) > 0)
    AND (:P319_ID IS NULL OR ART_SUP_REQUESTS.SUPREQ_ID = :P319_ID)
    union all
    select
    htmldb_item.hidden(1,null) supreq_id,
    null edit,
    null pk,
    htmldb_item.text(3, null) request,
    htmldb_item.select_list_from_lov(4,null,'REQUEST_SUBJECT','','NO') subject,
    htmldb_item.select_list(5, null, '3,2,1', 'style="width:40px"','NO') severity,
    htmldb_item.select_list_from_lov(6,null,'REQUEST_PRIORITY','','NO') priority,
    htmldb_item.select_list_from_lov(7,null,'REQUEST_STATUS','','NO') status,
    htmldb_item.select_list_from_lov(8, null, 'SUPPORT_REQUEST_TYPE','', 'NO') request_type,
    htmldb_item.text(9, null) response,
    htmldb_item.select_list_from_lov(10, null,
    'USER_EMPLOYEE','style="width:100px"','NO') username,
    htmldb_item.date_popup(11, null, sysdate,'mm/dd/yyyy', 8) created_date,
    htmldb_item.text(12, null) note,
    htmldb_item.md5_checksum(null,null, null, null, null, null, null, null, null, null) cks
    from dual) x

    Scott,
    Thanks for the response. We've applied HTMLDB version 1.5.1.00.12 on both develop and production servers yesterday but the ORA-06502 error still persist. We've also tried to use package and "pl/sql return sql" instead of a long sql query but received the same result.
    The solaris instance is using "Western European ISO-8859-1" as the file character set and the windows is using "Western European Windows 1252". Is there any easy way to change the DAD character set on the production box?
    Thanks,
    Tony

  • Version 3.1 fault - ORA-06502 error when creating SQL Report Region/Page

    I usually perfect my query in SQL*PLUS before I create a new report region.
    Consequently, I copy the code into the region wizard to create the new page. However, since we have upgraded to Version 3.1, virtually every report I have tried to create has created the following error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    It would appear that a maximum of 960 characters can be used to create the region/page. Perversely, once the page/region has been created, I can then edit the source and include as much code as I want (so far I've not run up against a limit)
    As it's just annoying, but not stopping me doing what I wanted to do, I've not got around to mentioning this error previously, but it occurred to me that I should (so I am!)
    David

    Hi David,
    Thank you for reporting this. Unfortunately, this was a regression introduced in Application Express 3.1. The workaround is to edit the region, as you suggested. This has been filed as Bug 6956070 and will be corrected in the forthcoming Application Express 3.1.1 patch set.
    Joel

  • Sql Query (updateable Report) returning ORA-06502: PL/SQL: numeric or value

    Hi I have a Sql Query Report Region as defined below. On the report attributes I am not using any "Row Selector". In a After submit process I try to print out the results of the value I have entered in as a value in updatable report and i get the error: I am doing this as a test before i use the data to insert into another table...
    I receive this error if I enter in a characters (not numeric) into the "Field Value" field.:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error.
    If I enter in a numeric into the "Field Value" text box, then I get the value displayed back without error. I need to be able to enter a varchar value without error.
    My SQL QUERY is:
    select i.INDEXED_FIELD_ID, i.field_name,
    HTMLDB_ITEM.TEXT(3,d.indexed_field_value) field_value,
    decode(f.required, 0, 'O', 1, 'R', 'NOT USED') REQUIRED
    from XXVG_EFILE_DOCUMENT_FIELDS D,
    xxvg_efile_type_fields f, xxvg_efile_indexed_fields i
    WHERE f.indexed_field_id = i.indexed_field_id
    and f.required in (0,1)
    and i.indexed_field_id = d.indexed_field_id(+)
    and d.document_id(+) = -1
    and f.document_type_id = :p21_doc_type
    My after submit process is the following...**Note** I am using P21_test as a field just to display my test. I receive the value back just fine without error if numeric. If varchar, that is when the problems occur. I have used just a length variable like the lettter 't' for testing and still receive the error.
    DECLARE
    vRow BINARY_INTEGER;
    BEGIN
    -- update field values
    FOR i IN 1 .. HTMLDB_APPLICATION.g_f03.COUNT -- your field value
    LOOP
    vRow := HTMLDB_APPLICATION.g_f03(i);
    IF vRow is Not NULL --means the field has data in it.
    THEN
    :p21_test := HTMLDB_APPLICATION.G_F03(i); --set a variable to the field with data.
    END IF;
    END LOOP;
    END;
    Is there a conversion I need to do? I do not want to do this via checkboxes as I dont want the user have to check a checkbox and then enter a value in. I just want a blank text box the user can enter a value in and then i can do an insert.
    Thanks So much.

    Thanks Scott, That did do the trick as the varchar is now displayed of the entered item.
    How do i also display the value of indexed_field_id as well.
    I have an insert where i need the indexed field id and the entered field value.
    Thanks in advance.

  • Report error: ORA-06502: PL/SQL: numeric or value error: character string b

    I have a form which uses a customer form/report, drop downs etc..
    the debug shows it running this statement
    ...Execute Statement: begin begin SELECT distinct initcap(RTRIM (LTRIM (e.surname, ' *0123456789-/:.?,'), ' *0123456789-/:.?,') || ', ' || RTRIM (LTRIM (e.first_name, ' *0123456789-/:.?,'), ' *0123456789-/:.?,' )) empname, e.ID bulk collect into wwv_flow_utilities.g_display,wwv_flow_utilities.g_value FROM dms.dms_employees@dmsprd e, dms.dms_employee_contracts@dmsprd ec WHERE e.ID = ec.emp_id and e.surname like '%%' AND :p75_date BETWEEN ec.start_date AND NVL (ec.end_date, :p75_date) AND e.brh_id = 3654 ORDER BY 1; end; end;
    Then says
    "report error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small"
    Any Ideas?
    Thanks
    Dean

    Denes Kubicek wrote:
    A select list is limited in size. I am not sure what the limit is but that is definitelly the case.The maximum size for the HTML generated for a select list is 32K.
    86 options sounds on the low side to be hitting that limit, but there are other concerns to this as well. Scrolling through hundreds/thousands of options in a select list is a pain for users, and huge select lists produce bloated pages that impact load times and network bandwidth. That list of around 200 countries you find on many sites is about the sensible maximum length for a select list.
    You should use popups.Indeed.

  • Report error:ORA-06502: PL/SQL: numeric or value error: character to number

    The oracle application express environment is created by installing the HTTP Server on the windows server and the application express 3.2.1 components on the 11.1.0.7 oracle database on UNIX. The installation is successfully and have not seen any issues during the installation. After completing all the steps, when tried to login and click the application builder or workspace components, I see the error message
    report error:ORA-06502: PL/SQL: numeric or value error: character to number.
    This error message is seen on most of the pages when trying to accessed and not able to understand the reasons behind it. Its a brand new environment setup and not even presented to developers to test it.
    Below error message is always seen when trying to access most of the components like application builder, schema comparison and some other tabs. Please advice
    report error:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Edited by: user589320 on Jun 9, 2011 5:17 PM

    I think its better you use APEX 4.x version ratherthan using old version.
    You will get more features and some bug fixes and also it's easy for you to get some help when you need.
    * If this answer is helpfull or correct then please mark it and grant the points.

  • Report error:ORA-06502: PL/SQL: numeric or value error: character string bu

    We face the above error in HTMLDB (APEX) application Ver 3.1.0. This occurs when we try to display more number of rows/records in drop-down list (LOV in tabular forms). We are able to display 200 records in LOV. When the list of records exceeds 230, we face the below error
    report error:ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    the values listed in LOV are from tables (one of the columns in table)
    Could anyone give us a solution?

    Hi
    As you are using a tabular form, you could actually do the following:
    1 - In the tabular form column's attributes, set the following:
    Display as: Select List (query based on LOV)
    Display extra values: Yes
    List of values definition: SELECT null d, null r FROM DUAL
    2 - Add a new page item and set it to generate your select list
    3 - Create an HTML region with no template and use the following for its source:
    &lt;script type="text/javascript"&gt;
    function loadList(c, l)
    var s = document.getElementsByName(c);
    var lItem = document.getElementById(l);
    var lLength = lItem.options.length;
    var k;
    var j;
    var x = lItem.innerHTML;
    var v;
    var o;
    var z;
    for (k = 0; k &lt; s.length; k++)
    z = s[k];
    v = z.value;
    z.options.length = 0;
    for (j = 0; j &lt; lLength; j++)
    o = new Option()
    o.value = lItem[j].value;
    o.text = lItem[j].text;
    z.options[j] = o;
    z.value = v;
    if (z.selectedIndex == -1)
    z.selectedIndex = 0;
    loadList("f05", "P1_MGR");
    &lt;/script&gt;
    (Change "f05" and "P1_MGR" as appropriate to your column and your new page item respectively)
    Now, when you load the page, the select list contains a null entry plus the entry already on the database. The javascript kicks in automatically, loops through every entry in the "f05" column, copies the existing value, replaces the select list with the new page item version and sets its value to the copied value.
    Your new page item could be in a DIV tag that has a style of "display:none" to hide it from view.
    Andy

  • 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

Maybe you are looking for