Using MySQL as target, I can insert multiple values at once using the following syntax
INSERT INTO mytable
(id,first_name,last_name)
VALUES (1,'John','Doe'),
VALUES (2,'Jane','Doe'),
VALUES (3,'Donald','Trump'),
However, using the SQL parser, I can only do 1 at a time.
So, if I parse the following statement:
INSERT INTO mytable (id,first_name,last_name) VALUES (1,'John','Doe')
... I get the following result
{
"status": true,
"value": {
"type": "insert",
"into": {
"table": "mytable",
"alias": null,
"expression": "mytable"
},
"values": [
{
"target": {
"expression": "id",
"column": "id"
},
"value": "1"
},
{
"target": {
"expression": "first_name",
"column": "first_name"
},
"value": "'John'"
},
{
"target": {
"expression": "last_name",
"column": "last_name"
},
"value": "'Doe'"
}
]
}
}
But if I parse the following statement:
INSERT INTO mytable (id,first_name,last_name) VALUES (1,'John','Doe'),(2,'Jane','Doe'), (3,'Donald','Trump')
...I get the following error
{
"status": false,
"index": 69,
"expected": [
"EOF"
],
"error": "expected EOF at character 69, got '...,(2,'Jane','...'"
}
Using MySQL as target, I can insert multiple values at once using the following syntax
However, using the SQL parser, I can only do 1 at a time.
So, if I parse the following statement:
... I get the following result
{ "status": true, "value": { "type": "insert", "into": { "table": "mytable", "alias": null, "expression": "mytable" }, "values": [ { "target": { "expression": "id", "column": "id" }, "value": "1" }, { "target": { "expression": "first_name", "column": "first_name" }, "value": "'John'" }, { "target": { "expression": "last_name", "column": "last_name" }, "value": "'Doe'" } ] } }But if I parse the following statement:
...I get the following error
{ "status": false, "index": 69, "expected": [ "EOF" ], "error": "expected EOF at character 69, got '...,(2,'Jane','...'" }