Pl/sql function replying invalid number error

Hi,
I don't know if it's the late hour or I'm just missing something...
I wrote a very simple function which is compiling, but returning ORA error 017222 - nvalid number, every time it's executed...
Please let me know what am I missing...
Thanks!
create or replace
FUNCTION GAMES(
MINUTE_PLAYED IN NUMBER,
HOME_GOALS IN NUMBER,
AWAY_GOALS IN NUMBER)
RETURN NUMBER IS
HOME VARCHAR2(100);
AWAY VARCHAR2(100);
RELEVANT_GAMES NUMBER;
BEGIN
HOME := 'MIN' || MINUTE_PLAYED || 'HOME';
AWAY := 'MIN' || MINUTE_PLAYED || 'AWAY';
SELECT COUNT(*) INTO RELEVANT_GAMES
FROM FINISHED_GAMES
WHERE HOME = HOME_GOALS AND AWAY = AWAY_GOALS;
RETURN RELEVANT_GAMES;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
END GAMES;

869206 wrote:
Hi,
I don't know if it's the late hour or I'm just missing something...
I wrote a very simple function which is compiling, but returning ORA error 017222 - nvalid number, every time it's executed...
Please let me know what am I missing...
Thanks!
create or replace
FUNCTION GAMES(
MINUTE_PLAYED IN NUMBER,
HOME_GOALS IN NUMBER,
AWAY_GOALS IN NUMBER)
RETURN NUMBER IS
HOME VARCHAR2(100);
AWAY VARCHAR2(100);
RELEVANT_GAMES NUMBER;
BEGIN
HOME := 'MIN' || MINUTE_PLAYED || 'HOME';
AWAY := 'MIN' || MINUTE_PLAYED || 'AWAY';
SELECT COUNT(*) INTO RELEVANT_GAMES
FROM FINISHED_GAMES
WHERE HOME = HOME_GOALS AND AWAY = AWAY_GOALS;
RETURN RELEVANT_GAMES;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
END GAMES;eliminate EXCEPTION handler!
do NOT rely on implicit datatype conversion
use TO_CHAR or TO_NUMBER as needed.
HOME & HOME_GOALS are different datatype

Similar Messages

  • Pl/SQL is prompting "invalid number" error

    Hello Sir/Madam,
    I'm not very clear why pl/sql cursor is prompting "invalid number" error.
    I need to load single as well as multi Gas meter data for an automation process.  The procedure is loading single meter data fine, but when I add multi meter data to that table it is halting and prompting "invalid number".  I made sure that each record is unique. Define primary key based on three field ( they are: SERVICEPOINTID, METERID, and ENDDATE )
    in the sample file, they are in that order
    I would appricaite your help & explantions on this issue
    sample procedure code:
    CREATE OR REPLACE procedure GSO_SBX_ADMIN.row_add_v2 is
    rct_cnt number := 0;
        header_key gso_hourlylog_header.hrly_log_hdr_ky%TYPE;
        dailyorder_key gso_hourlylog_header.DLY_ORDER_KY%TYPE;
        customer_key gso_customer_log.CUST_KY%TYPE;
        channel_key gso_cust_channel_privs.CHNNL_KY%TYPE;
        custlog_key gso_customer_log.CUST_LOG_KY%TYPE;
        hourly_custlog_detail_key gso_hourly_cust_log_detail.HRLY_CUST_LOG_DTL_KY%TYPE;
        customer_name GSO_CUSTOMER_LOOKUP.CUST_NM%TYPE;
        row_processing_status VARCHAR2(100) := '';
        other_customerlog_issue VARCHAR2(5) := 'FALSE';
        ls_curr_user VARCHAR2(30) := 'GSO_PROCESS_IEE_INTO_GSO';
        record_processable VARCHAR2(5) := '';
        rec_processing_timestamp TIMESTAMP;
    begin
    for daily_gis_add in
            SELECT '', METERID, ENDDATE, HOURENDING, VOLUMEVALUE, CUSTOMERNAME, DEVICEID, CUSTOMERID, SERVICEPOINTID
            FROM GSO_IEE_STAGE gis where  trunc(gis.loaded_dt) = trunc(sysdate)
    loop
    insert into gso_iee_process_log
        VALUES
              rec_processing_timestamp,
              daily_gis_add.METERID,
              daily_gis_add.ENDDATE,
              daily_gis_add.HOURENDING,
              daily_gis_add.VOLUMEVALUE,
              daily_gis_add.CUSTOMERNAME,
              daily_gis_add.DEVICEID,
              daily_gis_add.CUSTOMERID,
              daily_gis_add.SERVICEPOINTID,
              customer_name,
              customer_key,
              channel_key,   
              dailyorder_key,
              header_key,
              custlog_key,
              hourly_custlog_detail_key,
              row_processing_status,
              SYSDATE
            commit;
          rct_cnt := rct_cnt + 1;
      dbms_output.put_line(' rowadded '|| rct_cnt);
    end loop;
    end;
    sample data:
    32096040001 11048610FGI 5/25/2013 10 AM 10 Tower Hill School 1104861000217112 257808404 32096110001 6/21/2013 10:40:18 AM
    26107010002 11086348FGI 5/25/2013 10 AM 10 Emily Bissell Hospital 1108634800050877 261070100 26107010002 6/21/2013 10:40:18 AM
    32101140001 11086356FGI 5/25/2013 10 AM 10 Delaware River Bay Authority 1108635600413231 321011400 32101140001 6/21/2013 10:40:18 AM
    31875230004 110680FGI 5/25/2013 10 AM 10 Arlon Inc. Gas 11068000021253 318752300 31875230004 6/21/2013 11:04:58 AM
    31875230003 110681FGI 5/25/2013 10 AM 10 Arlon Inc. Gas 11068100022092 318752300 31875230003 6/21/2013 11:04:58 AM
    Regards,
    Vani Sonti

    Hello,
    I've commented out or removed the fields that are not listed.. here is the modified code.. I just added the part where is was prompting errors..
    Yes, I tested just now and it is looping and printing all five record counters..
    CREATE OR REPLACE procedure GSO_SBX_ADMIN.row_add_v3 is
    rct_cnt number := 0;
    begin
    for daily_gis_add in
            SELECT '', METERID, ENDDATE, HOURENDING, VOLUMEVALUE, CUSTOMERNAME, DEVICEID, CUSTOMERID, SERVICEPOINTID
            FROM GSO_IEE_STAGE gis where  trunc(gis.loaded_dt) = trunc(sysdate)
    loop
    insert into gso_iee_process_log
       TIMESTAMP_ID,  PREMISEID,METERID,ENDDATE ,HOURENDING,VOLUMEVALUE ,
       CUSTOMERNAME,DEVICEID,CUSTOMERID,SERVICEPOINTID
        VALUES
              SYSDATE,
              daily_gis_add.METERID,
              daily_gis_add.ENDDATE,
              daily_gis_add.HOURENDING,
              daily_gis_add.VOLUMEVALUE,
              daily_gis_add.CUSTOMERNAME,
              daily_gis_add.DEVICEID,
              daily_gis_add.CUSTOMERID,
              daily_gis_add.SERVICEPOINTID
            commit;
          rct_cnt := rct_cnt + 1;
      dbms_output.put_line(' rowadded '|| rct_cnt);
    end loop;
    end;
    Vani

  • To_number function and the "invalid number" error

    Dear all,
    I have searched the forum for threads relating to the ORA-01722: invalid number error, could not find the answer I am looking for.
    What I was trying to do was
    select * from table1 where to_number(field1) > 1000
    field1 is a varchar2 data type.
    I tried all sorts of things i.e using fmt, nls params as defined in the documentation, nothing worked.
    Though the practical problem was solved by
    select * from table1 where field1 > '1000'
    I would still like to know why this error occurs. Can someone help ?
    Regards
    Crusoe

    I think the database engine should simply return the rows that successfully convert to number and meet the where condition Oracle does not work in that way ;)
    Then try this...
    Just you need to add the below where clause to your source query. as this will retrieve only the number, to_number should work without any problem.
    But still you have to create a subquery to escape the invalid number error.
    PRAZY@11gR1> select * from tablea;
    FIELD1
    123
    123.345
    45
    AVC
    23.234.234
    ABC.234
    345.45
    7 rows selected.
    Elapsed: 00:00:00.00
    PRAZY@11gR1> select to_number(field1) from tablea where  rtrim(trim(regexp_replace(field1,'\.','',1,1)),'0123456789') is null;
    TO_NUMBER(FIELD1)
                  123
              123.345
                   45
               345.45
    4 rows selected.
    Elapsed: 00:00:00.01Regards,
    Prazy
    Edited by: Prazy on Mar 23, 2010 4:00 PM

  • ORA-01722: invalid number error when trying to pass a list of values

    Gurus
    We are using a function like so
    The usage for the function below is
    Select fn_st_bb_nm_uc (‘1232131312, 123213312’) from dual;
    SQL> /
    Select fn_st_bb_nm_uc ('1232131312, 123213312') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    It’s giving an invalid number error. When we pass one value it is working fine but when we pass a string of values it gives this error. I have opened an SR around this but would greatly appreciate your help
    Acc_blackbar is the table and acc_blkbr_id is of type number.
    FUNCTION fn_st_bb_nm_uc (pBB_ID_LIST VARCHAR2)
    RETURN VARCHAR2 IS
    vspcm_typ_nm_uc VARCHAR2 (2000);
    CURSOR stname
    IS
    SELECT distinct st.spcm_typ_nm_uc
    FROM
    acc_blackbar abb,
    acc_specimen_type ast, acc_procedure apr,
    acc_specimen_part asp,
    specimen_type st, procedure pr,
    proc_proc_family ppf
    WHERE abb.ACC_BLKBR_ID = apr.ACC_BLKBR_ID
    AND apr.ACC_SPCM_PART_ID = asp.ACC_SPCM_PART_ID
    AND asp.ACC_SPCM_TYP_ID = ast.ACC_SPCM_TYP_ID
    AND ast.ACC_SPCM_TYP_SPCM_TYP_ID = st.SPCM_TYP_ID
    AND apr.procdr_id = pr.PROCDR_ID
    AND pr.PROCDR_ID = ppf.PROCDR_ID
    AND abb.acc_blkbr_id in (pBB_ID_LIST) ;
    BEGIN
    DBMS_OUTPUT.PUT_LINE(' BB LIST : ' || pBB_ID_LIST);
    FOR st IN stname
    LOOP
    vspcm_typ_nm_uc := vspcm_typ_nm_uc || ',' || st.spcm_typ_nm_uc;
    END LOOP;
    vspcm_typ_nm_uc := SUBSTR (vspcm_typ_nm_uc, 2);
    RETURN vspcm_typ_nm_uc;
    END;

    This ask tom thread covers multiple solutions:
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425]

  • Invalid Number Error in IR search bar.

    Hi,
    I am getting an invalid number error when i put a value in search bar without selecting the column name.
    I followed ' "Invalid number" error using Interactive Report search on collection' thread and accordingly
    1) Purged User preferences and session state.
    2) Cleared browser settings and cache.
    3) Deleted old region and Created a new region on the page with the same query.
    If I select a column and search it works fine but when I just give an arrangement id which looks like 'ARR12345' directly in search bar it throws Invalid Number.
    This is working perfectly fine in other environments which is replica of this one.
    I also ran Apex util function to remove sort preferences.
    Also my report is a very simple report like select * from a,b where a.id = b.id.
    Please help me. This is a production issue.
    Thanks a lot in advance.
    Regards
    Garima
    Edited by: 860249 on Nov 4, 2011 11:40 AM

    UPDATE SET as = '1', ad = '1', co = '1', pr = '1', date = localtimestamp, lus = 'username'SELECT * FROM sys.v_$reserved_words;
    SQL> create table test1(as varchar2(10));
    create table test1(as varchar2(10))
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table test1(sno number, date date);
    create table test1(sno number, date date)
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table test1("as" varchar2(10));
    Table created.
    SQL>
    SQL> create table test2(sno number, "date" date);
    Table created.
    SQL> desc test1
    Name                                      Null?    Type
    as                                                 VARCHAR2(10)
    SQL> desc test2
    Name                                      Null?    Type
    SNO                                                NUMBER
    date                                               DATE
    SQL> 

  • TO_NUMBER getting invalid number error

    I want to use TO_NUMBER function to converse some float number,
    but the following query always gets invalid number error:
    select to_number('12.1073') from dual;
    but if I add the format in, it runs as expected:
    select to_number('12.1073', '99.9999') from dual;
    From the syntax, the format parameter is optional, is it only optional for integers?
    Thanks!

    Same here.
    So, or you replace dot by comma, or you change the territory (or nls_numeric_characters) defined for your session :
    SQL> select to_number('12.1073') from dual;
    select to_number('12.1073') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.00
    SQL> alter session set nls_territory='america';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    TO_NUMBER('12.1073')
                 12.1073
    Elapsed: 00:00:00.00
    SQL> alter session set nls_territory='france';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    select to_number('12.1073') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.00
    SQL> alter session set nls_numeric_characters='.,';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    TO_NUMBER('12.1073')
                 12.1073
    Elapsed: 00:00:00.00
    SQL> Nicolas.

  • Recieving ORA-01722 invalid number error while creating a materialized view

    Hi,
    I am receiving a ORA-01722 invalid number error while creating a materialized view. when run the select statement of the view i don't get any error, but when i use the same select statement to create a materialized view i receive this error. Could any please help in resolving this error. Here is the code i am using to create a materialized view.
    CREATE MATERIALIZED VIEW MV_EBS_CH_CLOSED
    REFRESH FORCE ON DEMAND
    AS
    SELECT DISTINCT kr.request_id, org.org_unit_name,
    ebs_ch_ticket_type (kr.request_id) ticket_type,
    DECODE
    (kr.status_code,
    'CLOSED_SUCCESS', kr.last_update_date,
    'IN_PROGRESS', (SELECT MAX (start_time)
    FROM ebs_ch_datastore ecd1
    WHERE kr.request_id = ecd1.request_id
    AND workflow_step_name =
    'Final BA Review and Deployment Exit Criteria')
    ) closed_date,
    substr(krhd.visible_parameter12,1,10) siebel_start_date,
    kr.creation_date itg_start_date
    FROM kcrt_requests kr,
    kcrt_request_types krt,
    kcrt_req_header_details krhd, kcrt_request_details krd1,
    (SELECT koum.user_id user_id,
    DECODE (koup.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    koup.org_unit_name
    ) org_unit_name
    FROM krsc_org_unit_members koum, krsc_org_units koup
    WHERE 1 = 1
    AND 'Y' = koup.enabled_flag
    AND koum.org_unit_id = koup.org_unit_id
    AND EXISTS (
    SELECT 'X'
    FROM krsc_org_units kouc
    WHERE koup.org_unit_id = kouc.org_unit_id
    START WITH kouc.parent_org_unit_id =
    ANY (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units1
    WHERE 'Clearinghouse' =
    org_unit_name)
    CONNECT BY kouc.parent_org_unit_id =
    PRIOR kouc.org_unit_id)
    UNION
    SELECT kou.manager_id user_id,
    DECODE
    (kou.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    kou.org_unit_name
    ) org_unit_name
    FROM krsc_org_units kou
    WHERE 'Y' = kou.enabled_flag
    START WITH kou.parent_org_unit_id =
    (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units2
    WHERE 'Clearinghouse' = org_unit_name)
    CONNECT BY kou.parent_org_unit_id = PRIOR kou.org_unit_id) org
    WHERE krt.request_type_id = kr.request_type_id
    AND krt.request_type_name IN ('Bug Fix', 'IT Enhancement')
    and kr.REQUEST_ID = krd1.request_id
    and krd1.batch_number = 1
    AND kr.request_id = krhd.request_id
    AND org.user_id in (krd1.parameter4, krd1.parameter5, krd1.parameter7)
    AND ( 'CLOSED_SUCCESS' = kr.status_code
    OR 'IN_PROGRESS' = kr.status_code
    AND kr.request_id IN (
    SELECT request_id
    FROM (SELECT DISTINCT request_id,
    MAX
    (start_time)
    closed_date
    FROM ebs_ch_datastore
    WHERE 'Final BA Review and Deployment Exit Criteria' =
    workflow_step_name
    GROUP BY request_id))
    Thanks,
    Shaik Mohiuddin

    This error occurs when you try to create a materialized view , but if you run the sql the results are perfectly fine. Well it happend to me also and to fix this I made sure all the coulmns have the same data type which are used in joins or in where clause.
    use
    where
    to_number(col1)=to_number(col2) and to_number(col3)=to_number(col4)
    hope this helps..

  • Invalid number error for bind dialog

    Oracle SQL Developer version 1.1.2.25 BUILD MAIN-25.79
    Running under WinXP
    Issue description:
    We get an invalid number error when bind variable filled with an enter in the bind dialog

    It is hard to say what is causing your problem without the specifics (ie query and value entered for the bind variable). Try running the same statement with the value of the bind variable in place of the bind variable (ie instead of running "select * from dual where dummy = :var" with a value of 'x' for :var, run "select * from dual where dummy = 'x'"). If you get the same error, then it is not an issue with the use of bind variables.
    Be aware that currently you cannot define the data type of bind variables (unlike TOAD, etc) and they are all treated as character values. I wouldn't have thought that this would cause you problem unless you are using a bind variable to restrict a numeric column to a specific value and you are entering a non-numeric bind (ie "select * from people where person_id = :id" and using 'xyz' as the value for :id).

  • How to determine offending column in ORA-01722: invalid number error ...

    When an error like
    ORA-01722: invalid number error
    occurs and you are dealing with many columns that could be the 'culprit', does anyone have a method by which
    you can quickly determine offending column?

    SQL PLus will tell you:
    SQL> create table t
      2  (col1  number
      3  ,col2  number
      4  ,col3  number
      5  ,col4  number
      6  ,col5  number
      7  );
    Table created.
    SQL> create table x
      2  (col1  varchar2(10)
      3  ,col2  varchar2(10)
      4  ,col3  varchar2(10)
      5  ,col4  varchar2(10)
      6  ,col5  varchar2(10)
      7  );
    Table created.
    SQL> insert into x values ('1','2','x','4','5');
    1 row created.
    SQL> insert into t(col1,col2,col3,col4,col5)
      2  select col1,col2,col3,col4,col5 from x;
    select col1,col2,col3,col4,col5 from x
    ERROR at line 2:
    ORA-01722: invalid numberAnd if you rearrange your sql like this, sql plus will give you the line number of the offending column:
    SQL> insert into t
      2  (col1
      3  ,col2
      4  ,col3
      5  ,col4
      6  ,col5
      7  )
      8  select col1
      9        ,col2
    10        ,col3
    11        ,col4
    12        ,col5
    13  from x;
          ,col3
    ERROR at line 10:
    ORA-01722: invalid number

  • ORA-01722: invalid number error. In Update

    create or replace procedure San_Test (sInNum varchar2, outMsg out varchar2)
    is
    begin
    update mtest set
    mname = 'Success'
    where id in (sInNum);
    commit;
    outMsg :='Success';
    exception
    when others then
    outMsg :='Err';
    dbms_output.put_line(sqlerrm);
    end;
    This is my test sp where i am getting ORA-01722: invalid number error.
    Which is because the column data type is Number of ID and i have sInNum parameter as varchar2.. How can i achieve this ?
    I don't have other way to do this please help.

    Great demonstration for SQL INJECTION, was that part of your OCP training?
    CREATE TABLE mtest (id NUMBER, mname VARCHAR2(255));
    INSERT INTO mtest VALUES (1, 'test');
    INSERT INTO mtest VALUES (2, 'test2');
    COMMIT;
    CREATE OR REPLACE PROCEDURE san_test (sinnum VARCHAR2, outmsg OUT VARCHAR2)
    IS
       mnum     VARCHAR2 (10);
       strsql   VARCHAR2 (250);
    BEGIN
       mnum := REPLACE (sinnum, '''', '');
       strsql :=
           'update mtest set
    mname = ''Success''
    where id in (' || mnum || ')';
       EXECUTE IMMEDIATE strsql;
       COMMIT;
       outmsg := 'Success';
    EXCEPTION
       WHEN OTHERS
       THEN
          outmsg := 'Err';
          DBMS_OUTPUT.put_line (SQLERRM);
    END;
    SELECT *
      FROM mtest;
            ID MNAME
             1 test
             2 test2And now for the fun part:
    SET SERVEROUTPUT ON
    DECLARE 
      v_put_msg VARCHAR2(255);
    BEGIN
      san_test('1) OR (1=1', v_put_msg);
      dbms_output.put_line(v_put_msg);
      COMMIT;
    END;
    SELECT *
      FROM mtest;
            ID MNAME
             1 Success
             2 SuccessC.

  • ORA-01722: invalid number (Error in Application after upgrade to 3.0)

    Dear All,
    After upgrading to 3.0 I am no longer able to login to my application. The error I am seeing is:
    ORA-01722: invalid number
         Error      Could not process show_hide_memory.show_hide_collection_output procedure !
    Please help me pin-point the issue and fixed it.
    This happens in some applications but in others it doesn't...
    Regards,
    Pawel.

    I believe I have found the source of the problem!
    This is coming from the sample application which was used for the show/hide of regions example.
    The code behind the above procedure is:
    CREATE OR REPLACE
    PACKAGE show_hide_memory AS
    PROCEDURE show_hide_collection;
    PROCEDURE show_hide_collection_output;
    END;
    CREATE OR REPLACE PACKAGE BODY show_hide_memory AS
    PROCEDURE show_hide_collection AS
    l_arr apex_application_global.vc_arr2;
    l_found boolean := FALSE;
    l_collection_name VARCHAR2(255) := 'SHOW_HIDE_COLLECTION';
    BEGIN
    IF(wwv_flow_collection.collection_exists(p_collection_name => l_collection_name) = FALSE) THEN
    htmldb_collection.create_or_truncate_collection(p_collection_name => l_collection_name);
    END IF;
    l_arr := apex_util.string_to_table(p_string => v('TEMPORARY_ITEM'), p_separator => ']');
    -- If the array member count of l_arr < 3, then the following code will raise an exception
    FOR c1 IN
    (SELECT seq_id
    FROM apex_collections
    WHERE collection_name = l_collection_name
    AND c001 = l_arr(1)
    AND c002 = l_arr(2)
    AND c003 = l_arr(3))
    LOOP
    -- It exists, so delete it
    apex_collection.delete_member(p_collection_name => l_collection_name, p_seq => c1.seq_id);
    l_found := TRUE;
    END LOOP;
    IF l_found = FALSE THEN
    apex_collection.add_member(p_collection_name => l_collection_name, p_c001 => l_arr(1), p_c002 => l_arr(2), p_c003 => l_arr(3));
    END IF;
    COMMIT;
    END show_hide_collection;
    PROCEDURE show_hide_collection_output AS
    BEGIN
    htp.prn('<script type="text/javascript">' || CHR(10));
    htp.prn('<!--' || CHR(10));
    htp.prn('window.onload=function(){' || CHR(10));
    FOR c1 IN
    (SELECT c003
    FROM apex_collections
    WHERE collection_name = 'SHOW_HIDE_COLLECTION'
    AND c001 = wwv_flow.g_flow_id
    AND c002 = wwv_flow.g_flow_step_id)
    LOOP
    htp.prn('htmldb_ToggleWithImage(''' || c1.c003 || 'img'',''' || c1.c003 || 'body'');' || CHR(10));
    END LOOP;
    htp.prn('}' || CHR(10));
    htp.prn('//-->' || CHR(10));
    htp.prn('</script>' || CHR(10));
    END show_hide_collection_output;
    END;
    I guess now I have to find the bug in the above code !

  • Ora-01722 invalid number error within view

    Hi, in my oracle 9.2.0.4.0 db, under TEST schema i've a view called PRODUTTIVITA_LINEE. I'm trying to create another view joining PRODUTTIVITA_LINEE with a table called LINEE. But when i execute the select (SELECT PRODUTTIVITA_LINEE.*, LINEE.NAME FROM PRODUTTIVITA_LINEE, LINEE WHERE PRODUTTIVITA_LINEE.LINEA_ID = LINEE.LINEA_ID), i obtain the ORA-01722 invalid number error.
    But if i create a table PRODUTTIVITA_SUPPORT as select all fields from PRODUTTIVITA_LINEE and i use it in the new query (SELECT PRODUTTIVITA_SUPPORT.*, LINEE.NAME FROM PRODUTTIVITA_SUPPORT, LINEE WHERE PRODUTTIVITA_SUPPORT.LINEA_ID = LINEE.LINEA_ID), all works.
    Using the view, the new query doesn't work, but using the same data toke from a table instead of view, all works. Why?

    Excuse me but i send modified script. Here the original script of object.
    SQL> desc PRODUTTIVITA_LINEE;
    Nome                               Nullo?   Tipe
    LINEA_ID                   NUMBER(9)           
    COD_LINEA_ANDATA                 VARCHAR2(8)        
    COD_LINEA_RITORNO                VARCHAR2(4)        
    ID_TRAT_PIC_ANDATA                NUMBER               
    ID_TRAT_PIC_RITORNO               NUMBER               
    DESC_LINEA                              VARCHAR2(120)     
    EKM_NOMINALI                         NUMBER                 
    EKM_SCONTATI                        NUMBER                 
    KMLINEA                                  NUMBER                 
    ANNO                                       NUMBER                  SQL> desc PRODUTTIVITA_SUPPORT;
    Nome                           Nullo?     Tipe
    LINEA_ID             NUMBER(9)
    COD_LINEA_ANDATA           VARCHAR2(8)
    COD_LINEA_RITORNO          VARCHAR2(4)
    ID_TRAT_PIC_ANDATA          NUMBER
    ID_TRAT_PIC_RITORNO         NUMBER
    DESC_LINEA                      VARCHAR2(120)
    EKM_NOMINALI                     NUMBER
    EKM_SCONTATI                   NUMBER
    KMLINEA                            NUMBER
    ANNO                                NUMBER Both objects have 5400 records and are the same.

  • Find the Column Name which gives Invalid Number Error

    Hi,
    There are about 150 columns in a table and data to this table is from a external source like flat file. when these data are loaded to the table for a particular column it gives Invalid Number Error. So need to find for Which Numeric Column a String Value is about to be inserted.
    since we are sure not whether the proper Values are coming from Source in Front End we pass the Value within ' quotes.
    So how do we get the Column for which the error is raised :-)

    If you are using SQL*Loader, the log will tell you which row and column has the error.
    Otherwise you may need to code your own debugging statements.

  • Invalid Number Error in Merge Statement

    Hi all.
    I got an invalid number error in the following merge statement, but I don't know why. Maybe you can give me a hint.
    MERGE INTO wam_table
    USING (SELECT * FROM wam_table) b
    ON (b.username = 'user'
    AND b.mod = 'module'
    AND b.trimester = '1')
    WHEN MATCHED THEN
    UPDATE SET as = '1', ad = '1', co = '1', pr = '1', date = localtimestamp, lus = 'username'
    WHEN NOT MATCHED THEN
    INSERT VALUES ('user','module','1','1','1','1','1', localtimestamp, 'username');
    The invalid number error appears in the first line, but I don't know why?
    Stephan

    UPDATE SET as = '1', ad = '1', co = '1', pr = '1', date = localtimestamp, lus = 'username'SELECT * FROM sys.v_$reserved_words;
    SQL> create table test1(as varchar2(10));
    create table test1(as varchar2(10))
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table test1(sno number, date date);
    create table test1(sno number, date date)
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table test1("as" varchar2(10));
    Table created.
    SQL>
    SQL> create table test2(sno number, "date" date);
    Table created.
    SQL> desc test1
    Name                                      Null?    Type
    as                                                 VARCHAR2(10)
    SQL> desc test2
    Name                                      Null?    Type
    SNO                                                NUMBER
    date                                               DATE
    SQL> 

  • Invalid Number Error for Decimal Field While Loading Data

    I am loading a delimited text file using the SQL* loader however I am reciving an error in my decimal fields. When a decimal field only has leading zeros before the decimal point I receive invalid number error. Below will clarify:
    i.e.) 00000000.30 [*Invalid number*]
    i.e.) 00046567.45 [*Valid number*]
    i.e.) 00000001.00 [*Valid number*]
    I've tried setting the precision/scale in the table, tried declaring it a decimal field instead of number, none of these methods fixed the issue. Any help I would really appreciate.
      POLICY_NUMBER             NUMBER,
      EFFECTIVE_DATE     DATE "YYYYMMDD"          NULLIF EFFECTIVE_DATE = '',
      TRANSACTION_DATE     DATE "YYYYMMDD",
      TRANSACTION_AMOUNT     DECIMAL EXTERNAL,   -- Tried TRANSACTION_AMOUNT DECIMAL EXTERNAL (10)  & TRANSACTION_AMOUNT NUMBER
      MF_TRX_CODE          NUMBER,
      USER_ID          CHAR,
      GROUP_NUMBER          NUMBER,
      EXPIRATION_DATE     DATE "YYYYMMDD"          NULLIF EXPIRATION_DATE = '',
      BILL_NUMBER          NUMBER,Any help is greatly appreciated. Thanks before hand.

    Hi,
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> SELECT * FROM TEST;
    TRANSACTION_AMOUNT
    SQL> SELECT * FROM TEST;
    TRANSACTION_AMOUNT
              11000,00
                293,37
               2000,00
               1134,32
                  0,30
    SQL>Between the selects I loaded the table with sql*loader using...
    Load Data
    INFILE *
    APPEND
    INTO TABLE TEST
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS
      TRANSACTION_AMOUNT     DECIMAL EXTERNAL
    BEGINDATA
    00011000.00
    00000293.37
    00002000.00
    00001134.32
    00000000.30The log is
    SQL*Loader: Release 10.2.0.1.0 - Production on Tue Dec 23 17:23:47 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Control File:   test.ctl
    Data File:      test.ctl
      Bad File:     test.bad
      Discard File:  none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array:     64 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    Table TEST, loaded from every logical record.
    Insert option in effect for this table: APPEND
    TRAILING NULLCOLS option in effect
       Column Name                  Position   Len  Term Encl Datatype
    TRANSACTION_AMOUNT                  FIRST     *   |       CHARACTER           
    Table TEST:
      5 Rows successfully loaded.
      0 Rows not loaded due to data errors.
      0 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    Space allocated for bind array:                  16512 bytes(64 rows)
    Read   buffer bytes: 1048576
    Total logical records skipped:          0
    Total logical records read:             5
    Total logical records rejected:         0
    Total logical records discarded:        0
    Run began on Tue Dec 23 17:23:47 2008
    Run ended on Tue Dec 23 17:23:50 2008
    Elapsed time was:     00:00:02.86
    CPU time was:         00:00:00.06Regards,

Maybe you are looking for

  • Photo events not showing up in alphabetical order

    Hi there all, why aren't my photo events showing up in chronological order? It appears like it starts with events from 2007, then works backwards from there as I scroll down. Then, after it gets through my earliest pics, it gets to my latest stuff. V

  • I am unable to sync my iphone with itunes.

    I am unable to sync my iphone with itunes.  This is a recent problem.  The error I receive is "This iphone cannot be used because the Apple Mobile Device service is not started." Any help is appreciated!

  • Cannot visit certain websites.

    My problem is that I cannot visit certain websites (booksamillion.com, and any .edu pages). This happened suddenly. They do not work on either Safari or Firefox, however I can visit them on my Wii which is on the same wireless network as my Macbook.

  • TS1702 I purchased an app and got a 'waiting' message on my itouch screen.  What does this mean?

    I purchased an app and got a 'waiting' messae on the itouch screen.  What does this mean?

  • Running Windows CD on Macbook?

    Hey y'all I've tried to find a solution in the discussions to no avail, so please forgive if this is a repeat. I'm trying to run a CD from a textbook and the CD says it only works on Windows. Is there perhaps a trick to opening it on my macbook? I ha