Click to See Complete Forum and Search --> : error in insert statement


rratheesh
03-23-2007, 01:03 AM
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

ales
03-23-2007, 03:28 AM
Well, and the error is ... ?

rratheesh
03-23-2007, 03:35 AM
the error which i got is


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

ales
03-23-2007, 03:11 PM
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?