#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    4
    Rep Power
    0

    Can we create a table from a Select query ?


    Can we create a table from a Select query ?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,785
    Rep Power
    348
    Originally Posted by a_amrita
    Can we create a table from a Select query ?
    CREATE TABLE new_table
    AS
    SELECT * FROM old_table

    Btw: This is well documented in the Oracle manuals
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    need to create a table script based on query


    I am sourcing data from one database to another and i want to create a new table script based on a query....can we get to the metadata to do this?
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    854
    Rep Power
    387

    Cool What?


    Originally Posted by hatleye
    I am sourcing data from one database to another and i want to create a new table script based on a query....can we get to the metadata to do this?
    Shammat answered your question, if you did not understand, then either you did not consult the Oracle manuals as suggested OR you did not ask the correct question(s).

    We recommend you:

    1) Clarify your request
    2) Post your query(ies)
    3) Post example data (if applicable)
    4) Post expected result

  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    clarity


    I have this situation:
    system A - system of record database, i have a view for data
    system B - the database I own - different host

    I pulling database from A and putting into B. I cant create a table in A, only B and have no dblink, symlink or anything to bridge to the two databases (I am working in DEV, hitting PROD).

    I need a way to run a select query in A to generate a script to create a table in B.

    More clear? Or did i totally mis-read the manual?
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Location
    Vienna, Austria
    Posts
    58
    Rep Power
    5
    hatleye,

    the DBMS_METADATA.GET_DDL function might be what you are looking for
    Last edited by magicwand; October 18th, 2010 at 02:21 PM.

IMN logo majestic logo threadwatch logo seochat tools logo