I need to insert test data into my database. HOW???
Posted in 2000
Topics: Platform-Specific Issues
Hi, We are at the testing phase of a project and want to enter some test data. Ideally, we'd like about 5 million rows in our main tables. Is there an easy way to do this. We are using Informix 7.3 on Solaris John P.
Hi, For stress testing of DB2 we usually start with a bunch of rows as seeds and then use inserts with recursive subselects from the same table to fluff it up. That works quite nicely... Cheers Serge -- Visit the DB2 UDB and DB2 Connect Online Support site at: http://www.ibm.com/software/data/db2/udb/winos2unix/support
I have seen an SQL query in DB2 somewhere in the documentation to do this.(random values are inserted). Just dont remember exactly where? -Aakash News reader wrote: > Hi, > We are at the testing phase of a project and want to enter some test > data. Ideally, we'd like about 5 million rows in our main tables. Is > there an easy way to do this. > > We are using Informix 7.3 on Solaris > > John P.
look in: Application Development Guide Setting Up the Testing Environment for DB2 -Aakash News reader wrote: > Hi, > We are at the testing phase of a project and want to enter some test > data. Ideally, we'd like about 5 million rows in our main tables. Is > there an easy way to do this. > > We are using Informix 7.3 on Solaris > > John P.
John,
it'a little but good script:
connect to database;
create table t (i1 integer not null, d2 decimal (8,2))
in testspace1;
insert into t (i1, d2)
with temp (i1) as
(values (1) union allselect i1+1 from temp
where i1 < 5000000)
select i1, decimal(rand()*10000)/8 from temp;
best regards
Joachim Mueller
"News reader" <NoSpamPlease@NOSPAM.com> schrieb im Newsbeitrag
news:39BE74D9.7ECE26B8@NOSPAM.com...
> Hi,
> We are at the testing phase of a project and want to enter some test
> data. Ideally, we'd like about 5 million rows in our main tables. Is
> there an easy way to do this.
>
> We are using Informix 7.3 on Solaris
>
> John P.
>
>
>
Hi John,
I've tried to conduct some sort of stress test against a database. I simply
did it with some steps of SQL statement.... basically by using the
cartesian-join technique to generate any testing data
(1) create some master reference tables, with records stored in each of the
table, let say, I have customer, product...
e.g.
Customer .... 2000 records
Product .... 1000 records
(2) Use cartesian-join SQL to produce an output test table
SELECT CustomerNo, ProductNo INTO tblTest FROM Customer, Product
(3) The resulting testing table (tblTest) would have 2000 x 1000 records
(4) You might ask how to conveniently create 2000 records... by the same
principle, you can create two tables like tblFirstName and tblLastName, then
use cartesian join to make up two tables again...
I think this could be the quick-and-dirty way to produce the data set you
want in expense of the CPU time and temptable space required.
Hope this help!
Derek So
"News reader" <NoSpamPlease@NOSPAM.com> wrote in message
news:39BE74D9.7ECE26B8@NOSPAM.com...
> Hi,
> We are at the testing phase of a project and want to enter some test
> data. Ideally, we'd like about 5 million rows in our main tables. Is
> there an easy way to do this.
>
> We are using Informix 7.3 on Solaris
>
> John P.
>
>
>