cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax for ora_hash???

Former Member
0 Kudos

BOXI31 SP3 - Oacle 10g

Trying to create an object using Oracle "HASH" function... keep getting ora-00911 invalid character.. appears a syntax issue... I've tried variations, can't get this to work?

ORA_HASH( %1, %2, %3),<table.object>, numeric value, extract(day_of_year from sysdate)

Thoughts?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am not familiar with the function, but after reading a bit of the web I assume that the syntax you would need to use in your universe would be this:

ORA_HASH(table.column, numeric value, to_char(sysdate,'DDD))

The to_char() input value of DDD should provide the day of year. That may / may not be functionally equivalent to what you wrote with the "extract" syntax.

Former Member
0 Kudos

Dave, you're a star!

Thanks so much, looking into this further, I'm also playing with the oracle encrypt function as a possible alternative.

Former Member
0 Kudos

Can I ask what you're using this for? I've been away from Oracle for a while (working mostly on DB2 and Teradata) but I used to be almost exclusive to Oracle. I'm wondering what you are hoping to accomplish this this function. Hash functions are a one-way process, so you can encrypt but cannot decrypt the results. For that reason they're often used for passwords. I can take the password you give me, hash it, and compare the results to the stored hash, and that's how I know if you gave me the proper password. But I can't "unhash" the password and tell you what your original password was.

So I'm curious as to how you intend to use the function, if you can share.

Answers (0)