Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2003
    Posts
    16

    Unanswered: How do I load DDL scripts?

    Hi,

    I created a sample.ddl script with multiple CREATE TABLE statments trying to
    create many tables at once. I am using Oracle9i. How can I do that? Thanks.

  2. #2
    Join Date
    Nov 2005
    Location
    Atlanta, GA USA
    Posts
    20
    sqlplus @sample.ddl

  3. #3
    Join Date
    Jul 2003
    Posts
    16
    Quote Originally Posted by philgarr
    sqlplus @sample.ddl
    Coud you be more specific? I am a newbie on Oracle, just started using it.

    You mean go to the location where sample.ddl sits? Thanks.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Do you use a tool like TOAD or are you executing the script from SQL*Plus? Saying that you are a newbie, I presume you'll use the second approach - SQL*Plus. Knowing OS you're having would help, but let me guess that it is one of MS Windows OS versions.

    Run the Command prompt (Start - Run - CMD); go to the directory that contains the script you wrote (for example, CD C:\SCRIPTS). Now invoke SQL*Plus issuing such a command:

    > SQLPLUS username/password@database

    If the database is on your PC and you don't have other entries in the TNSNAMES.ORA file, you might omit "@database" part.

    When in SQL*Plus, run any SQL command you want, or run the script you wrote as:

    SQL> @sample.ddl

  5. #5
    Join Date
    Jul 2003
    Posts
    16
    Thanks, that works. If I drop my ddl file in bin directory where SQL*Plus sits,
    then run start sample.ddl, that works too, but not as good as your method.
    Will find out about TOAD. Really appreciate it.


    Quote Originally Posted by Littlefoot
    Do you use a tool like TOAD or are you executing the script from SQL*Plus? Saying that you are a newbie, I presume you'll use the second approach - SQL*Plus. Knowing OS you're having would help, but let me guess that it is one of MS Windows OS versions.

    Run the Command prompt (Start - Run - CMD); go to the directory that contains the script you wrote (for example, CD C:\SCRIPTS). Now invoke SQL*Plus issuing such a command:

    > SQLPLUS username/password@database

    If the database is on your PC and you don't have other entries in the TNSNAMES.ORA file, you might omit "@database" part.

    When in SQL*Plus, run any SQL command you want, or run the script you wrote as:

    SQL> @sample.ddl

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I didn't quite understand why would "my" method be better than "yours" - both should work the same way (storing your scripts in the \BIN directory is not such a good idea).

    If you don't want to change working directory all the time, include it into the SQLPATH in the registry.

    TOAD can be downloaded (it has a free version) at Quest software page; another interesting tool would be Oracle SQL Developer.

  7. #7
    Join Date
    Jul 2003
    Posts
    16
    Thanks.

    I guess its not a good idea to drop all ddl sql scripts in bin directory. Thanks for the info about TOAD.

    Quote Originally Posted by Littlefoot
    I didn't quite understand why would "my" method be better than "yours" - both should work the same way (storing your scripts in the \BIN directory is not such a good idea).

    If you don't want to change working directory all the time, include it into the SQLPATH in the registry.

    TOAD can be downloaded (it has a free version) at Quest software page; another interesting tool would be Oracle SQL Developer.

Posting Permissions

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