Update Multiple Parts of SQL Statement in Dynamic Input Tool
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am currently using a list to update the WHERE clause in my SQL statement to pull only a certain list of materials. But I would also like to have a prompt for the number of months of data to pull. Is there a way to have an additional part of the SQL statement updated?
This is an example of the SQL statement. Right now the Dynamic Input Tool is updating the ('Update', 'This') using the list of Materials connected to this tool. I would also like to update the "12" in the posting date to have that be input by the user of the workflow. So if they wanted only 6 months of data, they could input a 6 to override the 12.
select db.table_Field1 as "Material",
db.table_Field2 as "Customer_No",
db.table_Field3 as QTY,
db.table_Field4 as "Post_Date",
from db.table
where db.table_Field1 in ('Update', 'This')
and db.table_Field4 >= Add_Months(Trunc(SysDate, 'month'), -12)
and db.table_Field4 < Trunc(SysDate, 'month')
- Labels:
- Dynamic Processing
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @cjaneczko
Add a "Replace a Specific String" parameter in your Dynamic Input config and have it replace the "12" in your SQL string
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@danilang So I tried that but its asking for a Replacement Field. The only option in the dropdown is the field that contains the list of Materials connect to the input tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I ended up having to generate the WHERE clause with a formula by concatenating multiple fields into one field. Couldnt figure out how to supply the Dynamic Input tool with multiple fields. It would only accept one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
just replace the entire query using dynamic input in-db.
