Is it possible to query the current connection's data source name in teradata? I was hoping to use it to tailor some queries so that they could automatically update certain parts of said queries based on the connection information.
For example, a table in our test environment would have a different suffix than the same table in the production environment. The intent would be to use the same query in both environments, so it would need to be able to discern the current connection data in order to append the appropriate suffix to the table name.
I tried to get this from DBC.SessionInfoV
in the LogonSource
field, as per this answer, but there does not appear to be any pattern between the logon strings that discerns the test environment from the production one - it looks like the strings are simply random.
Here you can see what information I'm looking to actually pull into my query.