05-18-2008
Unique value added
Guys,
I am trying to get unique numbers which i can use as a primary key in a table. I tried using the <seconds_since_epoch>.<hostname> combination but since more than one process can run on the same machine at the same time, this won't be unique either. Can anyone tell me another way to do this? Thanks.
Regards,
garric
9 More Discussions You Might Find Interesting
1. Programming
Given the following:
#include <string.h>
#include <stdlib.h>
#include <pwd.h>
#include <unistd.h>
#include <utmp.h>
#include <stdio.h>
#include <time.h>
int main(int argc, char *argv)
{
struct utmp entry;
char *fd;
system("echo before adding entry:;who");
... (1 Reply)
Discussion started by: frequency8
1 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I have two AIX 5.3 servers that are supposedly set up exactly the same. The problem I am having is on one of the servers, it seems dynamic routes are being added mysteriously and non-periodically. This only happens on one server and not the other. Also, there doesn't seem to be a specific... (1 Reply)
Discussion started by: Conutmonky
1 Replies
3. Shell Programming and Scripting
I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM".
I can find the line number for the beginning of the statement section with sed.
... (5 Replies)
Discussion started by: andrewsc
5 Replies
4. Shell Programming and Scripting
I have 84 files with the following names splitseqs.1, spliseqs.2 etc.
and I want to change the .number to a unique filename.
E.g.
change splitseqs.1 into splitseqs.7114_1#24
and
change spliseqs.2 into splitseqs.7067_2#4
So all the current file names are unique, so are the new file names.... (1 Reply)
Discussion started by: avonm
1 Replies
5. Red Hat
Hello Guys..
I am facing this weird problem of static route not added after reboot!!
Following is my route-<interface> file..
# cat /etc/sysconfig/network-scripts/route-eth0
ADDRESS0=172.31.0.1
NETMASK0=255.255.255.255
GATEWAY0=192.168.208.1
ADDRESS1=172.31.15.2... (3 Replies)
Discussion started by: parth_buch
3 Replies
6. UNIX for Dummies Questions & Answers
I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies
7. Shell Programming and Scripting
Hello Team,
I need your help on the following:
My input file a.txt is as below:
3330690|373846|108471
3330690|373846|108471
0640829|459725|100001
0640829|459725|100001
3330690|373847|108471
Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Discussion started by: angshuman
4 Replies
8. Shell Programming and Scripting
I have added several lines to my code
let cnt=0
if
then
if
then
cnt=`expr ${cnt} + 1`
sftp_name=EOMMSRPT1
echo "EOMsftpname = ${sftp_name}" >> ${LOGF}
... (2 Replies)
Discussion started by: digioleg54
2 Replies
9. UNIX for Beginners Questions & Answers
Please could someone have a look at the code below and spot the cause of the error.
Thanks in advance.
CODE BELOW: (code tags now added) My apologies please, that was my first time here.:)
#! /bin/bash
# file: whileloop.sh
arr1=(2 4 6 8)
arr2=(3 6 9 12)
arr3=()
indextotal=(${#arr1})... (4 Replies)
Discussion started by: Chiadi
4 Replies
LEARN ABOUT PHP
odbc_foreignkeys
ODBC_FOREIGNKEYS(3) 1 ODBC_FOREIGNKEYS(3)
odbc_foreignkeys - Retrieves a list of foreign keys
SYNOPSIS
resource odbc_foreignkeys (resource $connection_id, string $pk_qualifier, string $pk_owner, string $pk_table, string $fk_qualifier,
string $fk_owner, string $fk_table)
DESCRIPTION
Retrieves a list of foreign keys in the specified table or a list of foreign keys in other tables that refer to the primary key in the
specified table
PARAMETERS
o $connection_id
-The ODBC connection identifier, see odbc_connect(3) for details.
o $pk_qualifier
- The primary key qualifier.
o $pk_owner
- The primary key owner.
o $pk_table
- The primary key table.
o $fk_qualifier
- The foreign key qualifier.
o $fk_owner
- The foreign key owner.
o $fk_table
- The foreign key table.
RETURN VALUES
Returns an ODBC result identifier or FALSE on failure.
The result set has the following columns:
oPKTABLE_QUALIFIER
oPKTABLE_OWNER
oPKTABLE_NAME
oPKCOLUMN_NAME
oFKTABLE_QUALIFIER
oFKTABLE_OWNER
oFKTABLE_NAME
oFKCOLUMN_NAME
oKEY_SEQ
oUPDATE_RULE
oDELETE_RULE
oFK_NAME
oPK_NAME
If $pk_table contains a table name, odbc_foreignkeys(3) returns a result set containing the primary key of the specified table and all of
the foreign keys that refer to it.
If $fk_table contains a table name, odbc_foreignkeys(3) returns a result set containing all of the foreign keys in the specified table and
the primary keys (in other tables) to which they refer.
If both $pk_table and $fk_table contain table names, odbc_foreignkeys(3) returns the foreign keys in the table specified in $fk_table that
refer to the primary key of the table specified in $pk_table. This should be one key at most.
PHP Documentation Group ODBC_FOREIGNKEYS(3)