Thanks for replying.
I am going to simplify my previous table in order to post my followup:
create table customers
(
cust_id int primary key,
f_name varchar2(40)
);
To generate data, I was able to do the following:
INSERT INTO customers
SELECT cust_id.nextval,
dbms_random.string('U',trunc(dbms_random.value(1,10)))
FROM dual
CONNECT BY level <= 10000;
I have another table which is giving me an error when I try to populate it using the code above because it is nested with my first table:
create table orders
(
orders_id int primary key,
cust_id int references customer(cust_id)
);
and when populating it:
INSERT INTO orders
SELECT orders_id.nextval,
dbms_random.string('U',trunc(dbms_random.value(1,15)))
FROM dual
CONNECT BY level <= 12;
I got the following error:
Error report:
SQL Error: ORA-01722: invalid number
01722. 00000 - "invalid number".
What is the best way to solve this problem?
Thanks
December 21, 2010 - 6:54 am UTC
umm, you are inserting dbms_random.string('U',trunc(dbms_random.value(1,15))) into cust_id which is an int.
that - and I don't see a nested table anywhere in the example, but that is ok because the error you are getting is simply because you are inserting a string into an int.