Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2008
    Posts
    29

    Unanswered: How to print SQL scripts??

    I'm using Oracle...... and new to oracle
    I have entered some SQL commands and now I would liketo print the Script....I cant seem to find the sql command that I typed before...
    does anyone know how to do it??

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Talking Spool

    Before you enter a script/sql query do something like this:
    Code:
    SQL> set echo on
    SQL> spool mySqlCommands
    SQL> -- Here are my SQL queries:
    SQL> SELECT SYSDATE FROM DUAL;
    
    SYSDATE
    ---------
    23-SEP-08
    
    1 row selected.
    
    SQL> spool off
    An then look in file mySqlCommands.lst
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Sep 2008
    Posts
    29
    how do i look for the file??Where do i look for it??
    Sorry but am new to oracle...

  4. #4
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool Under your nose?

    It's right there under your nose, in the directory from where you executed sqlplus.

    If you are on winDoze, the up-arrow may show previous sql commands.

    Also you can set an alternate location for the spool file:

    Code:
    -- Unix:
    spool /home/myScripts/mySqlCommands
    -- winDoze:
    spool c:\home\myScripts\mySqlCommands
    Also on windoze you can click on: File> Spool> Spool file
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  5. #5
    Join Date
    Sep 2008
    Posts
    29
    I'm using Oracle Database 10g express edition!!
    (Run SQL command Line)

  6. #6
    Join Date
    Sep 2008
    Posts
    29
    My problem is I already typed my sql command and closed it....and now I want to see the commands that I typed before.!!
    I didnt create any file for it before....

  7. #7
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Your problem is that you are using a tool without being educated to do so. Fortunately, there's documentation available at http://tahiti.oracle.com; check the SQL*Plus book. Also, you might visit Oracle 10g XE homepage at Oracle Technology Network.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,296
    v$sql_area or v$sql
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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