Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
khaki_monster
Forum Commoner
Posts: 73 Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:
Post
by khaki_monster » Tue Nov 21, 2006 9:42 pm
hello again,
does any body know or idea how to perform bulk/ batch inserts into database under single primary key.
scenario: inserting a set of names("given any numbers names to be inserted") into database with one primary key on each sets.
set 1
- name 1
- name 2
- name 3
- etc...
set 2
- name 1
- name 2
- name 3
- etc...
i hope my question is not so confusing..
tanx.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Nov 21, 2006 9:51 pm
Primary keys are unique in a table. Therefore if you wish to build what you're talking about you will require two tables. One table to hold the primary keys for sets and one to hold the data for each value in the set.
khaki_monster
Forum Commoner
Posts: 73 Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:
Post
by khaki_monster » Wed Nov 22, 2006 12:29 am
sorry bout the post.. anyway, is their any written article regarding this subject? or any example for better picture.
tanx for the reply...
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Nov 22, 2006 12:36 am
There are many articles available detailing one-to-many relationship modeling.