Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL '#define' statement

SQL '#define' statement

Scheduled Pinned Locked Moved Database
c++databasequestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RChin
    wrote on last edited by
    #1

    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

    D L 2 Replies Last reply
    0
    • R RChin

      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

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      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[^]

      1 Reply Last reply
      0
      • R RChin

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        RChin wrote:

        Is there an equivalent '#Define' preprocessor for Microsoft's T-SQL, as in C++ ?

        Not that I'm aware of, but you might consider writing a view :)

        I are troll :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups