Database Inserts
Posted: Fri Aug 30, 2013 5:19 pm
Hello,
I am trying to use GAD to insert rows to a database table and the documentation for the SQL task seems to indicate that this can be done but it doesn't say how to do so.
In my test project I read a set of rows from a CSV and assign them to rowset ${inrows}. I set that variable in the Input Rowset field in the sql task and set my query to
INSERT INTO MYTEST(COLUMN1, COLUMN2, COLUMN3)
but I get an error back indicating java.sql.SQLException: Invalid column index
I tried using this instead:
INSERT INTO MFTTEST(COLUMN1, COLUMN2, COLUMN3)
VALUES(${inrows[1]},${inrows[2]},${inrows[3]})
but I get a different error:
Invalid cursor position: AFTER_LAST
Original expression: inrows[1].
Can you tell me if it is possible to do this and if so what is the appropriate syntax?
Thanks!
Sean
I am trying to use GAD to insert rows to a database table and the documentation for the SQL task seems to indicate that this can be done but it doesn't say how to do so.
In my test project I read a set of rows from a CSV and assign them to rowset ${inrows}. I set that variable in the Input Rowset field in the sql task and set my query to
INSERT INTO MYTEST(COLUMN1, COLUMN2, COLUMN3)
but I get an error back indicating java.sql.SQLException: Invalid column index
I tried using this instead:
INSERT INTO MFTTEST(COLUMN1, COLUMN2, COLUMN3)
VALUES(${inrows[1]},${inrows[2]},${inrows[3]})
but I get a different error:
Invalid cursor position: AFTER_LAST
Original expression: inrows[1].
Can you tell me if it is possible to do this and if so what is the appropriate syntax?
Thanks!
Sean