Home » Server Options » Text & interMedia » Unique BLOB on a table (Oracle 9i, Win32)
Unique BLOB on a table [message #520606] Tue, 23 August 2011 12:16 Go to next message
Amine
Messages: 376
Registered: March 2010
Senior Member

Hi all,
Say we have a table T_DOC :
DESC T_DOC;

id_doc   number(10)
image    BLOB


How can we ensure that we have only one row that contains one unique image.

I've tried to create a unique index on that field but indexes can't be build on BLOB fields.

Aby idea ?

Thank you
Re: Unique BLOB on a table [message #520609 is a reply to message #520606] Tue, 23 August 2011 12:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Not possible with basic options, maybe with intermedia one, if you have money to buy it.
I move this topic to this forum.

Regards
Michel

[Updated on: Tue, 23 August 2011 12:26]

Report message to a moderator

Re: Unique BLOB on a table [message #520610 is a reply to message #520606] Tue, 23 August 2011 12:27 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
after you upgrade to supported version you can do as below

http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_crypto.htm#i1002022
Re: Unique BLOB on a table [message #520890 is a reply to message #520610] Thu, 25 August 2011 05:16 Go to previous messageGo to next message
Amine
Messages: 376
Registered: March 2010
Senior Member

I finally did it through Java. Thanks in advance !
Re: Unique BLOB on a table [message #520895 is a reply to message #520890] Thu, 25 August 2011 05:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
OK, thanks for the feedback.

If someone knows an answer with Oracle internal features, feel free to post it here.

Regards
Michel
Re: Unique BLOB on a table [message #521213 is a reply to message #520895] Fri, 26 August 2011 18:43 Go to previous message
Amine
Messages: 376
Registered: March 2010
Senior Member

It depends on what releases we are working on.
Through Oracle 9i, it's not possible to calculate a hash through DBMS_OBFUSCATION package.
And I think there's a lot of bugs in PLSQL packages that uses Java Stored Procedure.
For example, I had to use Java another time to retrieve BLOB objects as OS files. The UTL_FILE.put_raw function has a bug that adds a newline at the end of each BLOB line.
Previous Topic: Oracle Text CATSEARCH with empty field and not returning data
Next Topic: Multi language querying
Goto Forum:
  


Current Time: Thu Dec 26 23:59:34 CST 2024