How to get a unique system-generated name for temporary table?
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: How to get a unique system-generated name for temporary table?

  1. #1

    How to get a unique system-generated name for temporary table?

    I remember there is a function to get a unique system-generated name for temporary table but don't know how.
    Please let me know if someone knows.

    Thanks.

    Queyon
    Queyon Zeng

  2. #2
    Use a sequence as part of the name?

    What is the requirements for this? Would a Global Temporary Table work better?

  3. #3
    I want to create a global temporary table but don't want to get any table name confict.
    Queyon Zeng

  4. #4
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,441

    Cool


    You could also use a timestamp:
    PHP Code:
    Create Table MyTempTable_<YYMMDDHH24MISS>... 


    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,095
    Quote Originally Posted by Queyon
    I want to create a global temporary table but don't want to get any table name confict.
    Why in the world would you want to go through the overhead of creating a temporary table when you can just use a GTT?
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  6. #6
    Join Date
    Jun 2005
    Posts
    31
    Quote Originally Posted by Queyon
    I want to create a global temporary table but don't want to get any table name confict.
    Read this very interesting article - it answers your question:

    http://www.indiana.edu/~dss/Services...s/tmptabl.html

  7. #7
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,136
    Quote Originally Posted by Queyon
    I want to create a global temporary table but don't want to get any table name confict.
    Do you know how GTT operates in Oracle?

    Tamil

  8. #8
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,095
    Quote Originally Posted by tamilselvan
    Do you know how GTT operates in Oracle?

    Tamil
    have to agree with that. trying to shoehorn somebody else's database on oracle. sometimes square pegs just don't fit into round holes no matter how big the hammer.
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  9. #9
    Quote Originally Posted by LKBrwn_DBA

    You could also use a timestamp:
    PHP Code:
    Create Table MyTempTable_<YYMMDDHH24MISS>... 


    Hopefully nobody will attempt to do that operation twice in a second...

  10. #10
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Quote Originally Posted by Queyon
    I want to create a global temporary table but don't want to get any table name confict.
    If you create a GTT you only do it once and and any name conflict you'd resolve then. GTT avoids the need to create a name dynamically.
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width