Pass Table name in from statement by Other means

Database
Enthusiast

Pass Table name in from statement by Other means

Hi All,

It may seem weird, but i came across this. i have a stored procedure written which takes isource_db as input, Eg: UAT_GCFR_VIEW.XYZ

Now Ahead in the Stored Procedure, i need to execute select statement like (eg.) : SELECT * FROM DEV_GCFR_VIEW.XYZ However, I want to replace the DEV with UAT(i.e whatever given by user in iSource_db variable.

Guys, can you please Help me out on this?

Tags (2)
1 REPLY
Teradata Employee

Re: Pass Table name in from statement by Other means

You can do something like this:

'UAT'||substr(:isource_db,4)