- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Passing in multiple attributes to ExecuteSQL
- Labels:
-
Apache NiFi
Created ‎06-27-2016 05:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have an executeSQL processor that takes in two attributes ($fromDate and $toDate)
ex. select * from table where date > $fromDate and date <$toDate.
The data for these attributes are stored in separate files so my flow looks like this:
fetchFile->extractText->
executeSQL
fetchFile->extractText->
Even though both extractText are connected to the same execute SQL, what I'm noticing is that executeSQL will take only one of these variables and run. I want tobe able to pass in both at the same time before running. I am also surprised it's even able to run with only one parameter. Example, if I disabled either the top or bottom flow, the sql still executes fine. Does it used a cached value?
Created ‎06-27-2016 06:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nevermind, it looked like I was setting my attributes correctly. I combined both the toDate and fromDate into one file, and now my flow looks like:
fetchFile->extractText->executeSQL
fetchFile is from local FS, I use regex to pull the fields I need from the file and set them to their respective variables and use those variables in my executeSQL
Created ‎06-27-2016 06:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nevermind, it looked like I was setting my attributes correctly. I combined both the toDate and fromDate into one file, and now my flow looks like:
fetchFile->extractText->executeSQL
fetchFile is from local FS, I use regex to pull the fields I need from the file and set them to their respective variables and use those variables in my executeSQL
Created ‎08-18-2017 01:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi mliem,can you share screenshot of the processor(properties)
