Character to number convertion --- APEX Checkbox

Hi ,
I have table column like category here i stored the value as 1:2:3:4 using APEX checkbox.
Now i want to change as 1,2,3,4
i used replace function but its giving the char value only i want to change it as a number.
Can anyone help me out this problem.
Thanks in advance....
cheers,
Shan..

1,2,3 is not a number - it is three numbers so you need an array or a table to store that.
Go to SQL Workshop and create this table:
CREATE TABLE emp_numbers (empno NUMBER);after that run this PL/SQL block and enter 1:2:3:4 for your :p1_emps
DECLARE
   l_vc_arr2   htmldb_application_global.vc_arr2;
BEGIN
   l_vc_arr2 := HTMLDB_UTIL.string_to_table (:p1_emps);
   FOR i IN 1 .. l_vc_arr2.COUNT
   LOOP
      INSERT INTO emp_numbers
                  (empno
           VALUES (l_vc_arr2 (i)
   END LOOP;
END;See what you get inserted into your table.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

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

  • Error ORA-06502, numeric or value error character to number conversion

    I have been trying to create an email including data from a table as part of the body. Whenever I try to send it, I get an error ORA-06502, numeric or value error, character to number conversion. If I take out the part referencing the table, the email will go without error, but if I put it back in I get the error.
    There is the code:
    DECLARE
    v_email_body CLOB;
    v_from_email_address VARCHAR2(100) := v('APP_USER');
    v_id NUMBER;
    BEGIN
    v_email_body := 'Please pay the attached invoice from FY '||:P14_FY||' funds
    Date: '||:P14_PURCHASE_DATE||'
    Vendor: '||:P14_VENDOR||'
    Invoice Number: '||:P14_INVOICE||'
    Invoice Date: '||:P14_INVOICE_DT||'
    Due Date: '||:P14_INVOICE_DUE_DT||'
    KSR Number: '||:P14_KSR||'
    DTS PO: '||:P14_DTS_PO||'
    FINANCE DO: '||:P14_FINANCE_PO||'
    FOR detail IN(SELECT OB_CODE
    FROM BUDGET_USED
    WHERE P_ID = :P14_ID)
    v_email_body := v_email_body||detail.OB_CODE||utl_tcp.crlf;
    LOOP
    FOR detail2 IN (SELECT ob_code, amount
    FROM budget_used
    WHERE p_id = :P14_ID)
    LOOP
    v_email_body := v_email_body||detail2.ELCID||' - '||detail2.AMOUNT||utl_tcp.crlf;
    END LOOP;
    END LOOP;
    v_email_body := v_email_body
    '||:P14_EMAIL_NOTES||'
    Thanks.
    v_id := APEX_MAIL.SEND
    (p_to => :P14_SUBMIT_TO
    ,p_cc => v('APP_USER')
    ,p_bcc => '[email protected]'
    ,p_from => v_from_email_address
    ,p_body => v_email_body
    ,p_subj => 'Invoice, '||:P14_VENDOR||', '||:P14_INVOICE||'');
    --Having set up your email, now add one (or more) attachments...
    FOR c1 in (SELECT FILENAME
    ,BLOB_CONTENT
    ,MIME_TYPE
    FROM file_subjects f, apex_application_files a
    where a.name = f.name
    and f.P_ID = :P14_ID) LOOP
    IF c1.blob_content IS NOT NULL THEN
    APEX_MAIL.ADD_ATTACHMENT( p_mail_id => v_id,
    p_attachment => c1.blob_content,
    p_filename => c1.filename,
    p_mime_type => c1.mime_type);
    END IF;
    END LOOP;
    END;
    Apex_mail.push_queue();
    This is important to my company to be able to put this data into an email. If anyone can help me, I would greatly appreciate it. Thank you in advance.

    Lets isolate the erroring line by running the code in debug mode and adding some debug lines at various stages in the code
    Apex has a builtin function named wwv_flow.debug which can print messages to the debug stack and would be visible when the page is run in debug mode.
    DECLARE
    v_email_body CLOB;
    v_from_email_address VARCHAR2(100) := v('APP_USER');
    v_id NUMBER;
    BEGIN
    wwv_flow.debug('BEGIN');
      v_email_body := 'Please pay the attached invoice from FY '||:P14_FY||' funds
      Date: '||:P14_PURCHASE_DATE||'
      Vendor: '||:P14_VENDOR||'
      Invoice Number: '||:P14_INVOICE||'
      Invoice Date: '||:P14_INVOICE_DT||'
      Due Date: '||:P14_INVOICE_DUE_DT||'
      KSR Number: '||:P14_KSR||'
      DTS PO: '||:P14_DTS_PO||'
      FINANCE DO: '||:P14_FINANCE_PO||'
      '||:P14_EMAIL_NOTES||'
      Thanks.
    wwv_flow.debug('Before sending mail');
      v_id := APEX_MAIL.SEND
      (p_to => :P14_SUBMIT_TO
      ,p_cc => v('APP_USER')
      ,p_bcc => '[email protected]'
      ,p_from => v_from_email_address
      ,p_body => v_email_body
      ,p_subj => 'Invoice, '||:P14_VENDOR||', '||:P14_INVOICE||'');
    wwv_flow.debug('Before attachements');
      --Having set up your email, now add one (or more) attachments...
      FOR c1 in
             (SELECT FILENAME
            ,BLOB_CONTENT
            ,MIME_TYPE
            FROM file_subjects f, apex_application_files a
            where a.name = f.name
            and f.P_ID = :P14_ID)
      LOOP
        IF c1.blob_content IS NOT NULL THEN
        APEX_MAIL.ADD_ATTACHMENT( p_mail_id => v_id,
        p_attachment => c1.blob_content,
        p_filename => c1.filename,
        p_mime_type => c1.mime_type);
        END IF;
      END LOOP;
    wwv_flow.debug('Finished attachements'); 
      Apex_mail.push_queue();
    END;What is the last message you see in the debug after running the page in debug mode and submitting it ?

  • Conversion character to number

    Hi all,
    I want to know., whether we can able to convert character to number as follows.
    Eg.,.
    select * from abcd;
    Values
    four thousand fifty
    three thousand
    two thousand
    I want the o/p as:-
    values
    4050
    3000
    2000
    Is it possible to get the desired output. Please help me out.
    Thanks in advance!!!

    Whilst oracle provides a nice way of getting from numbers to words, it doesn't really provide much to get back the other way.
    Here's a little something I wrote a while back...
    create or replace function word2num(p_words IN VARCHAR2) return number is
      p_word varchar2(4000) := p_words;
      type mynums is table of number index by varchar2(30);
      type myquals is table of number index by varchar2(30);
      v_nums mynums;
      v_quals myquals;
      v_word VARCHAR2(30);
      v_resval NUMBER := 0;
      v_tmpresval NUMBER := 0;
      v_val    NUMBER;
      v_switch NUMBER := 0;
      FUNCTION get_word(v_str IN OUT VARCHAR2) RETURN varchar2 IS
        v_ret VARCHAR2(30);
      BEGIN
        IF INSTR(v_str,' ') = 0 THEN
          v_ret := v_str;
          v_str := '';
        ELSE
          v_ret := SUBSTR(v_str, 1, INSTR(v_str, ' ')-1);
          v_str := SUBSTR(v_str, INSTR(v_str, ' ')+1);
        END IF;
        RETURN v_ret;
      END;
    begin
      v_nums('ZERO') := 0;
      v_nums('ONE') := 1;
      v_nums('TWO') := 2;
      v_nums('THREE') := 3;
      v_nums('FOUR') := 4;
      v_nums('FIVE') := 5;
      v_nums('SIX') := 6;
      v_nums('SEVEN') := 7;
      v_nums('EIGHT') := 8;
      v_nums('NINE') := 9;
      v_nums('TEN') := 10;
      v_nums('ELEVEN') := 11;
      v_nums('TWELVE') := 12;
      v_nums('THIRTEEN') := 13;
      v_nums('FOURTEEN') := 14;
      v_nums('FIFTEEN') := 15;
      v_nums('SIXTEEN') := 16;
      v_nums('SEVENTEEN') := 17;
      v_nums('EIGHTEEN') := 18;
      v_nums('NINETEEN') := 19;
      v_nums('TWENTY') := 20;
      v_nums('THIRTY') := 30;
      v_nums('FORTY') := 40;
      v_nums('FIFTY') := 50;
      v_nums('SIXTY') := 60;
      v_nums('SEVENTY') := 70;
      v_nums('EIGHTY') := 80;
      v_nums('NINETY') := 90;
      v_quals('HUNDRED') := 100;
      v_quals('THOUSAND') := 1000;
      v_quals('MILLION') := 1000000;
      v_quals('BILLION') := 1000000000;
      v_quals('TRILLION') := 1000000000000;
      v_quals('QUADRILLION') := 1000000000000000;
      v_quals('QUINTILLION') := 1000000000000000000;
      v_quals('SEXTILLION') := 1000000000000000000000;
      v_quals('SEPTILLION') := 1000000000000000000000000;
      v_quals('OCTILLION') := 1000000000000000000000000000;
      v_quals('NONILLION') := 1000000000000000000000000000000;
      v_quals('DECILLION') := 1000000000000000000000000000000000;
      v_quals('UNDECILLION') := 1000000000000000000000000000000000000;
      v_quals('DUODECILLION') := 1000000000000000000000000000000000000000;
      LOOP
        EXIT WHEN p_word IS NULL;
        v_word := get_word(p_word);
        BEGIN
          v_val := v_nums(v_word);
          v_resval := v_resval + v_tmpresval;
          v_tmpresval := v_val;
        EXCEPTION
          WHEN NO_DATA_FOUND THEN
            BEGIN
              v_val := v_quals(v_word);
              IF v_val >= v_switch THEN
                v_resval := v_resval*v_val;
              END IF;
              v_tmpresval := v_tmpresval*v_val;
              v_switch := v_val;
            EXCEPTION
              WHEN NO_DATA_FOUND THEN
                DBMS_OUTPUT.PUT_LINE('Error In Number String : '||v_word);
            END;
        END;
      END LOOP;
      v_resval := v_resval + v_tmpresval;
      RETURN v_resval;
    END;
    SQL> col result format 9999999999999999999999999999
    SQL> select word2num('FOUR TRILLION THIRTY THOUSAND SEVENTY FOUR') as result from dual;
                           RESULT
                    4000000030074
    SQL>Edited by: BluShadow on Sep 3, 2009 1:35 PM
    Please note, the exception handling is not implemented ideally. This function was created for the fun of it.

  • 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

  • Numeric or value error: character to number conversion error

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

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

  • Re: Error, numeric or value error: character to number conversion error

    Can someone please please tell me why I'm getting this error and what I'm doing wrong? It looks like a simple error, "numeric or value error: character to number conversion error".
    My code is as follows:
    string connectionString = WebConfigurationManager.ConnectionStrings["DEMO_TEST"].ConnectionString;
    OracleConnection con = new OracleConnection(connectionString);
    OracleCommand cmd = new OracleCommand("DEMO.PKG_LOCATION_TYPE.INS", con);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add(new OracleParameter("@P_DESCRIPTION", OracleDbType.Varchar2, 60));
    cmd.Parameters["@P_DESCRIPTION"].Value = "Test_Description";
    cmd.Parameters.Add(new OracleParameter("@P_NAME", OracleDbType.Varchar2, 6));
    cmd.Parameters["@P_NAME"].Value = "Test_Name";
    cmd.Parameters.Add(new OracleParameter("@P_LOCATION_TYPE_CD", OracleDbType.Decimal, 4));
    cmd.Parameters["@P_LOCATION_TYPE_CD"].Direction = ParameterDirection.InputOutput;
    con.Open();
    try
    cmd.ExecuteNonQuery();
    catch
    //In case of an error
    finally
    con.Close();
    con.Dispose();
    And I recieve the following error block:
    Oracle.DataAccess.Client.OracleException was unhandled by user code
    Message="ORA-06502: PL/SQL: numeric or value error: character to number conversion error\nORA-06512: at line 1"
    Source="Oracle Data Provider for .NET"
    DataSource="demotest"
    Number=6502
    Procedure="DEMO.PKG_LOCATION_TYPE.INS"
    StackTrace:
    at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
    at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
    at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
    at System.Web.UI.WebControls.Wizard.OnFinishButtonClick(WizardNavigationEventArgs e)
    at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
    at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args)
    at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    ********************************************************

    Are the parameters in your procedure in the same order as they are created in this code? Oracle command works by position unless you change it to be BindByName.
    Failing that you seem to have defined a parameter (P_NAME) to have a length of 6, and are then setting it's value to a string with a length of 9.
    Also the in/output parameter is defined as type decimal. Is this correct? It is defined as InputOutput but you don't assign it any value.
    If these suggestions don't help then perhaps if you post the stored procedure you might get some more ideas.
    HTH
    Lyndon

  • PL/SQL: numeric or value error: character to number conversion error in TRG

    Hi,
    I've got strange issue with one trigger which during update of table reports (DB is 9.2.0.8):
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "UDR_LOG", line 345
    ORA-04088: error during execution of trigger 'UDR_LOG'but line 345 is:
    END IF;
    so its kind of strange
    the code looks like
    343 IF nvl(to_char(:old.PKD_ID),'''') <> nvl(to_char(:new.PKD_ID),'''') THEN
    344     v_zmn := v_zmn || 'PKD_ID''' || to_char(:old.PKD_ID) || '''' || to_char(:new.PKD_ID) || '''';
    345    END IF;
    so its concatenation not to_number usage .error is triggered by update statement on any column .
    I'm sorry I cant provide You with whole trigger code .
    So if You could only recommend any investigation method that would be great .
    Regards
    Greg

    Hi, Greg,
    When there's an error in a trigger, the line numbers in the error messages are relative to the first DECLARE or BEGIN statement; often, that's a few lines after CREATE OR REPLACE TRIGGER. Post a few lines after what you already posted.
    If you can't find the error, then create another table for testing this, and create a smaller trigger on that table, which does only enough to cause the error. Then you'll be able to post the complete trigger, and the code needed to re-create the problem.

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

    Hi,
    when I do same thing in my procedure it throws below error but it works fine as annonymus block.
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    CREATE TABLE test_table
    (memberid NUMBER,
    trans_date date);
    DECLARE
    v_num number(10,0);
    v_text varchar2(100);
    begin
    v_text := '123456abcdef';
    v_num := substr(v_text,1,5);
    INSERT INTO test_table
    (memberid,
    trans_DATE)
    VALUES
    (v_num,
    sysdate);
    end;Thanks
    Sandhya

    Works fine as a procedure as well;
    SQL> DECLARE
      2  v_num number(10,0);
      3  v_text varchar2(100);
      4  begin
      5  v_text := '123456abcdef';
      6  v_num := substr(v_text,1,5);
      7  INSERT INTO test_table
      8  (memberid,
      9  trans_DATE)
    10  VALUES
    11  (v_num,
    12  sysdate);
    13  end;
    14 
    15  /
    PL/SQL procedure successfully completed.
    SQL> select * from test_table;
      MEMBERID TRANS_DAT
         12345 20-MAY-10
    SQL> create or replace procedure ins_test_table as
      2 
      3    v_num number(10,0);
      4  v_text varchar2(100);
      5  begin
      6  v_text := '123456abcdef';
      7  v_num := substr(v_text,1,5);
      8  INSERT INTO test_table
      9  (memberid,
    10  trans_DATE)
    11  VALUES
    12  (v_num,
    13  sysdate);
    14 
    15  end ins_test_table;
    16  /
    Procedure created.
    SQL>
    SQL> exec ins_test_table;
    PL/SQL procedure successfully completed.
    SQL> select * from test_table;
      MEMBERID TRANS_DAT
         12345 20-MAY-10
         12345 20-MAY-10

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

    I met the following error when I ran Donald's PL/SQL function to_number_or_null. Could somebody here help me find the resolution? Thanks!
    SQL> create or replace FUNCTION to_number_or_null (
    2 aiv_number in varchar2 )
    3 return number is
    4 /*
    5 to_number_or_null.fun
    6 by Donald J. Bales on 12/15/2006
    7 An errorless to_number( ) method
    8 */
    9 begin
    10 return to_number(aiv_number);
    11 exception
    12 when INVALID_NUMBER then
    13 return NULL;
    14 end to_number_or_null;
    15 /
    Function created.
    SQL> select to_number_or_null('A') from dual;
    select to_number_or_null('A') from dual
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "CAROL.TO_NUMBER_OR_NULL", line 10

    Only INVALID_NUMBER exception is handled and also VALUE_ERROR should be handeled. You can resolve it by handling VALUE_ERROR exception or by adding WHEN OTHERS as I did in following example.
    SQL> create or replace FUNCTION to_number_or_null (
      2      aiv_number in varchar2 )
      3      return number is
      4     /*
      5     to_number_or_null.fun
      6     by Donald J. Bales on 12/15/2006
      7     An errorless to_number( ) method
      8     */
      9  begin
    10     return to_number(aiv_number);
    11     exception
    12     when INVALID_NUMBER then
    13      return NULL;
    14     when OTHERS then
    15      return null;
    16     end to_number_or_null;
    17  /
    Function created.
    SQL> select to_number_or_null('A') from dual;
    TO_NUMBER_OR_NULL('A')
    ----------------------With kind regards
    Krystian Zieja

  • How can if find the most repeated character and number ???

    Hi,
    I have a question. For instance, if we have a text file which contains:
    aaabbbhhhhhhtttttsjs12366
    How can i find the most repeated character and number. I have to add this code to the following program:
    I will aprreciate if you can help.
    Regards,
    Serkan
    import java.io.*;
    public class LineLen {
         public static void main(String args[]) throws Throwable {
              final String filename = "deneme1.txt";
              BufferedReader infile = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
              String line = infile.readLine();
              int linenum = 0;
              while (line != null) {
                   int len = line.length();
                   linenum++;
                   System.out.print(linenum + "\t");
                   for (int i = 0; i<len; i++)
                   System.out.print("*");
                   System.out.println("");
                   line = infile.readLine();
    }

    For a small alphabet like English, array migt be used:
    //in a for loop
    ++array[s.charAt(i)];For a big alphabet like chinese, HashMap might be barely used:
    map.put(s.charAt(i), increment(map.get(s.charAt(i))));
    // increment is a user defined method, possibly for an Integer object,
    // that returns a new Integer object

  • PL/SQL Character to date convertion issue

    Dear all,
    I encounter an issue with character to date convertions in PL/SQL.
    The following is a short description:
    I use an Oracle DBMS 8i and the problem is a wrong insertion of a date value to a column table.
    The date value is retrieved from a table and is type of VARCHAR2(240). Then a convertion to the DATE type takes place and this value (date) is inserted to another table column of type DATE.
    For example if the date retrieved as VARCHAR2 is '21/05/2003' the value inserted is '21/5/0003'.
    The convertion is made by the following portion of code:
    dateVariable Date := NULL:
    dateStringVariable is retrieved from the db and is type of VARCHAR2(240)
    DATE_FORMAT is a string retireved from the db with value equals to 'DD/MM/YYYY HH24:MI:SS'
    dateVariable := TO_DATE(dateStringVariable, DATE_FORMAT);
    Then the dateVariable is inserted to a recordSet which in turn is the one inserted to the db.
    My guess is that the problem is during the char to date convertion.
    I wonder if anyone knows what produces this error.
    Any suggestion is welcome.
    With regards

    SQL> desc t
    Name                                      Null?    Type
    DATE#                                              DATE
    SQL> alter session set nls_date_format = 'DD-MON-RR';
    Session altered.
    SQL> select * from t;
    no rows selected
    SQL> insert into t values(to_date('21/05/2003','DD/MM/YYYY'));
    1 row created.Now Oracle keeps correct date - 21th of May 2003.
    How you display it depends on your NLS_DATE_FORMAT settings:
    SQL> select * from t;
    DATE#
    21-MAY-03
    SQL> alter session set nls_date_format = 'MM/DD/YYYY';
    Session altered.
    SQL> select * from t;
    DATE#
    05/21/2003So now try to do
    SELECT to_char(<<your new date column>>,'DD/MM/YYYY') from <<your table>>
    to be sure your date is kept right.
    Rgds.

  • Why teststand can not display the ASCII character which number up to 128?

    Hello All,
            I have encountered a problem on an application for ASCII character,why teststand can not display the ASCII character which number up to 128?
           For example:an expression  Local.xx=Chr(164),
           xx-->string,I can not get the correct string.
           Have any idea for this?
    OS:WinXP,Teststand2012 SP1.
           Thanks a lot.
    Solved!
    Go to Solution.

    dug9000 wrote:
    [...]On Windows 7 at least, the code page setting for the operating system is located in the "Region and Language" control panel in the "Administrative" tab where it says "Language for non-Unicode programs".
    Hope this helps,
    -Doug
    Ah, that explains why i see "European Set"....
    One question, Doug: Obviously, you can select only the localization there. Is this PostScript Characters for all languages? Or is it possible to switch to something like true types, e.g. "Wingdings"? (I know, bad example, but i hope you get the point)
    thanks,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Character + sequence number

    Hi, How can I generate a unique id with a "character" + "sequence number"? Thanks,

    Something along the lines of:
    SQL> CREATE SEQUENCE my_seq;
    Sequence created.
    SQL> SELECT 'AB'||TO_CHAR(my_seq.NEXTVAL,'FM99999999999')
      2  FROM DUAL;
    'AB'||TO_CHAR(
    AB1or, if you want a fixed length value with the sequence 0 filled, which would be better for sorting, then:
    SQL> SELECT 'AB'||TO_CHAR(my_seq.NEXTVAL,'FM000000000')
      2  FROM dual;
    'AB'||TO_CHA
    AB000000002HTH
    John

Maybe you are looking for

  • Looking for an app that allows a contact to ring even in silent mode

    Has anyone come across an app yet that will allow the phone to still ring even in silent mode? I want to be able to NOT hear any of the emails or texts at night when I go to sleep but at the same time, I want to be able to have the phone ring through

  • Dynamically assign the file name for "on demand read"

    Hi. A quick question. I need to poll a directory using the on demand read function of the FB component, and change the file name in the BPEL process. Basically I need to dynamically overwrite the destination file name at runtime. These are the steps

  • Alarm problem solve

    Most likely it the app notification. Settings nitivications apps and check alarm app and turn nitivications back on. This did it for me. When I got the phone, I turned of some of them and the problem started

  • IWork 09 Family Pack

    What is the difference between iWork 09 and the iWork 09 Family Pack?

  • What's coming next in Adobe Media Encoder

    what's coming in the next major update to Adobe Media Encoder, including DCP export and AS-11 export: http://adobe.ly/Pj4i4w