Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Jul 2012
    Posts
    11

    Unanswered: sql command line

    I spooled a text to "c" drive. What command can i use in the command line to retrieve continue the text?

    I am a novice in the field.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I spooled a text to "c" drive. What command can i use in the command line to retrieve continue the text?
    Might specific answer depend upon which Operating System (OS) the database resides?
    exactly how do you view contents of plain text file for your OS?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jul 2012
    Posts
    11
    The OS is Windows and the Oracle 11g
    eg. the txt is stored as "lesson.lst"

  4. #4
    Join Date
    Jul 2012
    Posts
    11
    the file type is LST file. How do command it open in sql command line so i can continue with the work?

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Forgive me but I am not sure exactly what you want to do with file "lesson.lst" (or even what it contains).
    at OS command line you can do the following to display content of this file:

    $ TYPE LESSON.LST
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  6. #6
    Join Date
    Jul 2012
    Posts
    11
    The issue is we are designing a small database for school. In the file in question is some tables created and stored (spooled).
    1. how to use sql command line to retrieve the stored file
    2. continue in the table creation
    3. spool back the update under the same file name.

  7. #7
    Join Date
    Jul 2012
    Posts
    11
    The issue is we are designing a small database for school. In the file in question is some tables created and stored (spooled).
    1. how to use sql command line to retrieve the stored file
    2. continue in the table creation
    3. spool back the update under the same file name.

  8. #8
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    SQL> @LESSON.LST -- will treat file content as SQL statements

    If you can, please post content of LESSON.LST ( or at least top 15 lines or so).
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  9. #9
    Join Date
    Jul 2012
    Posts
    11
    LESSON.LST at the sql command line is not working. Please I am a beginner,green horn and novice. I am in the learning process.
    SQL> what next will I type to have saved file in sql?

  10. #10
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Why are you using text files for a database when you have access to an oracle database. It makes zero sense.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  11. #11
    Join Date
    Jul 2012
    Posts
    11
    Reply from SQL>@LESSON.LST is
    SP2- 0310:unable to open file "lesson.lst"

  12. #12
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
    bcm@bcm-laptop:~$ sqlplus user1/user1
    
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Jul 10 10:00:49 2012
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    10:00:50 SQL> spool lesson.txt
    10:00:59 SQL> select count(*) from emp;
    
      COUNT(*)
    ----------
    	 2
    
    10:01:11 SQL> spool off
    10:01:17 SQL> !cat lesson.txt
    10:00:59 SQL> select count(*) from emp;
    
      COUNT(*)                                                                      
    ----------                                                                      
             2                                                                      
    
    10:01:11 SQL> spool off
    
    10:01:26 SQL>
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  13. #13
    Join Date
    Jul 2012
    Posts
    11
    Hello Bill,

    I created the table in oracle database, sql command line, spool the file/work as lesson. Now I am in sql command line, how do I command the saved work to open in sql command line so I can do some updates in the saved work.

  14. #14
    Join Date
    Jul 2012
    Posts
    11
    SQL> spool off
    not spooling currently
    SQL> !cat lesson.txt
    SP2-0734: unknown command beginning "!cat lesso..." - rest of line ignored.
    SQL> select count(*) from emp;
    select count(*) from emp
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist

  15. #15
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    SQL> !DIR

    COPY results from above then PASTE all back here
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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