Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: compute md5-hash from file

Re: compute md5-hash from file

From: Thomas Peter <braindumped_at_expires-31-03-2007.news-group.org>
Date: Mon, 19 Mar 2007 15:51:58 +0100
Message-ID: <1174315918.03@user.newsoffice.de>


hi maxim,
thnx for your help!

Maxim Demenko wrote:
> How you declared checksum variable?

i used Varchar(16), but changing it to raw didn't change the error

> For me your example works (i hope, your test_utl_file don't exceed 2Gb,
> in that case you would get however ORA-01426) :

no, it's 50Kb

> SQL> declare
> 2 b_file BFILE;
> 3 b_file_length BINARY_INTEGER;
> 4 dst_blob BLOB;
> 5 checksum raw(16);
> 6 begin
> 7 DBMS_LOB.CREATETEMPORARY(dst_blob,true);
> 8 b_file := BFILENAME('HOME','oracle/test_utl_file.txt');
> 9 DBMS_LOB.OPEN(b_file,DBMS_LOB.LOB_READONLY);
> 10 b_file_length := dbms_lob.getlength(b_file);
> 11 Dbms_Lob.loadfromfile(dst_blob, b_file, b_file_length);
> 12 checksum := dbms_obfuscation_toolkit.MD5(input => dst_blob);
> 13 dbms_lob.fileclose(b_file);
> 14 dbms_output.put_line(rawtohex(checksum));
> 15 end;
> 16 /

just copied your example (adopted path) and got the same ORA-06502

what oracle do you use? mine is
Oracle9i Enterprise Edition Release 9.2.0.7.0

any hints?

thnx thomas Received on Mon Mar 19 2007 - 09:51:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US