Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: adding 1000's new rows?
Look at the dbms_random package.
e.g. (from memory)
dbms_random.string(12,'l') returns random strings 12 characters long in lower case.
dbms_random.value returns numbers between 0 and 1 in a uniform (square) distribution.
create table x as
select rownum id,
all_objects
where rownum <= 2000
;
-- Regards Jonathan Lewis http://www.jlcomp.demon.co.uk Next Seminar dates: (see http://www.jlcomp.demon.co.uk/seminar.html ) ____USA__________November 7/9 (Detroit) ____USA__________November 19/21 (Dallas) ____England______November 12/14 The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html david spaisman wrote in message <3DBEC821.94993490_at_earthlink.net>...Received on Tue Oct 29 2002 - 09:01:27 CST
>Hello:
>
>For testing if I have a new tableI need to nkow how to fill each of
some
>columns wit differnt values. The columns could be varchar2 or number
or
>even date defined..
>I see how to add a sequenced identifieer(via a loop) but if there are
>other columns, I need to know how to fill them with data that's
>different.
>While the update statement would provide a means to update all of the
>columns with the same values, I would like to nkow how to fill each
>column --let's say three- with different data . These columns are not
>sequenced generated values.
>
>This is to test the table for select on different values.
>
>Perhaps something with an ascii function but I am not sure how to
code
>it. And there must be some other way but I am not sure how to do
this.
>Does any one have any suggestions or routines to use to accomplish
this
>random filling of three columns with different values?
>
>David
>