Home » RDBMS Server » Server Administration » Oracle keeps giving back cached results...not new.....help!!!
Oracle keeps giving back cached results...not new.....help!!! [message #370059] Thu, 07 December 2000 23:36 Go to next message
Ryan Dorosh
Messages: 12
Registered: October 2000
Junior Member
I have a problem. I'm calling a function in a package that gives a random string. When I call this in SQL+ I get unique results ever time I do my select. When I place this same select statement inside a compile package, it returns the same random string time after time.

I believe that this has something to do with Oracle caching the result.

Any advice would be appreciated.

Ryan.
Re: Oracle keeps giving back cached results...not new.....help!!! [message #370064 is a reply to message #370059] Fri, 08 December 2000 05:21 Go to previous messageGo to next message
John R
Messages: 156
Registered: March 2000
Senior Member
What is the random number generated from, and what are the differences between the code you use in the SQL statement and the Pl/Sql version?
Re: Oracle keeps giving back cached results...not new.....help!!! [message #370065 is a reply to message #370064] Fri, 08 December 2000 09:07 Go to previous message
Ryan Dorosh
Messages: 12
Registered: October 2000
Junior Member
The randomize package was actually downloaded off this site from the scripts section. It works extremely well when you call the function from SQL+. This is the call to get a random string.
"select random.rand_string(20) from dual;"

If I place this inside my package, and call for a random string multiple times I'll get the same string. If I wait 5 minutes or so, I'll get a new string generated, but repeated if called for again multiple times. It seems there is a 'time out' where if you wait long enough before running the select it will flush the buffer.
Previous Topic: sql
Next Topic: SQL newbie question: nested query
Goto Forum:
  


Current Time: Sun Dec 22 20:08:58 CST 2024