SQL PATH?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott

    SQL PATH?

    I am using the BETA DB2 Provider for .NET and have ran into the
    following issue.
    I would like to specify a library list and, for each unqualified
    table/schema name that I specify in my query, I would like the correct
    library to be 'looked up' with out having to manually code the Library
    name, LIBRARY.TABLE.

    ex:(Assume TABLE1 resides in LIB1)

    strSQL = "SET PATH = LIB, LIB1, LIB2, LIB3..."
    strSQL = "SELECT * FROM TABLE1"

    How would I go about doing this?
    Thanks!
  • Serge Rielau

    #2
    Re: SQL PATH?

    Hi Scott,

    This is one of my pet features on my wishlist.
    PATH is used for routines, CURRENT SCHEMA for tables and other related
    objects.
    So you can SET CURRENT SCHEMA = LIB1
    But you can't say SET CURRENT SCHEMA = LIB1, LIB2, ...

    One of those days (in Vx) DB2 may first look at SCHEMA and teh fail over
    to PATH.
    Until then, you can use CREATE ALIAS. ALIAS works a lot like a link or
    shortcut in your filesystem. It connects from one(!) directory (schema)
    to a file (table) in another.
    PATH is more of a substriction.
    By contrast SYSNOMYMS (as known in Informix or Oracle) would be a
    publication concept.
    Personally I think subscription is teh way to go.. someday.
    Cheers
    Serge


    --
    Serge Rielau
    DB2 SQL Compiler Development
    IBM Toronto Lab

    Comment

    Working...