Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Bring data connection Oracle database table name downstream

summarizer
9 - Comet


Hi all.  I have a data connection in which I have SQL code doing a basic select* from a PERSON table in my database.  I would like it to dynamically fill in the table name in my formula tool.  Currently, I'm entering the table name manually and it's a pain.  Any ideas?  I'm on 2018.2 if that matters.  Thanks!

 

TABLE NAME.jpg

5 REPLIES 5
Thableaus
17 - Castor
17 - Castor

Hi @summarizer 

 

You could add it to your query, I think this might work:

 

select *, 'PERSON' as TABLENAME from PERSON

 

Cheers,

john_miller9
11 - Bolide

@summarizerWhy don't you add the Table name in your select statement (e.g. Select employee, id, name, 'person' as table)?

summarizer
9 - Comet

Thanks!  I am relatively new to SQL.  I wasn't even thinking about that!  Yep, super easy!  Thanks!!!

summarizer
9 - Comet

Yep, thanks John.  Feeling a very silly Weds afternoon "duh" moment.  Thanks for the advice!!!

summarizer
9 - Comet

And for the good of the order, I wanted to list what worked for me.  For my Oracle SQL, this was the correct syntax to create that column to the right of all the others.  I needed the table name (or alias like here) then a dot and the asterisk.  Thanks again! @Thableaus @john_miller9 

 

SELECT
PERSON.*
,'PERSON' as Table_Name
from
ORACLE_DATABASE.V_PERSON PERSON

Labels