Hello everyone,
I am struggling to make an insert query for MySQL which contains transformer output.
What I want do make eventually is something like this:
INSERT INTO mytable
(db, tbl, op_name) VALUES
('dbname1', 'tblname1', 'manager_name1'),
('dbname2', 'tblname2', 'manager_name2')
And I want the list of columns in the insert query to be dynamic, so I'm trying this:
INSERT INTO mytable
{{ transformer3_header.value[0] }} VALUES
{{ transformer4_alldata.value }}
from transformer3_header, I got result like this:
{{ transformer3_header.value }} is Array
{{ transformer3_header.value[0] }} is String
0: "(db, tbl, op_name)"
from transformer4_alldata, I got result like this:
{{ transformer4_alldata.value }} is String.
"('dbname1', 'tblname1', 'manager_name1'),('dbname2', 'tblname2', 'manager_name2')"
But when I run the query using transformers, I got syntax error like below:
ER_PARSE_ERROR: You have en error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''(db,tbl,op_name)' VALUES '(\'dbname1\',\'tblname1\',\'manager_na' at line 2
I tried .toString() also, It gives the same error.
It seems the results of transformers are not like the one I see on transformer tab.
So my question is...
how can I remove redundant single quotes and backslashes from transformers values?
Thank you in advance.
padam