1

Possible Duplicate:
Is it possible to pass table name as a parameter in Oracle?

I would like to set up an Oracle query where I can externally pass a the Schema or Table name as a variable. For instance:

Select *
FROM &TableName a, &TableName2 b
WHERE a.ID = b.ID

However above does not work. Any feedback would be appreciated.
Thank you.

Community
  • 1
  • 1
user1639184
  • 25
  • 1
  • 7
  • 1
    What tool/ language are you trying to use? Are you trying to use SQL*Plus substitution variables? If the names of the tables are not known at compile time, then you'd be in a position where you would have to use dynamic SQL where you created a string that contains the SQL statement and execute that. Depending on exactly what your requirements are, that can be relatively complex or relatively easy. – Justin Cave Sep 12 '12 at 21:43
  • Check this question http://stackoverflow.com/questions/3690038/is-it-possible-to-pass-table-name-as-a-parameter-in-oracle?rq=1 – Jesse Sep 12 '12 at 21:44

0 Answers0