DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 27th, 2004, 04:24 PM
fractalvibes fractalvibes is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Location: Waco, Texas
Posts: 630 fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 11 h 21 m 37 sec
Reputation Power: 21
generate_unique

has any one tried UDB V8 (windows) function
generate_unique() and had any issues with it?

thanks,

fv
__________________
...because that is the way we have always done it. We've been doing it like that for 80 Years! (How do we change that mindset?)

Reply With Quote
  #2  
Old July 27th, 2004, 08:32 PM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,173 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 24
I have never used it in any of my tables so I'm not sure if there are any issues to worry about. The only thing I can think of is Windows boxes have an option to automatically adjust the time for Daylight Savings Time. The generate_unique() function uses the internal clock to create an ever increasing bit value based on the time. Adjusting the time on your machine backwards can create duplicate values.

Does generate_unique() have the ability to ignore the clock jumping backwards each year? Does it create its value off of the base time ignoring the one hour tweaks twice a year? You would hope they would be smart enough to program it that way. Otherwise, for one hour a year when the clocks fell back, you could run the risk of a duplicate value. Of course this point would be moot if your Windows box was set to UTC or to ignore Daylight Savings Time.

My gut feeling is that the function probably uses a base time and ignores any time zone or DST settings that have been applied to it. If that is true then the only caveat would be: Don't ever adjust the time on your machine backwards.

Reply With Quote
  #3  
Old July 27th, 2004, 09:22 PM
fractalvibes fractalvibes is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Location: Waco, Texas
Posts: 630 fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 11 h 21 m 37 sec
Reputation Power: 21
Thanks for the input - a little more investigation:
http://www-106.ibm.com/developerworks/db2/library/techarticle/0205pilaka/0205pilaka2.html#section2

yields this snippet of info:
Another point to keep in mind is that since the timestamp value created from the GENERATE_UNIQUE function is obtained from the system clock, adjustments to the system clock backward could result in duplicate values.


Basically I have to generate a unique confirmation number for clients. The system is a web (ASP/DB2) based app that mostly uses Z/OS tables. The confirmation # must be in an Z/OS table ultimately.
My choices are:

1 Z/OS - a table that is just used for its identity value
(dumb)

2.) UDB (Windows) use a Sequence object and then store that in Z/OS

3.) generate_unique(windows) and do the same as 2.

So far #2 looks like the best idea. The only way to do natively in Z/OS would be a table with maybe 2 columns, and identity value ID that is generated and some other column, maybe a timestamp so I could do an insert and get the ID value with identity_val function. #2 would work without any actual table activity.

Still Thinking...

thanks,

fv

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > generate_unique


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway