Using mapped CSV file with lookups

The simplest way to populate your database with test data.

Using mapped CSV file with lookups

Postby NeoEvaX » Fri Feb 14, 2014 6:26 pm

I have a table (Violations) that I am loading from a csv file. One of the columns is a key to another table (Violation Types).

There are only 3 different Violation Types in that table.

My CSV file includes which Violation Type a given Violation (row) should be. The SQL Data Generator wont let me switch that column away from Foreign Key Generator.

Is there anyway to have a bit more control in those Foreign Keys? Any way to load a number (1-3) to load give a value for the Foreign key.

I was hoping to avoid having to write a script to run afterwards to set those values.
NeoEvaX
 
Posts: 1
Joined: Fri Feb 14, 2014 6:17 pm

Postby Anu Deshpande » Mon Feb 17, 2014 4:13 pm

Thanks for your post.

We have logged a support call for you and will email you shortly.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 735
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge

Re: Using mapped CSV file with lookups

Postby kali000 » Thu Jan 15, 2015 8:45 am

SQL Data Generator has the ability to run a Python script, so if you have a Python script, variable declarations typically begin with the dollar-sign ($). The question must be, how to get a generated column value and use that in a SQL query. This sounds like you would need a combination of two generators - cross-column and SQL statement.
adil
kali000
 
Posts: 1
Joined: Thu Jan 15, 2015 8:40 am


Return to SQL Data Generator 3

Who is online

Users browsing this forum: No registered users and 0 guests

cron