help with hex print

From: marbo <marbo_at_tpi.pl>
Date: Fri, 27 Jun 2003 12:30:10 +0200
Message-ID: <bdh6ce$mqc$1_at_atlantis.news.tpi.pl>



Hi all,
part of my procedure should generate random number, convert it to hex nad put it into table and text file
I've tried to do it in two ways. (sample of code listed below). Both works if I try to select from dual table, but when I've put them into Oracle Forms my problems hve started:
1) i := rawtohex(abs(dbms_random.random())); do not waht to even compile
2) i := to_char(abs(dbms_random.random()),'FM0XXXXXXX');

    seem to work but in output text file generated via text_io procedures instead of hex number I've got # signs

[Quoted] Does anybody any idea where is my mistake?

marbo



sample of code. It will not work, becuse I had to cut it (was much to long) byt maybe it will give you idea . . .

  i varchar2(500);
 BEGIN TEXT_IO.IS_OPEN(file_id)
dbms_random.initialize(19254);

  • 1:
  • i := rawtohex(abs(dbms_random.random()));
  • 2: --i := to_char(abs(dbms_random.random()),'FM0XXXXXXX'); -- I try to pirnt i in 1 or 2 way - both do not work
 TEXT_IO.Put_Line(file_id, i);
 dbms_random.terminate;
 TEXT_IO.FCLOSE(file_id);

 END; Received on Fri Jun 27 2003 - 12:30:10 CEST

Original text of this message