LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 09-04-2008, 08:33 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Generating a Primary Key for a Table


Hello,
If I have 2 tables, one for people - say their names, ages, etc. and a second for their addresses (this is because 1 person can have more than 1 address), when someone inputs a new entry for the "person" table, I need to generate a new Primary Key for that table (which will go sequentially beneath whatever's there), and will also go into the "Addresses" table (which can be the same as another key, in case that person already has another address in the table) - how do I get this no.? And then actually do the INSERTing?

Thanks.
 
Old 09-04-2008, 08:35 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Ahem....You have been here long enough to know that you are not supposed to post duplicate threads. Reported for closure.
 
Old 09-04-2008, 12:03 PM   #3
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Follow discussion here:
http://www.linuxquestions.org/questi...-table-667520/
 
  


Closed 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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating a Primary Key for a Table resetreset Linux - Server 11 09-07-2008 06:52 AM
booting RedHat - generating SSH1 RSA hosh key [FAILED] pru Linux - Newbie 1 02-04-2008 09:09 AM
How to determine PRIMARY KEY in mySQL Runnerdave Programming 3 07-11-2006 12:51 PM
gpg primary key doctor_sniff Linux - Software 3 06-11-2005 09:55 AM
multiple primary key on gpg carboncopy Linux - Software 2 12-21-2004 08:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration