Re: [SQL] Question on imports with foreign keys

2011-12-10 Thread Jasen Betts
On 2011-12-08, Andreas wrote: > Hi, > > suppose you need to import a csv with standard ciolums like name, > adress, phone, ... and some additional text columns that need to be > split off into referenced tables. ... > How is the easiest way to to find the customer.id of the new customers > so I

Re: [SQL] Question on imports with foreign keys

2011-12-09 Thread Emre Hasegeli
On Thu, 08 Dec 2011 12:10:06 +0200, Andreas wrote: Lets's say there were already 1000 records in the customers table. Now I add 357 new customers to this table. If I use one of your queries I'd get all 1357 entries of customers since "project_x.projectinfos" would be newly created for this p

Re: [SQL] Question on imports with foreign keys

2011-12-08 Thread Andreas
Am 08.12.2011 09:39, schrieb Emre Hasegeli: On Thu, 08 Dec 2011 08:48:51 +0200, Andreas wrote: How is the easiest way to to find the customer.id of the new customers so I can insert the projectinfos? It is easy to select rows not related with another table. One of the following queries ca

Re: [SQL] Question on imports with foreign keys

2011-12-08 Thread Emre Hasegeli
On Thu, 08 Dec 2011 08:48:51 +0200, Andreas wrote: Hi, suppose you need to import a csv with standard ciolums like name, adress, phone, ... and some additional text columns that need to be split off into referenced tables. Those lookup-tables will only be needed for a project with limite

[SQL] Question on imports with foreign keys

2011-12-07 Thread Andreas
Hi, suppose you need to import a csv with standard ciolums like name, adress, phone, ... and some additional text columns that need to be split off into referenced tables. Those lookup-tables will only be needed for a project with limited life time so I create a schema that might be called "