cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Discover peer insights or crowdsource your one of a kind Designer question.

ODBC connections, parameterize authentication

SOLVED
Atom

Hi

 

My team uses Alteryx desktop.  My goal is to parameterize the username and password for an ODBC connection in a standard workflow.

 

I created a macro using two text boxes and a text input.  The plan was to use the text boxes to update values in the text input.  I then tried to insert the macro into a standard workflow but could not attach the macro to a input data step with the lightening bolt icon.  Does anyone have an example of a parameterized database connection in a standard workflow?

 

 thanks

Alteryx
Alteryx

Hi @jdubw

 

To set up a parameterized database connection you may want to consider creating a macro that has an Input tool in it that uses a full connection string, rather than the connection that Alteryx uses (the connection string would be specific to the database and driver that you are using, this is easily Google-able).  Then with Text Box interface tools you can update specific parts of the connection string like Username or password.  Once the connection string is properly updated with the interface tools a Data Stream Out tool could be attached to the Input tool to bring the results of the query back into the main workflow.  A screen shot below shows the rough set up of how this may look.  (you can ignore the errors, I was using a fake connection string)

 

Here are a couple links that may be helpful when setting this up.

Action tools

Intro to Apps and macros

 

Workflow in screen shot is attached, created with Alteryx 10.6

 

macro screen shot.png

 

Atom

Hi @PeterS

 

Does this method work with other Providers? I am trying to use Teradata (as 'TDOLEDB' found here: https://www.connectionstrings.com/ole-db-provider-for-teradata/) and MySQL ('MySQLProv' found here: https://www.connectionstrings.com/mysql-oledb-mysqlprov/)

 

Every time I change the Provider in the string from 'SQLNCLI10' to 'TDOLEDB' or 'MySQLProv', I get an error message saying "The selected file is not a recognizable type:"

AlteryxError.JPG

Alteryx
Alteryx

Hi @sarawr29,

 

You will first want to configure an Input Data tool to connect to the desired database.  After the tool is configured and connected successfully to the database you can then update the connection string as noted previously.