girls3dog1
Programmer
For a simple SQL query I'd like to have the table name be a variable such that I can change the table name during runtime. I guess the advantage is that I just have to write the SQL once as I have many tables to query with the same where clause. To date, I've only had experience with tbl_name being the actual name of the database table, which of course works just fine.
Ex. Select column_X, column_Y, column_Z
From tbl_name *
Where column_X = "ABC"
* tbl_name would be local string variable that I would set in the script before I hit the Select statement. Is this possible in SQL?
Ex. Select column_X, column_Y, column_Z
From tbl_name *
Where column_X = "ABC"
* tbl_name would be local string variable that I would set in the script before I hit the Select statement. Is this possible in SQL?