Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacement for dbms_session.unique_session_id?

Status
Not open for further replies.

rtefft

Programmer
Aug 23, 2001
70
US
I was using DBMS_SESSION.UNIQUE_SESSION_ID to generate a temporary unique value for a common table, to keep each sessions temp data separate. However, our ColdFusion front end uses a single session (with multiple connections each) so all users in the application get the same result from the UNIQUE_SESSION_ID call. Does anyone know a reliable way to generate a unique value per connection vice session, without pages of PL/SQL code?

Options I am considering include:
- DBMS_RANDOM (not installed by default, so not an option)
- A sequence (waste of a DB object if we can help it)
- 3rd party random generators (pages of code, not worth it)

Thanks in advance,
Rich

____________________________
Rich Tefft
PL/SQL Programmer
 
I decided on using DBMS_RANDOM after all, and just being careful how I seed it. I include the user's USER_ID from ALL_USERS and seconds since midnight in my seed to keep it unique enough. If I use the same seed, I always get the same numbers. Consider this thread closed. ____________________________
Rich Tefft
PL/SQL Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top