error in insert statement
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: error in insert statement

  1. #1
    Join Date
    Mar 2007
    Posts
    7

    error in insert statement

    hi,

    i have used script for insert statement.while compiling it ,it shows error in declare section that to in t24_customer_code.can any body pls check out and tell me.

    the script is ....
    DECLARE
    a NUMBER := 10;

    t24_customer_code NUMBER;

    my_tab SYS.dbms_debug_vc2coll := SYS.dbms_debug_vc2coll ();
    BEGIN
    LOOP
    EXIT WHEN a > 20;
    a := a + 1;
    t24_customer_code:= 9700 + a;

    INSERT INTO t24_customer
    (t24_customer_code,
    T24_MNEMONIC,
    T24_SHORT_NAME,
    T24_NAME_1,
    T24_NAME_2,
    T24_STREET,
    T24_SECTOR,
    T24_ACCOUNT_OFFICER,
    T24_OTHER_OFFICER,
    T24_INDUSTRY,
    T24_TARGET,
    T24_NATIONALITY,
    T24_CUSTOMER_STATUS,
    T24_LANGUAGE)
    VALUES
    (t24_customer_code,
    'MNEMON' || a,
    'HANSARUN',
    'KUMAR',
    'MAQSOOD',
    'NIYAZ DINESH',
    1001,
    1,
    5,
    1000,
    1,
    'US',
    2,
    'US');

    my_tab.EXTEND;
    my_tab (a - 1) := t24_customer_code;
    END LOOP;

    OPEN :cur FOR
    SELECT *
    FROM t24_customer
    WHERE t24_customer_code IN (SELECT COLUMN_VALUE
    FROM TABLE (CAST (my_tab AS SYS.dbms_debug_vc2coll)));
    END;


    thanks
    ratheesh

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Well, and the error is ... ?
    Ales
    The whole difference between a little boy and an adult man is the price of toys

  3. #3
    Join Date
    Mar 2007
    Posts
    7

    re

    the error which i got is


    SQL> @CUSTOMER01.sql
    53 /
    declare
    *
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-06512: at line 12

  4. #4
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    I guess you're trying to insert a character value to a number column.
    Could you post here the create statement for the t24_customer table?
    Ales
    The whole difference between a little boy and an adult man is the price of toys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width