Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon Data Pipeline "Load S3 Data to RDS MySQL" query format?

I was wondering what the SQL Query format would be for inserting data from a CSV into MySQL would be. The template it gives is, "INSERT INTO tablename (col1, col2, col3) VALUES (?,?,?);"

Because the values are dynamic and different in each CSV file, what are they looking for to replace the question marks?

Here is a link to the general format of the template.

http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-template-copys3tords.html

Best,

kakkman

like image 360
kakkman Avatar asked Nov 08 '22 16:11

kakkman


1 Answers

For the this query,

You don't need to specify the question mark when you execute query.

What does a question mark represent in SQL queries?

You only need to care about columns which are named correctly.

let's say you have a table: contact(id, name, phone, address).

Then, the query should be "INSERT INTO contact(id, name, phone, address) VALUES(?,?,?,?)"

like image 192
Junren Avatar answered Nov 14 '22 20:11

Junren