I think an approach that could work is the following:

1) Start with a ListFile processor to locate the filenames of the files you 
want to load into netezza

2) Send to a ReplaceText processor, where you replace the entire contents of 
the flow file with:
insert into MYTABLE 
select * FROM EXTERNAL '${filename}' 
USING (<JDBC Options>) ;


Note I’m using Expression Language to refer to the “filename” attribute. Each 
incoming flow file will have that attribute set to one of the files found by 
the ListFile processor.



3) Send to a PutSQL processor. Your SQL statement(s) are complete at this point 
so you don’t need arguments, parameters, etc.

I haven’t tried this yet but it seems like it should work. If you give it a 
try, please let us know how it works for you :)

Regards,
Matt


On 1/28/16, 3:04 PM, "Joe Percivall" <[email protected]> wrote:

>Hello Obaid,
>
>Sorry no one has gotten back to you sooner, many of the developers are working 
>diligently to get 0.5.0 done.
>
>I don't know too much about loading SQL tables but when you say "local file 
>system filename", is this a file that exits on the target system? If so you 
>may just be able to set that command because my understanding is that using 
>ExecuteSQL you have an input query which gets sent to the target server. Then 
>the target server then runs that command.
>
>Can anyone else that has more experience with SQL and loading tables chime in?
> 
>
>Joe
>- - - - - - 
>Joseph Percivall
>linkedin.com/in/Percivall
>e: [email protected]
>
>
>
>On Saturday, January 23, 2016 12:31 AM, obaidul karim <[email protected]> 
>wrote:
>
>
>
>Hi,
>
>I developing a nifi processor for netezza. 
>As per by experience the best way to load data to netezza is using netezza 
>JDBC external table.
>
>I want to run below command to load a file within NiFi processor.
>
>insert into MYTABLE 
>select * FROM EXTERNAL '<local file system filename>' 
>USING (<JDBC Options>) ;
>
>My question is which file to usefor <local file system filename>  ?
>- Is it the flow files ? If yes then how can I get full path of a flowfile ?
>- or can I directly load the file in a spool directory ?
> 
>
>Thanks for your help in advance.
>
>-Obaid

Reply via email to