Re: Pl Help: How to save QUERRY W/ohter formating commands

From: Unknown User <unknown_at_unknown.com>
Date: Sun, 22 Jul 2001 21:35:06 -0700
Message-ID: <r89nltc66a00v8jvbthejerqvi1rse5oh1_at_4ax.com>


Hmmm,

This tutorial is for editing a *.sql script and running it from inside the SQLPLUSW.EXE.

  1. Launch the SQLPLUSW.EXE and login.
  2. Edit your *.SQL script with Windows Notepad.

SQL> edit report.sql

3. This opens the Notepad and you can type the SQL script to run. Sample is shown below.

     Save and exit.

COLUMN employee_name HEADING 'Employee Name' COLUMN project_name HEADING 'Project Name' select * from scott.emp
/
select * from scott.dept
/

4. If you right click on the SQLPLUSW.EXE shortcut and click on PROPERTIES, you will see a field labeled "START IN:".

    This is the directory where your REPORT.SQL file was saved.

5. To execute your REPORT.SQL script, type the following.

SQL> _at_report

Hope this helps.

On 22 Jul 2001 18:51:41 -0700, mschalla_at_aol.com (ZAN) wrote:

>Thank you for your reply!!!
>But I am little confused:
>Should I type evrything including the script in the notepad and then
>use the START command. Please can you tell me how to save . If I am
>goignto save in the C drive and adn have a file name report. How
>should my save commad look when I it is typed in the notepad.
>Hope to hear from you soon
>
>Unknown User <unknown_at_unknown.com> wrote in message news:<cc1mltc272m5ii1s993agtfaqq5c52937f_at_4ax.com>...
>> Hi,
>>
>> Here is a sample script. Save it with the *.sql extension and place it in the "working directory"
>> of your shortcut. You can do this by right-clicking on properties and entering the full directory
>> path in the "Start in:" field.
>>
>>
>> COLUMN employee_name HEADING 'Employee Name'
>> COLUMN project_name HEADING 'Project Name'
>> select * from scott.emp
>> /
>> select * from scott.dept
>> /
>>
>> Hope it helps.
>>
>>
>> On 21 Jul 2001 20:55:04 -0700, mschalla_at_aol.com (ZAN) wrote:
>>
>> >> I am new to Oracle and I have Oracle 8i Personal edition on my PC. I have
>> >> windows 98.I have OREILLY BOOK ORACLE SQL PLUS (DEFINITIVE GUIDE) by
>> >> Jonathan Gennick and I am in chapter 3 where I am having problems saving the
>> >> colums and with other formating commands with the querry for later use. I can
>> >> only save it temporary in the buffer when I am using Note pad. But once I
>> >> exit the database it is gone and I have to type the COLUMN and other commands
>> >> again. When I type the GET command to retrive I can only get the querry not
>> >> the ohter commands that I had typed like the colums etc... Pages 73.(Format
>> >> the Colums and other commands) Your help will be greatly appreciated.
>> >>
>> >> I am having the following problem. Whenever I make changes like add new
>> >> columns or edit colums I have to type it again and again. I cannot save it. I
>> >> can only save the Querry By using the Save command
>> >> SAVE C:\Report REPLACE
>> >> How should I save the colums and page size etc with the querry for future
>> >> use. If I save it in the buffer it is only temporary but if I want to make
>> >> chages after aday or two I have to retype the columns and other formating
>> >> commands again and again. How to save it for future?
>> >>
>> >> Please explain by using the following example. Say the file name is Report
>> >>
>> >> COLUMN employee_name HEADING 'Employee Name'
>> >> COLUMN project_name HEADING 'Project Name
>> >> COlumn SUM(PH.Hours_LOGGED) HEADING 'Hours'
>> >> COLUMN SUM(PH>DOLLARS_CHARGED)HEADING 'Dollars/Charged
>> >> SELECT E.EMPLOYEE_NAME,
>> >> P.PROJECT_NAME,
>> >> SUM(PH.HOURS_LOGGED)hours_logged,
>> >> SUM(PH.DOLLARS_CHARGED)dollars_charged
>> >> FROM EMPLOYEE E,
>> >> PROJECT P,
>> >> PROJECT_HOURS PH
>> >> WHERE E.EMPLOYEE_ID = PH.EMPLOYEE_ID
>> >> AND P.PROJECT_ID = PH.PROJECT_ID
>> >> GROUP BY E.EMPLOYEE_ID, E.EMPLOYEE_NAME,
>> >> P.PROJECT_ID, P.PROJECT_NAME
>> >>
>> >>
>> >> Thank you for your time
>> >> Please e-mail me your answer to
>> >> E-mail : mschalla_at_aol.com
>> >>
>> >>
>> >>
>> >>
Received on Mon Jul 23 2001 - 06:35:06 CEST

Original text of this message