Quantcast
Channel: Mockaroo Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 2665

Split SQL insert statements for a schema using other datasets

$
0
0

Hello, I've been trying to generate SQL statements for a schema that has fields from another schema(field type: Dataset Column). The output is in the form of a single insert statement.

My schema: https://www.mockaroo.com/39dd86a0

The first 3 columns(id, first_name, last_name) belong to the Person Dataset
The last 2 columns(ip_address, IMEI_hardware_id) belong to the Device Dataset

Output I got: insert into MOCK_DATA (id, first_name, last_name, ip_address, IMEI_hardware_id) values (1, 'Conrad', 'Domesday', '196.17.41.148', 400997199931300);

Output I want: ["insert into Person(id, first_name, last_name) values (1, 'Conard', 'Domesday')", "insert into Device(ip_address, IMEI_hardware_id) values ('196.17.41.148', 400997199931300)"] - not exactly, but something like this

or any other workaround that splits the insert statements

Thanks in advance

P.S. Mockaroo is an excellent tool


Viewing all articles
Browse latest Browse all 2665

Trending Articles