Powered By Blogger

Wednesday, June 6, 2012

Creating dummy data

 Just going through oracle blogs, and got focus on below site...http://www.oracle-developer.net/display.php?id=515 

Most of the times when you are practicing Oracle or Informatica code, you require a dummy data to be available at table. Particularly when you are working on Performance testing of oracle and informatica, large data is required. How will you create it ? One way is insert some records, then take union of it and again union of it. and so on.. But this will create repetation of data in your table.. 

Best way is below



Create table test as
SELECT ROWNUM                     AS id
       ,      MOD(ROWNUM,2000)           AS grp
       ,      DBMS_RANDOM.STRING('u',5)  AS val
       ,      DBMS_RANDOM.STRING('u',30AS pad
       FROM   dual
       CONNECT BY ROWNUM <= 1000000;



No comments: