Hi all,
i have next problem: my UDF function returns same vale on each new row.
what is wrong? i need different value for each row.
can you help me pls?
see code :
create table t11 (col1 bigint );
insert into t11 values (1) ;
insert into t11 values (2) ;
insert into t11 values (3) ;
commit;
create function rand_x (i_min int, i_max int )
returns float
language sql
not deterministic
begin atomic
return value(i_min, 0) +(value(i_max, 1)- value(i_min, 0))*rand ();
end ;
select rand_x(1, 100) as bad_col , rand() as ok_col from t11;
BAD_COL OK_COL
61.586779381695 0.0278328806421094
61.586779381695 0.329844050416578
61.586779381695 0.0559099093600269
thans much advance