in reply to Perl Database Entries

cbtshare:

If your $api_results is holding a reference to an array of arrays of data like this:

$api_results = [ [ "id1", "app_slug1", "app_name_1", "provider_id_1", ..etc.. ], [ "id2", "app_slug2", "app_name_2", "provider_id_2", ..etc.. ], . . . . . . . . . . . . . . . [ "idN", "app_slugN", "app_name_N", "provider_id_N", ..etc.. ] ];

Then I think what you're looking for is:

# Prepare a handle to an insert statement: $app_insert = $dbh->prepare("INSERT .....blah, blah"); # Fetch each row of data from results while (my $row = shift @$api_results) { # Tell the insert statement to insert the data $app_insert->execute(@$row); } print "Done inserting\n";

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: Perl Database Entries
by cbtshare (Monk) on Jul 14, 2017 at 23:48 UTC

    ok, thank you , will try this and get back to you.