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!
Solved! Go to Solution.
Hi @summarizer
You could add it to your query, I think this might work:
select *, 'PERSON' as TABLENAME from PERSON
Cheers,
@summarizerWhy don't you add the Table name in your select statement (e.g. Select employee, id, name, 'person' as table)?
Thanks! I am relatively new to SQL. I wasn't even thinking about that! Yep, super easy! Thanks!!!
Yep, thanks John. Feeling a very silly Weds afternoon "duh" moment. Thanks for the advice!!!
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