Results 1 to 4 of 4

Thread: select ddl

  1. #1
    Join Date
    Apr 2004
    Posts
    190

    Unanswered: select ddl

    Does any have a sql query that creates the ddl for creating a table and granting permissions?

  2. #2
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Do you mean
    Does any have a sql query that creates the ddl for creating a table and granting permissions, based on an existing table in an existing database?
    If so, look at the "db2look" utility that comes with DB2. It will give you all the CREATE TABLE, VIEW, INDEX, PK, FK, TRIGGER, GRANT, ... statements to create a brand new (and empty) database.
    Otherwise, if you want to create the tables and grants from scratch, look at the CREATE TABLE and GRANT statements.

    You can find all this information in DB2 infocenter site.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  3. #3
    Join Date
    Apr 2004
    Posts
    190

    select ddl

    No, I want to be able to build the create statement and grants for an existing table dynamically, by selecting the information from the syscat tables.

    Thanks

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Does db2look server your purpose ?

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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