SQL '#define' statement
-
Is there an equivalent '#Define' preprocessor for Microsoft's T-SQL, as in C++ ? I want to be able to declare two table names, then go on and use these name definition elsewhere in the SQL statement eg.
#DEFINE TableA 'SomeTable' SELECT * FROM TableA
I Dream of Absolute Zero
-
Is there an equivalent '#Define' preprocessor for Microsoft's T-SQL, as in C++ ? I want to be able to declare two table names, then go on and use these name definition elsewhere in the SQL statement eg.
#DEFINE TableA 'SomeTable' SELECT * FROM TableA
I Dream of Absolute Zero
You might want to investigate Oracle's support for dynamic SQL. The key phrase to Google is "EXECUTE IMMEDIATE" Maybe start with this article http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm#BHCEBBAI[^]
-
Is there an equivalent '#Define' preprocessor for Microsoft's T-SQL, as in C++ ? I want to be able to declare two table names, then go on and use these name definition elsewhere in the SQL statement eg.
#DEFINE TableA 'SomeTable' SELECT * FROM TableA
I Dream of Absolute Zero