From Talend we could invoke the Engine directly but at the time of this writingTalend lacks support for internal resources definition..
A custom component exists though, called tSQLScriptParser which can provide a work around. Here is how:
- Download the component and install it.
- Define your sql inside "SQL Script" field, for example for a sqlite table called person:
"drop table if exists person; create table person (name varchar(32)); insert into person values('Foo'); insert into person values('Bar');"
- Connect "iterate" output to a t{DB}Row component. In the picture as you can see we use tSqliteRow
- In the SQL field for the t{DB}Row use the below:
((String)globalMap.get("tSQLScriptParser_1_STATEMENT_SQL"))
- Run it and you can confirm the statements have run. For our example:
$ echo "select * from person;" | sqlite3 /tmp/sqlite_test.db Foo Bar
No comments:
Post a Comment