How to perform bulk inserts into database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
khaki_monster
Forum Commoner
Posts: 73
Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:

How to perform bulk inserts into database

Post by khaki_monster »

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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
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.
User avatar
khaki_monster
Forum Commoner
Posts: 73
Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:

Post by khaki_monster »

sorry bout the post.. anyway, is their any written article regarding this subject? or any example for better picture.

tanx for the reply...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There are many articles available detailing one-to-many relationship modeling.
Post Reply