APEX Validation : ORA-06502: PL/SQL: numeric or value error:

Hello,
I need some help for a validation. User put value at 'minutes field'(need a number between 0-59).
My solution is to make two validations:
1 - No number:
Name: P1_MINUTES
Type : Regular expression
Validation Expression 1: P1_MINUTES
Validation Expression 2: ^\d{1,5}(\.\d{1,2})?$
2 - Higher number then 59:
Name: P1_MINUTES
Type : Function returning Boolean
Validation Expression 1:
if :P10_TOT_MINUTEN < 60 then
return true;
else
return false;
end if;
Validation Expression 2: -
Validation 2 gives this error(for example value = m) :
ORA-06502: PL/SQL: numeric or value error: character to number conversion error - the reason is clear value m is not numeric
How can this be solved!

Tony,
This is not the solution for my problem. If the user fills a character (say 'b') then I have still this error. Value 'b' is not numeric.
I need a solution: Combination from both validations or skip function (if validation number 1 is true then skip validation 2).
Do you have another solution for this problem.
Thanks
Walter

Similar Messages

  • Ora-06502 pl/sql numeric or value error in Report Query in oracle apex

    Hello all,
    I need your help...
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    I am using bi publisher to generate PDF reports in oracle apex.
    We were using APEX 4.0 and migrated to 4.2 just a week ago.
    Now we have apex 4.2.
    When I try to Create report query,
    Shared Components >> Report Queries then create.
    and test a report in a create wizard I am getting a error "ORA-06502: PL/SQL: numeric or value error: character string buffer too small".
    I have also applied a patch "16760897".
    This issue is because of number of columns in a query is more then 26.
    If I run a report with 26 or less number of columns then the is working fine, otherwise getting this error.
    My before migration report queries working perfectly even now, but not new queries.
    This issue is also in apex.oracle.com.
    You can see
    Not working  - http://apex.oracle.com/pls/apex/f?p=619:4
    Working - http://apex.oracle.com/pls/apex/f?p=619:2:
    Please give a solution.
    Thanks you.

    check the DB version compatibility with apex 4 or your DB version to apex 4.0 support for upgrade!
    Oracle Application Express Installation Requirements for 4.0

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

  • 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

  • PL/SQL function body returning SQL query - ORA-06502: PL/SQL: numeric or value error

    I'm attempting to dynamically generate a rather large SQL query via the "PL/SQL function body returning SQL query" report region option.  The SQL query generated will possibly be over 32K.  When I execute my page, I sometimes receive the "ORA-06502: PL/SQL: numeric or value error" which points to a larger than 32K query that was generated.  I've seen other posts in the forum related to this dynamic SQL size limitation issue, but they are older (pre-2010) and point to the 32K limit of the DNS (EXECUTE IMMEDIATE) and DBMS_SQL.  I found this post (dynamic sql enhancements in 11g) which discusses 11g no longer having the 32K size limitation for generating dynamic SQL.  Our environment is on 11gR2 and using ApEx 4.2.1.  I do not know which dynamic SQL method -- DNS or DBMS_SQL -- ApEx 4.2.1 is using.  Can someone clarify for me which dynamic SQL method ApEx uses to implement the "PL/SQL function body returning SQL query" option?
    As a test, I created a page on apex.oracle.com with a report region with the following source:
    declare
      l_stub varchar2(25) := 'select * from sys.dual ';
      l_sql  clob := l_stub || 'union all ';
      br     number(3) := 33;
    begin
      while length ( l_sql ) < 34000 loop
        l_sql := l_sql || l_stub || 'union all ';
      end loop;
      l_sql := l_sql || l_stub;
      for i in 1 .. ceil ( length ( l_sql ) / br ) loop
        dbms_output.put_line ( dbms_lob.substr ( l_sql, br, ( ( i - 1 ) * br ) + 1 ) );
      end loop;
      return l_sql;
    end;
    The dbms_output section is there to be able to run this code in SQL*Plus and confirm the size of the SQL is indeed larger than 32K.  When running this in SQL*Plus, the procedure is successful and produces a proper SQL statement which can be executed.  When I put this into the report region on apex.oracle.com, I get the ORA-06502 error.
    I can certainly implement a work-around for my issue by creating a 'Before Header' process on the page which populates an ApEx collection with the data I am returning and then the report can simply select from the collection, but according to documentation, the above 32K limitation should be resolved in 11g.  Thoughts?
    Shane.

    What setting do you use in your report properties - especially in Type and in Region Source?
    If you have Type="SQL Query", then you should have a SELECT statement in the Region Source. Something like: SELECT .... FROM ... WHERE
    According to the ERR-1101 error message, you have probably set Type to "SQL Query (PL/SQL function body returning SQL query)". In this situation APEX expects you to write a body of a PL/SQL function, that will generate the text of a SQL query that APEX should run. So it can be something like:
    declare
    mycond varchar2(4000);
    begin
    if :P1_REPORT_SEARCH is not null THEN
    mycond:='WHERE LAST_NAME like :P1_REPORT_SEARCH ||''%''';
    end if;
    return 'select EMPLOYEE_ID, FIRST_NAME, LAST_NAME from EMPLOYEES ' ||mycond;
    end;
    And for escaping - are you interested in escaping the LIKE wildcards, or the quotes?
    For escaping the wildcards in LIKE function so that when the user enters % you will find a record with % and not all functions, look into the SQL Reference:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm
    (You would than need to change the code of your function accordingly).
    If you are interested in escaping the quotes, try to avoid concatenating the values entered by the user into the SQL. If you can, use bind variables instead - as I have in my example above. If you start concatenating the values into the text of SQL, you are open to SQLInjection - user can enter anything, even things that will break your SQL. If you really need to allow users to choose the operator, I would probably give them a separate combo for operators and a textfield for values, than you could check if the operator is one of the allowed ones and create the condition accordingly - and than still use bind variable for inserting the filtering value into the query.

  • ORA-06502: PL/SQL: numeric or value error: NULL index table key value Repor

    W've been experiencing the Oracle Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value Report’ [we are currently on apex v3.0.1]. From the forum there was a reference to a bug fix: apex bug (6416829) fixed in 3.1. When we view '6416829' in Metalink we can see the bug title but cannot see any details as it's protected. Can anyone shed some light on why it's protected or provide further details.
    We have many LIVE customers reporting this error and we want to be certain it's fixed in v3.1.
    (currently we are working around this by flushing the shared pool but this is not ideal).
    Any help would be appreciated.

    Scott,
    This error has been thrown several times in the past 24 hours. Yesterday several of my reports threw the error, these reports have done so in the past. This morning APEX has begun throwing the error of which I have seen only once before. This is occuring at Home>Application>My Application. The error appears when I attempt to View the report in Details mode, is OK when I view the report in Icons mode. The error is occuring in my Prodution environment which has not been updated since 2/25/2009.
    As before, I edited the SQL on my application's reports and the error then disappeared.
    We are running Application Express 3.2.0.00.27 and Oracle Release 10.2.0.1.0. My browser is IE 7.0.
    Plan to test later with FireFox provided I can download it to see if this might browser related.
    Any inforamtion or guidance is appreciated.
    Jeff

  • ORA-06502:PL/SQL:numeric or value error. Dynamic SQL the only answer??

    ORA-06502: PL/SQL: numeric or value error: character string buffer too small.
    I have an HTMLDB report that errors with the above message. The query is over 7000 characters long so I'm guessing this is the cause. If I retrieve the query from a query table, replace the variables in the LONG query using PL/SQL and execute using dynamic SQL, are the HTMLDB reporting features the same as if I was using a simple SQL query? Is there a better way? I will need to 'drill-down' from this report so how do I create the links? The only HTMLDB PL/SQL package I can find mentioned in the User's Guide is HTMLDB_PLSQL_JOB.
    Cheers, Paul

    Hello All,
    I have the same problem.
    For me it started when i got about 500 rows in the table
    on which the LOV is based.
    With a lot of trying with substr I managed to find the size of the string which it still accepted, which was 51 characters.
    So I thought it was some glitch in the APEX insides, and since I had no time to resolve it further, I went on working.
    But I have to resolve it now, because the following mysterious behaviour is occurring:
    Every few records added to the base table, the problem occurs again, and I can resolve it by cutting down the string
    with one character.
    I have now reached 39 characters !?
    I am afraid that I will end up with 1 character or even null.
    If I switch to Popup list based on LOV there's no problem, and the complete strings are shown.
    The maximum length of the string in my basetable is 252, but the data in it now reaches 55 at most.
    Any idea welcome!
    I did already recreate the master-detail form from scratch, but there the same behaviour.
    greetings,
    Richard Kloostra

  • ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL"

    Was working on tutorial from the:
    Oracle Database Express Edition 2 Day Plus Application Express Developer Guide
    Working on the section 4: How to Control Form Layout.
    Ran into a problem trying to compile the Create HT-EMP Table script.
    keep getting this error for this particular segment creating the bu_ht_emp trigger:
    pp. 4-2 and 4-3
    CREATE OR REPLACE TRIGGER bi_ht_emp
    BEFORE INSERT ON ht_emp
    FOR EACH ROW
    BEGIN
    SELECT ht_emp_seq.nextval
    INTO :new.emp_id
    FROM DUAL;
    :new.rec_create_date := SYSDATE;
    END;
    ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL", line 354....etc
    I've check the syntax for the entire script and it all checks out. Does anyone have a clue why this is failing?

    If I'm looking at the same DDL, not seeing where it would throw an owa_util error, are you running it in the apex script editor?
    Just plain sqlplus doesn't like the empty line stuck in with the list of check constraints on the emp_dept column, after fixing that up (and dropping the sequence that got created on the first pass) the DDL and insert runs fine-

  • Issue in appending the LOBs -ORA-06502: PL/SQL: numeric or value error

    Hi
    I am using Oracle 11g.
    I have a requirement in which I have to append LOBs and I have to insert the LOB into a table column. I am facing problem when the data exceeds certain limit. My program works like the below:
    (please note that my program logic is given below, not the exact program)
    DECLARE
    final_html CLOB;
    int_html CLOB;
    v_str VARCHAR2(32767);
    i number:=0;
    BEGIN
    dbms_lob.createtemporary(lob_loc => int_html, CACHE => TRUE, dur => dbms_lob.CALL);
    dbms_lob.createtemporary(lob_loc => final_html, CACHE => TRUE, dur => dbms_lob.CALL);
    DBMS_LOB.OPEN(int_html, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.OPEN(final_html, DBMS_LOB.LOB_READWRITE);
    dbms_output.ENABLE(1000000);
    FOR i IN 1..100 loop
    v_str := '<tr>' ||
    '<td style="WORD-WRAP: break-word" width="50"><font size="2">' ||
    i || '</font></td>' ||
    '</tr>';
    dbms_lob.writeappend(lob_loc => int_html, amount => LENGTH(v_str), BUFFER => v_str);
    END LOOP;
    dbms_output.put_line( 'The length of int_html is:'||dbms_lob.getlength(int_html));
    dbms_output.put_line( 'The int_html is:'||int_html);
    final_html:= '<html>'||int_html||'</html>';
    dbms_output.put_line('The final_html is:'||final_html);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLCODE||'-'||SQLERRM);
    DBMS_LOB.CLOSE (int_html);
    DBMS_LOB.CLOSE (final_html);
    DBMS_LOB.FREETEMPORARY(int_html);
    DBMS_LOB.FREETEMPORARY(final_html);
    END;
    when the looping is done for lesser value say for e.g FOR i IN 1..10 loop, the program works fine, but when the looping is done for more values I am getting "-6502-ORA-06502: PL/SQL: numeric or value error" error message.
    Please help me to resolve this issue.
    Thanking you in advance.
    Regards,
    Sri

    Can you please specify in which environment you are executing this ?
    I modified your code as follows
    The code executed successfully until the length was <= 32767 i.e ( until FOR i IN 1..1092)
    Also, you need to use the APPEND function to concatenate clob variables.
    Please verify the default max size for varchar2 or dbms_output in your server since you get the error for just the loop within the range (FOR i IN 1..100) .
    And yes, the comments from Siva are valid.
    DECLARE
    final_html CLOB;
    int_html CLOB;
    v_str VARCHAR2(32767);
    i number:=0;
    BEGIN
    dbms_lob.createtemporary(lob_loc => int_html, CACHE => TRUE, dur => dbms_lob.CALL);
    dbms_lob.createtemporary(lob_loc => final_html, CACHE => TRUE, dur => dbms_lob.CALL);
    DBMS_LOB.OPEN(int_html, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.OPEN(final_html, DBMS_LOB.LOB_READWRITE);
    dbms_output.ENABLE(1000000);
    FOR i IN 1..1092 loop
    v_str := '<tr>' ||
    '<td style="">' ||
    i || '</td>' ||
    '</tr>';
    dbms_lob.writeappend(lob_loc => int_html, amount => LENGTH(v_str), BUFFER => v_str);
    END LOOP;
    dbms_output.put_line( 'The length of int_html is:'||dbms_lob.getlength(int_html));
    begin
    dbms_output.put_line( 'The int_html is:'||int_html);
    dbms_output.put_line( 'The length of int_html is:'||dbms_lob.getlength(int_html));
    exception when others then
    dbms_output.put_line(SQLCODE||'-'||SQLERRM);
    end;
    begin
    final_html:= '<html>'||int_html||'</html>';
    dbms_output.put_line('The final_html is:'||final_html);
    exception when others then
    dbms_output.put_line(SQLCODE||'-'||SQLERRM);
    end; */
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLCODE||'-'||SQLERRM);
    DBMS_LOB.CLOSE (int_html);
    DBMS_LOB.CLOSE (final_html);
    DBMS_LOB.FREETEMPORARY(int_html);
    DBMS_LOB.FREETEMPORARY(final_html);
    END;
    Edited by: Jitesh Gurnani on Jul 29, 2011 3:11 AM
    Edited by: Jitesh Gurnani on Jul 29, 2011 3:14 AM

  • Plugin tab menu  - ORA-06502: PL/SQL: numeric or value error

    Hi All ,
    i import Tab menu and I want to use only the horizontal menu.
    http://www.apex-plugin.com/oracle-apex-plugins/odtug-competition/tab-menu_203.html
    I am getting following error.
    " Error in PLSQL code raised during plug-in processing.
    ORA-06502: PL/SQL: numeric or value error "
    this my account
    workspace : BUS_SOL
    username : test
    password : test123
    Application name test123
    I imported following component
    1.region_type_plugin_net_vanbaren_apex_tab_menu_v1.01.sql2 in plugin
    2.Theme_page_templates_A4.2.sql in theme
    3.Tabmenu_verticale.css in css
    I have no idea where I have to specify the tab and sub tab names.
    It will be really helpful . if some one help on this.
    Thank you
    Karthik

    Karthik
    Karthik C wrote:
    I have no idea where I have to specify the tab and sub tab names.
    The parent and standard tabs are defined at Shared Components > Tabs.
    The basic idea of the plugin is to use the native tab concept of apex to make a "drop down" menu.
    For a "drop down" menu you have to have two levels. So parent tabs and standard tabs. (Shared components > tabs)
    The demo application you have in your apex.oracle.com workspace uses only one level of tabs (Only standard tabs). So the plugin will not work in this application.
    Unfortunately there is no way of a application that is set up for one level tabs to turn into a two level tabs application. So please set up a new two level tab application before we go in more detail of how to use the plugin.
    If you're going to use this plugin in a new applcation please please please start using lists instead of tabs.
    List give more options than tabs.
    List can have more than 2 levels. Tabs can have a maximum of 2 tabs and then only if you defined the application as 2 levels at creation.
    And swiching a sublist entry between parents is just setting a different parent for the entry. For the tabs you not only need to change the standerd tab but also the page it references.
    And in this case the most relevant there is already a drop down menu as list template. So there is no neason to use this plugin that needs isn't exactly plug and play.
    Nicolette

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

    Hello,
    I am new to Oracle Apex so I decided to read and do the tutorials that are on the apex.oracle.com site.
    Now I am at the tutorial 6: How to Work with Check Boxes of the Advanced Tutorials.
    At a certain point you have to add a new radio button.
    At the Item Source Value you have to add SELECT 'Y' FROM DUAL WHERE :P2_LIST_PRICE*0.75=:P2_MIN_PRICE.
    But when I try to create the item, I keep getting the following error:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Error creating item.
    Does anybody know what could be the problem.
    Thanks in advance.

    CREATE OR REPLACE PROCEDURE xxbb_query (
    p_branch_code XXBOB_HRMS_APPRAISALS_DATA.Branch_code%TYPE,
    p_PERIOD_NAME XXBOB_HRMS_APPRAISALS_DATA.PERIOD_NAME%TYPE
    IS
    emp_refcur SYS_REFCURSOR;
    v_deposits XXBOB_HRMS_APPRAISALS_DATA.deposits%TYPE :=0;
    v_branch_code XXBOB_HRMS_APPRAISALS_DATA.branch_code%TYPE:=0;
    p_query_string VARCHAR2(500);
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Hello' || ' ' || '...');
    p_query_string := 'SELECT Avg(deposits) Dep,branch_code  FROM XXBOB_HRMS_APPRAISALS_DATA WHERE ' ||
    *' Branch_code = :branch_code '||*
    *' AND PERIOD_NAME = SubStr( :PERIOD_NAME ,1,4))||(SubStr( :PERIOD_NAME ,InStr( :PERIOD_NAME ,'-',1,1)+3,5)) ' ||*
    *' group BY SubStr(PERIOD_NAME,5),BRANCH_CODE ';*
    DBMS_OUTPUT.PUT_LINE('Hi' || ' ' || '...');
    OPEN emp_refcur
    FOR p_query_string USING p_branch_code,v_p_PERIOD_NAME,v_p_PERIOD_NAME,v_p_PERIOD_NAME;
    -- DBMS_OUTPUT.PUT_LINE('----- -------');
    Here I m passing a string variable to pass the select statement for the ref cursor.
    There seems some problem in the substr conversion in the statement.
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    But when i run as a independent staement passing real values in the place of placeholders
    i get the result right.
    The *:PERIOD_NAME* format is *'Jan-2009-10'* .
    And I need to pass the *:PERIOD_NAME* to the query as *'Jan-09-10'*
    Pls suggest.
    Edited by: user7391361 on Jul 23, 2009 8:28 AM

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

    Hello Gurus,
    I keep getting the following error:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    It happens on wizard generated tabular form.
    DECLARE
    v_venue_prsntd_qtr varchar2(3);
    v_venue_prsntd_fy  number;
    BEGIN
    FOR i IN 1 .. apex_application.g_f02.COUNT
      LOOP
        IF apex_application.g_f05 (i) IS NOT NULL THEN
            v_venue_prsntd_qtr :=
             Case WHEN TO_CHAR(apex_application.g_f05 (i), 'MON') IN ('OCT','NOV','DEC') THEN '1'
                  WHEN TO_CHAR(apex_application.g_f05 (i), 'MON') IN ('JAN','FEB','MAR') THEN '2'
                  WHEN TO_CHAR(apex_application.g_f05 (i), 'MON') IN ('APR','MAY','JUN') THEN '3'
                  ELSE '4'
                  END;
      -- INTO v_venue_prsntd_qtr
      -- FROM venue_prsntd
      -- WHERE venue_prsntd_seqno = apex_application.g_f02 (i)
      -- AND dfcy_seqno = apex_application.g_f03 (i)
      -- AND apex_application.g_f05 (i) IS NOT NULL;
    ----fiscal year
    --    v_venue_prsntd_fy :=
    --       CASE WHEN TO_CHAR(TO_NUMBER(TO_CHAR(apex_application.g_f05(i), 'MMDD'))) < 1001 THEN --------TO_CHAR(apex_application.g_f05 (i),'YYYY')
    --        ELSE TO_CHAR(TO_NUMBER(TO_CHAR(apex_application.g_f05 (i),'YYYY')) + 1)
    --      END;
       --  INTO v_venue_prsntd_fy
       --  FROM venue_prsntd
       --  WHERE venue_prsntd_seqno = apex_application.g_f02 (i)
       --  AND dfcy_seqno = apex_application.g_f03 (i)
       --  AND apex_application.g_f05 (i) IS NOT NULL;
    ---END IF;
      --- IF apex_application.g_f02 (i) IS NULL AND apex_application.g_f05 (i) IS NOT NULL Then
              -- INSERT INTO venue_prsntd(venue_prsntd_qtr, venue_prsntd_fy)
              --                   VALUES(v_venue_prsntd_qtr, v_venue_prsntd_fy);
                 UPDATE VENUE_PRSNTD
                      SET VENUE_PRSNTD_QTR = to_number(v_venue_prsntd_qtr)
                         -- VENUE_PRSNTD_FY = v_venue_prsntd_fy
                 WHERE VENUE_PRSNTD_SEQNO = APEX_APPLICATION.G_F03(i);
    END IF;
    END LOOP;
    END;I am trying to update venue_prsntd_qtr. I have commented everything else out to see if I can limit where the error is coming from.
    qtr is a number field in the database. I have gone back and forth with variable type in the code and still get the same error.
    I am using oracle db 10g, apex 3.2.1
    Thanks
    Mary

    Hi,
    I am guessing that apex_application.g_f05 is a date field. If that is the case, you need to use to_date() before using to_char(). For example:
    SELECT to_char('01-jan-10', 'MON') FROM dual -- Error!
    SELECT to_char(to_date('01-jan-10'), 'MON') FROM dual -- Ok!
    I hope this helps.
    Luis

  • Invalid function body condition: ORA-06502: PL/SQL: numeric or value error:

    I'm trying to customize my link column on an interactive report to branch to another page in my application based on a pl/sql call. My condition type for the link column is pl/sql function body returning a boolean. I'm calling a packaged function that returns a boolean but receive the following error:
    Invalid function body condition: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    This is my code:
    return files_util.list_files('test','test');
    I've tried running the same code in sqlplus and it works fine. Any help would be appreciated.
    Thanks,
    Rob

    It turns out I had multiple issues. I thought the code I was running for the link column would be executed and let me branch to another page to view the results of my pl/sql code. It appears that the pl/sql code for the link column only controls whether the link is displayed or not. The reason for the ora-6502 was because a variable in my pl/sql function was not large enough to hold a value based on the userid signing onto the application. I'm using database authentication so I thought that the userid in apex would be my database userid which is only 4 characters. The userid actually used is apex_public_user which caused by ora-6502 error.

Maybe you are looking for

  • Windows 7 x64 - headphone jack no sound

    has anyone gotten the sound to work out of the headphone jack? i got audio and microphone working by installing the latest Cirrus Logic driver - CS4206A (AB99), i think it's the latest, i got it from Cirrus website and it's the last one on the list,

  • Replica tree includes invalid IP address

    I just recently updated the IP address on the server via the system preferences pane, and modified the DNS record to reflect this change; however, after doing so, the old IP address remains within the "Replica Tree" and appears to be causing issues (

  • Adobe Captivate 7- Event Video not connecting & Web Object not working

    Greetings all. I hope you may be able to assist me. I am subscribed to Adobe Captivate 7. I am running Windows 7 on a 32 bit computer. The system is set up on a business network and I have verified the installation of Captivate is accurate and up to

  • Scane won't open

    Guess I don't understand the format here because the above do not answer my question. My question is still: I have Windows 7, and HP Officejet4500 My scans show up in "My Scans" but will not open. I receive the following message: When I scan a docume

  • CC desktop update

    I get an error when updating the CC desktop. I'm running 10.7.5