![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Install Guide: Oracle Database 11g Release 1 on Oracle Enterprise Linux 5 | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 06:10 AM |
| Upgrade Guide: Moving to Oracle RAC 11g on Oracle Enterprise Linux | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 06:10 AM |
| Integrating the Oracle Designer Legacy Table API with Oracle JDeveloper 11g ADF Busin | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 06:10 AM |
| Build Your Own Oracle RAC Cluster on Oracle Enterprise Linux and iSCSI | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 06:10 AM |
| Oracle and Symantec Certify Veritas Data Center Solutions on Oracle - WebWire (press | iBot | UNIX and Linux RSS News | 0 | 07-17-2007 09:30 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Generate a Sequence like in Oracle
#!/usr/bin/ksh
ValUniqueNo=0 export ValUniqueNo FnGenerateUniqueNo() { (( ValUniqueNo = $ValUniqueNo + 1 )) echo $ValUniqueNo export ValUniqueNo=$ValUniqueNo } echo k1=`FnGenerateUniqueNo` echo k2=`FnGenerateUniqueNo` kindly consider the above script. it is required that when the function is called value of ValUniqueNo should be incremented. Can any body help me... |
|
||||
|
You have to have persistent storage - a file, a database table, etc. Oracle sequences are stored along with other metadata like the schema on disk.
Try using a file. But. If this is for multiple processes with simultaneous access, then you have to use some sort of resource locking mechanism - a file lock might be an option. See either man flock or maybe man ioctl |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|