You are on page 1of 13

DEPARTMENT OF TECHNICAL

EDUCATION ANDHRA PRADESH


Name : M.Bhagya Lakshmi,
Designation : Lecturer in CCP,
Institution : GMR Polytechnic, Gajwel
Branch : DCCP
Semester : V Semester
Major Topic : SQL Plus
Sub –Topic : SQL EDITOR
Subject name : RDBMS
Subject Code : CCP- 505
Duration : 50 min.
Teaching Aids : PPT
CCP505.42 1
Objectives

On the Completion of this period you would


be able to understand
 How to use the editor for creating command files

CCP505.42 2
Recap

We have learnt about


 Invoking SQL
 SQL*PLUS

CCP505.42 3
Two methods to construct SQL
Statements

 SQL editor
 Any other editor

CCP505.42 4
Method 1

 Use the SQL editor, Which is automatically


invoked

CCP505.42 5
Example:

 At the SQL> prompt, execute any valid SQL


statement.
Select * from emp;
 To save sql statement in a file, type in save f1
where f1 is the filename. This command creates
a file by the name f1.sql in the current directory

CCP505.42 6
Example (cont..)
 Later at any point of time, get f1 gets the file in
the buffer and returns back to the SQL prompt
 Then at the SQL>prompt, type / using SQL’s
editor, which executes the SQL statement which
is stored in the buffer
 The file f1.sql can be edited using the standard
editor commands

CCP505.42 7
Method 2

 Any editor can be invoked from SQL> prompt


by using the command
Define_editor=notepad.exe

CCP505.42 8
Example

 Use the command ed f1 at the sql prompt. This


opens a new file in notepad.
 Type the SQL statement and terminate SQL
statement with a '/ ' in the first column of the next
line

CCP505.42 9
Example (cont..)

 To run the file, after saving it in notepad as


f1.sql at the SQL prompt type
Start f1 or sta f1 or @f1or
Click on Run from the file menu
 If we type 'ed' and enter the current SQL
statement will be opened in an editor with the
file name afiedbuf

CCP505.42 10
Summary

We have discussed about


 SQL
 Editors

CCP505.42 11
Quiz
1. How many methods can be used to construct
SQL sentences
a) One
b) Two
c) Three
d) Four

CCP505.42 12
Frequently Asked Questions

1. How many Methods can be used to construct


SQL sentences and Explain each

CCP505.42 13

You might also like