Multicolumn insert - how to check witch column is wrong

I have error in insert statement with many columns, err msg tell me that the row is wrong, but I have to tell me what column is wrong. How to do this? Can anybody help me.

EXECUTE IMMEDIATE 'insert into p2 (P2_ID,     KOD_NA_DRUZHESTVO, TIP_FOND, INVESTICII, PARI_RAZPL_SMETKI, PARI_NA_KASA, VZEMANIA, VZEMANIA_OT_INVESTICII, VZEMANIA_OT_POD, KRATKOSROCHNI_VZEM,
               ZADALZHENIA_OSIG_LICA, ZADALZHENIA_PENSIONERI, ZADALZHENIA_POD,
               VSTYPITELNI_TAKSI, TAKSI_OT_OSIG_VNOSKI, INVESTICIONNA_TAKSA, DRUGI_TAKSI,
               DRUGI, ZADYLZHENIA_INVEST, DRUGI_KRATKOSR_ZAD,DATA_NA_DANNITE) values
               (NULL,:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18,:19,:20)'
USING TO_NUMBER(v_array (1),'99'),TO_NUMBER(v_array (2),'9'),               
                         TO_NUMBER(v_array (3),'9999999999.99'),TO_NUMBER(v_array (4),'99999999.99'),
               TO_NUMBER(v_array (5),'9999999.99'),TO_NUMBER(v_array (6),'99999999.99'),
                         TO_NUMBER(v_array (7),'99999999.99'),TO_NUMBER(v_array (8),'99999.99'),
                         TO_NUMBER(v_array (9),'99999.99'),TO_NUMBER(v_array (10),'99999.99'),
                         TO_NUMBER(v_array (11),'99999.99'),TO_NUMBER(v_array (12),'999999.99'),
                         TO_NUMBER(v_array (13),'99999.99'),TO_NUMBER(v_array (14),'999999.99'),
                         TO_NUMBER(v_array (15),'999999.99'),TO_NUMBER(v_array (16),'99999.99'),
                         TO_NUMBER(v_array (17),'9999999.99'),TO_NUMBER(v_array (18),'9999999.99'),
                         TO_NUMBER(v_array (19),'9999999.99'),v_array (20);
Line 1: ORA-06502: PL/SQL: numeric or value error
I want to know what column is the problematic.

Similar Messages

  • How to check  which column data differs from master table and archive table

    Hi All,
    i have two tables, table a (a1 number,a2 varchar2,a3 varchar2) and table b (b1 number,b2 varchar2,b3 varchar2).
    how to check the data in both the table are same( including all columns).
    data in a.a1 is same as b.b1 and a.a2 is same as b.b2 like that.
    if they not same , i need to know which field differs.
    Kindly Share ur ideas.

    887268 wrote:
    thanks Sven W. ,
    above reply clearly shows what my question is.
    one column must be primary key, based on that key i need to find out which are the fields having different data..
    im strugling with this, i tried the following already, but not able to get.
    select the columns from a MINUS select the columns from b.
    -- from this i can find whether the difference occurred or not.
    but i cant able to get which are the fields value changed.Good. Then you would match the rows using the PK column and need to compare the columns
    Instead of a MINUS + UNION ALL + MINUS we can now use a FULL OUTER JOIN
    It is a little task to write out all column names, but 40 columns can be handled.
    This statement would show you both tables with matching rows on the same line.
    select a.*, b.*
    from a
    FULL OUTER JOIN b on a.id = b.idNow filter/check for mismatches
    select case when a.col1 != b.col1 then 'COL1 value changed'
                    when a.col2 != b.col2 then 'COL2 value changed'
                    when a.col3 != b.col3 then 'COL3 value changed'
             end as compare_result
            ,a.*, b.*
    from a
    FULL OUTER JOIN b on a.id = b.id
    /* return only non matching columns */
    where (a.col1,a.col2,a.col3) != (b.col1,b.col2,b.col3) You might need to add nvls to take care of null values. Test this!
    Another way could be to group upon the primary key
    select *
    from (
      select id 
               ,count(distinct col1)-1 cnt_col1
               ,count(distinct col2)-1 cnt_col2
               ,count(distinct col3)-1 cnt_col3
       from
         select 'A' source, a.*
         from a
         UNION ALL
         select 'B' source, b.*
         from b)
       group by ID
    /* only records with differences */
    where 1 in (cnt_col1, cnt_col2, cnt_col3)
    ;The count columns will hold either 1 or 0. If it is 1 then this column has a difference.

  • How to check all columns existing in a table?

    Hello.
    I'm writing a function that returns average value of every numeric column existing in a database.
    I have a general idea how to do it, but I need just one more thing, look at the expamle:
    select table_name from user_tables where rownum=1
    this allows me to select names of all tables, and then I can access them 1 by 1...
    But now i have a little problem - how to access all the atributes in selected table in this way?
    Oh, and I have a problem with this rownum... For example it works for 1 (shows 1st row - name of first table) but does not for 2, or greater number :(.
    And expresions like rownum < 5 work, but rownum > 3 not :/. What may be the reason?
    Thank you for help!
    Regards.

    user13483761 wrote:
    Thanks a lot! This 3 atributes is all I need, its a way lot easier than I thought before. I simply use cursor loop and your advices.
    Almost got working code - but there is 1 error telling that select is incorrect :/. Why is that?
    create or replace
    FUNCTION SHOW_ALL
    RETURN VARCHAR2 IS
    v_ret VARCHAR(100):='Null';
    BEGIN
    DECLARE
    CURSOR cur_stats IS SELECT table_name, column_name, data_type
    FROM user_tab_columns;
    v_zdanie VARCHAR(100);
    BEGIN
    FOR v_cur IN cur_stats LOOP
    IF v_cur.data_type = 'NUMBER'
    THEN
    strike
    --> select 'In table ' || v_cur.table_name || ' average value of ' ||--
    --> v_cur.column_name || ' is:' || avg(v_cur.column_name)--
    --> into v_zdanie--
    --> from v_cur.table_name;--
    strike
    >
    dbms_output.put_line(v_zdanie);
    END IF;
    END LOOP;
    RETURN v_ret;
    END;
    END SHOW_ALL;
    select 'In table ' || v_cur.table_name || ' average value of ' ||
    v_cur.column_name || ' is:' || avg(v_cur.column_name)
    into v_zdanie
    from v_cur.table_name;
    sql_developer tells that this 'table or perspective does not exist' or sth like that, I translated from my native language.You are missing lot of things in the function, you are hard coding the return value to null?
    What you should do is as below:
    remove the part what you have written, i have strike that above. declare a variable your_select_statement VARCHAR2(1000);
    your_select_statement := 'select nvl(avg('||v_cur.column_name||'),0) from '||v_cur.table_name;
    execute immediate your_select_statement into v_zdanie;
    dbms_output.put_line('In table ' || v_cur.table_name || ' average value of ' ||v_cur.column_name || ' is:' ||v_zdanie);

  • Inserting an image in a column of a multicolumn listbox

    Hi,
    How can I insert an image in a column and row of a multicolumn listbox? Is it possible?
    Thanks,
    ToNi.

    To change any property of a cell, you must first select it using the Active Cell Property node, a cluster of row and column indexes. Setting the indexes values to -2 select the entire row/column/table, including the headers, setting the indexes to -1 select only the headers.
    Changing a column foreground color without affecting the header color is therefore a 3 steps operation :
    - set the active cell property to -1, n (n being he column index); read the foreground color
    - set the active cell property to -2, n; write the new foreground color
    - set the active cell property to -1; write back the previously read foreground color
    Since you cannot change programmatically the images in a ring, the pict ring array cannot be used if you want to load new images at run time.
    Use instead a picture array, as shown in the attached vi. I still use a pict ring, but that's just as a convenient image source. Replace it with your own source (file dialog for instance...)
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    ListBox & Picts.vi ‏1 KB

  • How can I undestand at runtime witch column is primary key in a table

    Hello
    I write program at CBuilder and i have that problem:
    In runtime application takes a table (in deign time there are no information about the table) and i want to understand at runtime witch columns are primary keys (or part of it) and witch column(s) is foreign key?
    Should i look in meta data in database ?
    Please help

    user10860289 wrote:
    Hello
    I write program at CBuilder and i have that problem:
    In runtime application takes a table (in deign time there are no information about the table) and i want to understand at runtime witch columns are primary keys (or part of it) and witch column(s) is foreign key?
    Should i look in meta data in database ?
    Please helpI am afraid that this is not possible. There isn't anything which would reveal this detail to you at run time that which column(s) are a part of the referential constraints. This is not visible even in the description of the table(s) also using Describe command too. The only way would be to check the status of the table and its related constraints in the dictionaries, DBA_CONSTRAINTS or DBA_CONS_COLUMNS .
    HTH
    Aman....

  • How to insert a button on the column header of a table in webdynpro java

    Hi
    Can anyone tell me how to insert a button on the column header of a table in webdynpro java?
    regards
    sunit

    Hi sunit,
    Instead of adding button in the column header , in the column
    add a fixed top cell.
        right click on the column
        Insert FixedTopCell
        Right click on the fixedTopCell
        insert Editor.
       select button.
    then button will be only in the top most row.
    Hope it will satisfy ur requirement
    Regards
    Smitha

  • How to retrieve multiple columns using "returning" in the Insert query.

    hi,
    wanted to know how to retrieve multiple columns using "returning" in the Insert Query.
    For retrieving one column we write the query as follows:
    Insert into TABLE values(1,2,3,4) returning COLUMN1 into PARAMETER
    But can we retrive multiple columns in the same query?
    am using oracle 10g and coding in .NET

    Hi,
    You can definetely get multiple values from a single query using the 'returning' clause.
    Eg : insert into emp (empno, ename, job, deptno) values (7324,'ADAM','MARKETING',30) returning ename, deptno into var1, var2; PN : var1 & var2 to be declared as varchar2 & number respectively.
    More insight into the 'RETURNING' clause in this link.
    http://www.samoratech.com/PLSQL/swArtPLSQLReturn.htm
    Regards,
    Bhanu.

  • How to hide multiple columns in multicolumn listbox like as an excel sheet?

    Hello All,
    I have large amount of data that is to be displayed on multicolumn listbox. After displaying that, I want to hide or delete some columns from listbox in runtime.
    I know how to hide one column using active cell property node. But I want to hide multiple columns. I am using LabVIEW 2011. 
    Thanks in advance.
    Thanks & Regards,
    Manisha

    Thank you so much. 
    But I have total 12 columns and I don't want to delete columns serially. I want to delete inbetween columns, like in attached VI I want to delete column A & D only. 
    And in this user have to select it from frontpanel. I want this is to be done as in excel, like we select the entire column and either we hide it or delete it. One more thing I want to clear the data in multicolumn when I next time open my VI. How to do that?
    I hope am clear in explaining my problem.
    Thanks & Regards,
    Manisha
    Attachments:
    Delete Column.vi ‏10 KB

  • How to insert data into the BLOB column

    Hi All,
    Can anyone help me to insert data into the BLOB data type column?
    The table structure is
    CREATE TABLE XXATFL_DM_FORCAST_STG
    TASK_ID NUMBER,
    USER_ID NUMBER,
    CREATED_BY NUMBER(15),
    CREATION_DATE DATE,
    LAST_UPDATED_BY NUMBER(15),
    LAST_UPDATE_DATE DATE,
    LAST_UPDATE_LOGIN NUMBER(15),
    RECORD_STATUS VARCHAR2(1 BYTE),
    ERROR_MESSAGE VARCHAR2(4000 BYTE),
    DATA_FILE BLOB
    I want to insert data in the DATA_FILE column. and this insert statement will in inside a procedure.
    Please help me as soon as possible as this is very urgent for me
    Thanks & Regards,
    Chandan

    i tried like this
    sql> insert into tbl values(1, utl_raw.cast_to_raw('D:\pictures\pic2.bmp'));
    1 record created.
    sql>select * from tbl;
    sp2-0678:Column or attribute type can not be displayed by SQL*PLUS
    sql>
    is this saving only path or bmp file on that path?
    if it is saving bmp file, in which format and how can we retrive it?
    Edited by: user8967883 on Mar 31, 2010 12:57 PM

  • How to insert varchar2 value in timestamp column in table?

    Hi all,
    Hope doing well,
    sir i am using one stored procedure and storing time in varchar2 variable in this format: 08:00:00
    now i have to insert this value in timestamp column in table. how to insert this value in timestamp column?
    thanks

    952646 wrote:
    Hi all,
    Hope doing well,
    sir i am using one stored procedure and storing time in varchar2 variable A "Very Bad Idea"(tm)
    When you do this, there is no fundamental difference between "08:00:00" and "here's your sign".
    Data should always be stored in the correct data type. For dates and times, that data type is either DATE or TIMESTAMP. Period.
    in this format: 08:00:00
    now i have to insert this value in timestamp column in table. how to insert this value in timestamp column?
    Hopefully as remediation to the original bad design.
    thanks

  • How to insert data into newly added column

    Hi all,
    i am having a doubt how to insert entries into newly added column..
    i created a table with two columns and inserted the data into them then i altered the table by adding additional column.now i want to insert data into that..plz tell me how to do that..??
    thanks in advance..help me

    Small example:
    [email protected]> create table t(id int, id2 int);
    Table created.
    [email protected]> insert into t values (1,2);
    1 row created.
    [email protected]> insert into t values (2,2);
    1 row created.
    [email protected]> alter table t add id3 int;
    Table altered.
    [email protected]> select * from t;
    ID ID2 ID3
    1 2
    2 2
    [email protected]> update t
    2 set id3 = 10
    3 where id = 1;
    1 row updated.
    [email protected]> select * from t;
    ID ID2 ID3
    1 2 10
    2 2
    Best Regards
    Krystian Zieja / mob

  • How to check if a value is in a table column?

    Hi, I am new to Oracle. Will sombe body pls tell me how to solve the problem:
    Suppose there is a table with a employee-id column, there are lots of lines in the table with employee-id be 1,2,3,4.....respectively. my question is, how to check if a employee-id e.g., 15 is in the table?
    thanks in advance

    >
    > Suppose there is a table with a employee-id column,
    there are lots of lines in the table with
    You mean records.
    employee-id be 1,2,3,4.....respectively. my question
    is, how to check if a employee-id e.g., 15 is in the
    table?
    SELECT *
    FROM EMPLOYEE
    WHERE EMPLOYEE_ID = 15;Regards.
    Satyaki De.

  • How do I send a email notification with PL/SQL to Check for Columns

    I want to be able to use PL/SQL to check my columns and makes sure that all required columns were populated, and if any were not populated to send an email notification.
    Thanks
    Hank

    I would still suggest that adding appropriate constraints (well, logical constraints) to the table is the right way to go.
    When you get the file back, you load the data into the table. If the constraint is satisfied, the data is loaded. If the constraint is violated, the loader gets an error, writes the affected data to another table, to another file, etc. That way, the data in the database is always correct and you have a log of the rows that were bad.
    create table t( status varchar2(10), cost number );
    create or replace trigger trg_t
    before insert or update
    on t
    for each row
    begin
       if :new.status = 'Approved' and :new.cost is null
       then
         raise_application_error( -20001, 'Cost must not be null if status is approved' );
       end if;
    end;
    SCOTT @ hp92 Local> insert into t values( 'Reject', 1 );
    1 row created.
    SCOTT @ hp92 Local> insert into t values( 'reject', null );
    1 row created.
    SCOTT @ hp92 Local> insert into t values( 'Approved', 2 );
    1 row created.
    SCOTT @ hp92 Local> insert into t values( 'Approved', null );
    insert into t values( 'Approved', null )
    ERROR at line 1:
    ORA-20001: Cost must not be null if status is approved
    ORA-06512: at "SCOTT.TRG_T", line 4
    ORA-04088: error during execution of trigger 'SCOTT.TRG_T'If you don't want to touch the loader, you can rename the table, create a view with the same name, and use an INSTEAD OF trigger on the view to populate the real table or a reject table.
    Either way, you're better off, in general, rejecting invalid records than trying to expend a lot of effort reporting on them.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to check the insert stmt

    Hi,
    How to check whether the following trigger is working properly or not?
    CREATE OR REPLACE TRIGGER employee_ins_t1
       BEFORE INSERT
       ON employee
       FOR EACH ROW
    BEGIN
       SELECT employee_seq.nextval
         INTO :new.id
         FROM dual;
    END;please excuse me if this is very newbie question

    Yeah , I tried to insert some data into the table but getting the following error: So confused how to check the trigger is working
    SQL> insert into employee(id, ename) values (null, 'abc');
    insert into employee(id, ename) values (null, 'abc')
    ERROR at line 1:
    ORA-08004: sequence EMPLOYEE_SEQ.NEXTVAL exceeds MAXVALUE and cannot be
    instantiatedEdited by: Smile on Feb 19, 2013 2:24 AM

  • How to check the records that were inserted in a day?Please Help!

    HI All,
    How to check the records that were insterted in a day in a standard SAP table?
    For example : I want retrieve the records that were added in a day in WLK1 table.
    How do i do this?
    Urgent!! Please help!
    Thanks in advance!
    Sandeep Shenoy

    HI
        Changes to data within a table can be automatically logged. Such automatic logging of changes is called automatic table history. To turn on logging, tickmark the Log Data Changes check box on the Technical Settings screen
    IF THIS IS ALREADY DONE FOR A PARTICULAR TABLE, YOU CAN GET THE RECORD OF CHANGES THAT YOU MADE FOR THAT PARTICULAR TABLE AS EXPLAINED UNDER
    <a href="http://64.233.179.104/search?q=cache:pOdVy55jfAIJ:cma.zdnet.com/book/abap/ch06/ch06.htmHISTORYOFUPDATESINADAYINABAP&hl=en&gl=in&ct=clnk&cd=1">Automatic Table History and Change Documents</a>
    IF ITS HELPFUL PLEASE REWARD POINTS
    REGARDS
    ANOOP

Maybe you are looking for