Sunteți pe pagina 1din 2

show user;

{
USER is "SYSTEM"
}
create user vrg identified by vrg;
{
User created.
}
grant connect,resource to vrg;
{
Grant succeeded.
}
to connect to the database as user
write
connect

select * from tab;


{
no rows selected
}
set line 100
list (to chk the buffer or last sql command)
l(to chk most resent sql command)
set pagesize 100
show pagesize
ed (open the last sql command in notepad)
define _editor=write.exe
save filename.sql (to copy last buffer command in notepad)
@c:\virag\vrg.sql (to save the file on some location)
spool vrg.lst
to off the feebback after the sql command
set feedback on
set feedback off
to off the header of the table
set head off
set head on
set
(to
set
(to

verify on
chk Or print the old and new velues)
verify off
not print the old and new velues)

select * from emp where deptno=&deptno;


(its ask to user to enter the veriable twice)
select * from emp where deptno=&&deptno;

(its not ask to user to enter the veriable twice)


select 'Mr/Ms ' || ename from emp;
(to concetinate the value use above "||")
select 'Mr/Ms ' || ename || ' earn salary '|| sal from emp ;
(to concetinate the value use above "||")
select 'Mr/Ms ' || ename || ' earn salary '|| sal "emp_report" from emp ;
(ASCII coted identifer OR print the alise name)
select 'Mr/Ms ' || ename || ' earn salary '|| sal " Employee Report"from emp ;
(ASCII coted identifer OR print the alise name as you want)
-----------------DDL
-----------------create, alter, drop, rename, truncate
-----------------DML
-----------------Insert, update, delete, murge, select
-----------------DCL
-----------------1) transaction control statement
commit, rollback, savepoint
2) access control statement
Grant, revoke

S-ar putea să vă placă și