camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Wulff <owu...@talend.com>
Subject delete records of db table before importing from csv
Date Thu, 15 Nov 2012 12:11:55 GMT
Hi there

I've defined a camel route which imports data from a csv file into a table. Before that, the
content of the db table must be deleted. The import works fine but I don't know how to add
step to delete the content of the table "USER".

        <route id="myimport">
            <from uri="file:src/data/import/?charset=iso-8859-1" />
            <split streaming="true" parallelProcessing="true">
                <tokenize token="\n" />
                <unmarshal>
                    <csv delimiter=";" />
                </unmarshal>
                <setBody><simple>${in.body[0]}</simple></setBody>
                <to
                    uri="sql:INSERT INTO USER (USER, FIRSTNAME, LASTNAME, LOCATION)
                           VALUES (#, #, #, #)?dataSourceRef=myDS" />
            </split>
        </route>

Any hint is highly appreciated.

Thanks
Oli



<http://coders.talend.com>Talend Application Integration Division http://www.talend.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message