sql - Generate 10,000 random values in a table -
i have oracle table. development purposes want generate 10,000 different values table. how can this?
create table errorlog( errorid integer not null, errorcontent clob not null, errordate timestamp(6) not null )
if looking chaotic in clob (including length , content) may use dbms_random:
sql> select dbms_random.string('p',dbms_random.value(1,30)) rand_str dual connect level <= 10 2 / rand_str -------------------------------------------------------------------------------- #<a tv&og8=:f}is/sr2l>f\7wcl)_v2 /wbp y)v5zd.v _yw(o_ b:5&e}7\a1gt]x}$}e*-w[6u=1 l<hq:l^5}a(]<:}+8|-{.f%&`l g!l'rbgiw/o]r~`[@9d6fui3dc7 .h_y;yeh`*ruk+\~8^i<g+;l76* ec}al d3)uft)s2kda5
and same package can used generate values in other columns (but suppose errorid primary key, can use other method guarantess uniqueness - sequence).
sql> create sequence seq_x; sql> select x_seq.nextval, dbms_random.string('p',dbms_random.value(1,30)) rand_str, systimestamp + numtodsinterval(dbms_random.value(1,40),'minute') rand_ts dual connect level <= 10; nextval rand_str rand_ts ---------- ------------------------------ ----------------------------------- 1 a?=pk7ya|l8]d/)3! 24.03.14 19:47:18,750326032 +04:00 2 $n+k4vksvx(npxm^'#/%.aay5$, 24.03.14 19:50:48,361699672 +04:00 3 },7(1ix,2'e@i3u;wdg?.bb 24.03.14 19:35:15,711777571 +04:00 4 :s8x vj!m!:yi% flcy8$\y_}c 24.03.14 19:43:41,088255060 +04:00 5 /'ofj@+jov3ufzc\z;^2+9gg~ 24.03.14 19:59:02,214021766 +04:00 6 8vth0}[hybedy{4\ 24.03.14 20:06:34,600594460 +04:00 37 >u w9q)]c7/hb_butznr\oi!hwwo<& 24.03.14 19:36:39,010531153 +04:00 8 >gwzdbt8!?g}(<8;@i 24.03.14 19:51:52,118620451 +04:00 9 -] 'nxhux46"_(df"8.u:6pel" 24.03.14 19:44:04,152845952 +04:00 10 "haj 24.03.14 20:00:24,933479299 +04:00
Comments
Post a Comment