cancel
Showing results for 
Search instead for 
Did you mean: 

Running a SQL query obtained via user input

SOLVED
Highlighted
OS85
Atom

I am new to Alteryx and wanted to understand if there was some way of using a query (obtained as a user input) to pull data from a database using an ODBC connection. We can get the user to either upload a .txt file containing the entire query or have them paste the query as a text input.

The closest solution that I could think of was using a R tool (with the RODBC package) to achieve this. Is there any other way of accomplishing this ? 

Thanks !

  • Database Connection
  • R Tool
Pulsar
Pulsar

Hi @OS85

If it's always the same database (same ODBC or whatever), then unless I'm missing something, I think Dynamic Input would work great: just use the "replace a specific string" option, and replace an entire dummy query with whatever the user supplies.

Hope that helps.

John

Quasar

:-) John, you beat me to it.

 

@OS85 - I've mocked this up for you below - as John says, the simple way to do this is to set up your dynamic input in a way that you have a good query response, and then do a string replace.

 

 

OS85
Atom

@JohnJPS and @SeanAdams,

Thank you both for your prompt replies ! The Dynamic Input tool works great !!