Professional Documents
Culture Documents
Unix Commands PK
Unix Commands PK
UNIX COMMANDS
9. $ who : displays the all user in who are currently working on server
10. $finger : displays the all user who are currently working on server with
more information
My Commands:
Du sk test.txt
Du sk test.txt test2.txt
E:\files in ds>du -h
327.00KB .
How to find all the files in all the directories in that folder?
Suppose Files in Ds is the folder which has so many files and also 2 Folders In
Bound and Out Bound. We want the files present in In Bound and also Out bound,
In that case what needs to be used?
Ls R
13. Cat : is use to create new files or to open exiting files or to append
data to the exiting files
-----------
-----------cntl+d
Append: cat >>filename-------- single file $cat file1 file2 file3 >>EMP------multi
files
-----------
-----------cntl+d
Open file: cat <filename-----open single file $cat file1, file2, file3----------to open
multi files
4
EX
Ex: Rm r Testing_Unix.
$pwd------/home/madhav/abc using above cmd we can come out from abc now we
at //home/madhav
cd../..------------------------parent directory
Ex
Cp I m1 m2-------------------------overwrite confirmation? Y
22. ls a : display, list of all files & directories including hidden files and
dirctories also in current directory
23. ls r : display list of all files & directories revers order in a current directory
24. Ls R : display list of all files & directories recursively in a current directory
25. Ls t : display list of all files & directories according to date of creation in a
current directory
26. Ls F : display all list of files & directories, link files, .exe files in a current
directory
27. Ls-x : display all list of files & directories according to width wise in a
current directory
28. Ls-L : display all list of files & directories in a current directory in a long list
i.e. 9 fields
1) File types
[1) -- For regular file ii) dfor dir file III) Lfor link file IV) bfor
block of filesV) c for char files] [here IV, V is device files]
6
2) File permissions 3) no. of links 4) owner name 5) group name 6) file size in bytes
7) Date 8) time 9) filename
If two files are are different then it displays line number with character position
34. head :it display the 1st n lines from the file
Ex: tail +30 file (in this file total no of records is 100) it displays the records from 30 th to
100
iv) wc -lw filename-------------- it gives the no of lines and character in a given file
5th line
7th line
a1:------
a2:------
a3:------
iii) $ grep techno *------it searches for techno in current dir files (all files)
iv) $grep techno soft sample-----it searches for more than one word
We kept it in
Regular expression: any string contains wildcard charctor knows as regular expression or
pattern
Grep ^/<the/> simple ----------sample the line exactly start with the
Grep ^ [^bkt] sample----------list the line which is not start with b or k ort
Grep ^UNIX$ sample ---------display the line having only word Unix
This command is used to show the After 3 lines when the string is found
This command is used to show the Before 3 lines when the string is found
Grep B 3 I se emp.txt
If the no.of lines found are not exactly same as the lines found then it will result the
lines that it found.
39. fgrep : it is used for search multiple strings but it doesnt allow to search regular
expression
$grep hello
>techno
$egrep hello
>hello
$ sed s/existing string/new string/g filename--sed is used to find and replace and grep
is for find print
Here g is to state that replace existing string with new string Globally. If we want to replace
only second instance then
iii) $sed s/^$/I like Unix/g I sample--------empty string are filled with I like UNIX
iv) $Sed s/Unix//g I sample-----------------it search UNIX if found replace with nothing
(empty)
43) Cut : it is used for to retrieve required fields and characters from a given file
Cut c 1,2,3 emp.txt Prints 1,2 and 3rd char of each line
Cut c10- emp.txt Print the lines from 10th to end position by using cut
command
Cut d, f2 emp.txt This will print the 2nd word of each line by taking , as
delimiter.
Cut d, f2,3, emp.txt This will print the 2nd and 3rd words of each line by
taking comma as delimiter.
44) Paste : is used for to join two or more files horizontally by using delimiter
Kerala Trivandrum
Maharashtra Bombay
45) Sort : it is used for to sort the file content. By default it sorts file contents based
on ASCII values-default is ascending
Sort sample
+pos--starting field
46) Uniq : it displays unique lines in the given file but the file contents should be in
sort order
Hhhhh pppppp
Hhhhh ttttttttt
Ppppp
Ttttttt
iii) $ Uniq d filename----displays only duplicated lines IV) uniq c filename-----it counts
how many times lines duplicated
Aaaaaa-----2
Cccccccc----1
$ mv temp filename
Hhhhhh---2
Ppppp-----1
14
Ttttttt-----1
47)piping(|) : it is used for to combine 2 or more cmds |take left side o/p to right
side cmd as i/p
iii) ls l |grep ^d----displays total no of subdirectories who stats with line nod
iV) $head -30 sample|tail +20 sample------display the the lines from 20 to 30 from
given file
v) $ grep UNIX stud | cut f 2, 3|sort filename -----display UNIX students names & ph
no in ascending order
48) $tee : it is used to for to write data to the file as well as to the screen
ii) Bash shell (borne again shell) ---same as above--advanced version of Bourne is
BASH (Linux default shell)
Mostly used shell is korn shell it supports re usability, all shell designed on bourn shell
File permissions:(xxx/xxx/xxx)
+--- (add permissions to u/g/o but it does not delete exiting permission)
i) ls l filename-------rw- rw- r
Octal code
Read------4
Write-----2
Execute1
58) $write : it is user for to with the users but the user shxould be logged into the
server
Cmtl+d
59) awk/nawk file : scan for patterns in a file and process the results
61) chsh (paawd e/-s) userlogin_shell: change the user login shell
62) df : report the summary of disk blocks and nodes free and in use
63)du :it displays the directory wise disk usage in form of blocks each block size is 512
bytes
To Create multiple Zip files to a single Zip file we use below command
The above command will zip all the files to Myzip.zip and we can get all files starting
with emp.
66. compress : it also used for to zip the file---it used to save with .z format
$zcat sample.gz
Or
$zcat sample.z
$ sleep 500
17
Cntl+c
$ sleep 100&
70) ps or $ ps f : it displays current user account running process list (show status of
active process)
74) ftp: file transfer protocol -----transfer files from one server to another
$ ftp ipaddress
Login: -------
Password: ------
Ftp>ls (server)
Ftp>|ls(client)
75)Ftp: to transfer files from one server user account to another server user account
76) Wall : it is used for to sent broadcast message to all users who are
currently working on server
$wall
Happy new-year
Cntl+d
77)mail :it is used for to send the mail, if user is not logged in then also we can send
mail
i) $ mail techno1
18
Cntl+d
1>first mail
&r--replays
&d-delete mails
88) lprm, cancel : remove a print job from the print quee
93) rcp hostname : remotely copy files from this machine to another machine
96) script file : saves everything that appears on the screen to file until exit is
executed
97) source file : read cmds from the file and execute them in the current shell
98) string file : used to search binary files for ASCII strings
100) uudecode file : decode a uuencoded file, recreating the original file
101) uuencode new name : encode the binary file to 7-bit ASCII,usefull when
sending via email, to be Decode as new name at destination
UNIX
This file maintains each and every user information with 7 fields. The 7 fields are Username:
passwd: uid: gid: fullname: home: shell.
What is Shell?
Shell is a command line interpreter. Shell acts as an interface between user and the kernel.
What is Kernel?
Kernel is core part of UNIX o/s. It is a group of hundreds of system calls.
What are different flavors of Unix o/s?
Any operating system designed based on unix kernel called as flavour of unix. The following
are some flavours of unix
Linux ---- Red Hat
Sun solaris --- Sun Microsystem
IBM-AIX ----- IBM
Hp-ux ----- HP
Sco-unix ----- santa crus operations
IRIX------ Silicon Graphics.
1. Password protection.
2. File permissions.
3. Encryption.
rm -f <filename>
ls -r lists the files in reverse alphabetical order... whereas ls -R lists the files and directories
recursively
2.vi <filename>
3. cat>filename
is between a to m or n or between o to r
How do you search for a string in a directory with the subdirectories recursed?
grep -r string *
Difference between grep, egrep and fgrep
egrep : accepts more than one pattern for search. Also accepts patterns from a file.
fgrep : accepts multiple patterns both from command line and file but does not accept
regular expressions only strings. It is faster than the other two and should be used when
using fixed strings.
Grep ^$ <filename>
Grep c ^$ <filename>
How to remove Empty lines form a given file?
Grep v ^$ filename > temfilename
Mv tempfilename filename
What is pattern to search 4 digit word in a file?
Grep \<[0-9] [0-9] [0-9] [0-9]\> filename
What is pattern to search the line having only three characters?
Grep ^$ filename
What is pattern to display lines ending with $ character in a given file?
Grep \$$ filename
24
awk is a powful Unix command. It allows the user to manipulate files that are structured as
columns of data and
Once you understand the basics of awk you will find that it is surprisingly useful. You can
use it to automate things in ways you have never thought about. It can be used for data
processing and for automating the application of Unix commands. It also has many
spreadsheet-type functionalities.
There are two ways to run awk. A simple awk command can be run from the command line.
More complex tasks should be written as awk programs ("scripts") to a file. Examples of
each are provided below.
meaning: take each line of the input file; if the line contains the pattern apply the action to
the line and write the resulting line to the output-file.
Write a one line command to convert all the capital letters of a file "test" into
lower case?
The pipeline to list the five largest files in the current directory is
The pipeline to find out the number of times the character ? occurs in the file is
tr -dc '?' < file | wc -c ( Delete all the characters except ? and then make a word count.)
Who | wc l
echo Tecnosoft | wc c
022
Write allows you to create, edit and delete files and subdirectories in the directory.
Execute gives you the previous read/write permissions plus allows you to change into the
directory and execute programs or shells from the directory.
if there is a process u want to run even after exiting the shell what is the
27
command used?
Nohup
which command will get executed even after you log out?
Nohup
kill 9
What is the command to send message to all users who are logged in?
Wall
Mail username
Mail -f
Ans. mesg n
The other way of running shell script apart from using sh command and chmod?
19. How do you refer to the arguments passed to a shell script? - $1, $2 and so on. $0 is
your script name.
20. Whats the conditional statement in shell scripting? - if {condition} then fi
21. How do you do number comparison in shell scripts? - -eq, -ne, -lt, -le, -gt, -ge
22. How do you test for file properties in shell scripts? - -s filename tells you if the file is
not empty, -f filename tells you whether the argument is a file, and not a
directory, -d filename tests if the argument is a directory, and not a file, -w
filename tests for writeability, -r filename tests for readability, -x filename tests
for executability
23. How do you do Boolean logic operators in shell scripting? - ! tests for logical not, -a
tests for logical and, and -o tests for logical or.
24. How do you find out the number of arguments passed to the shell script? - $#
25. Whats a way to do multilevel if-elses in shell scripting? - if {condition} then
{statement} elif {condition} {statement} fi
26. How do you write a for loop in shell? - for {variable name} in {list} do
{statement} done
27. How do you write a while loop in shell? - while {condition} do {statement} done
28. How does a case statement look in shell scripts? - case {variable} in {possible-
value-1}) {statement};; {possible-value-2}) {statement};; esac
29. How do you read keyboard input in shell scripts? - read {variable-name}
30. How do you define a function in a shell script? - function-name() { #some code
here return }
31. How does getopts command work? - The parameters to your script can be passed as -n
15 -x 20. Inside the script, you can iterate through the getopts array as while getopts n:x
option, and the variable $option contains the value of the entered option.
Batch file:
Batch files allow MS-DOS and Microsoft Windows users to create a lists of commands to run
in sequence once the batch file has been executed. For example, a batch file could be used
to run frequently run commands, deleting a series of files, moving files, etc. A simple batch
file does not require any special programming skills and can be done by users who have a
basic understanding of MS-DOS commands.
29
ORACLE9i FAQs
Ans: The Matter that we feed into the Computer is called Data or Information.
2. WHAT IS DATABASE?
5. WHAT IS ORDBMS?
that can store data, the relationship of the data, and the behavior of the data
Ans: Dr. E.F. Codd presented 12 rules that a database must obey if it
a) The rules stem from a single rule- the zero rule: For a system to Qualify as
RELATIONAL DATABASE MANAGEMENT system, it must use its RELATIONAL facilities
30
the Information Management System (IMS) developed by IBM in 1968. In this data is
organized as a tree structure. Each tree is made of nodes and branches.
The nodes of the tree represent the record types and it is a collection
of data attributes entity at that point. The topmost node in the structure is called the root.
Nodes succeeding lower levels are called children.
b) Network Model: The Network Model, also called as the CODSYL database
structure, is an improvement over the Hierarchical mode, in this model concept of parent
and child is expanded to have multiple parent-child relationships, i.e. any child can be
subordinate to many different parents (or nodes). Data is represented by
Ans: Data Modeling describes relationship between the data objects. The
31
Ans: Entity: An Entity is a thing, which can be easily identified. An entity is any object,
place, person, concept or activity about which an enterprise records data.
Ans: The E-R modeling technique is the Top Down Approach. Entity
relationship is technique for analysis and logical modeling of a systems data requirements.
It is the most widely used and has gained acceptance as the ideal database design. It uses
three basic units: entities, their attributes and the relationship that exists between
made up of many columns. Each of these columns has a data type associated with it.
NON-PROCEDURAL LANGUAGE?
Ans:
Ans:
Create Alter Drop Truncate Rename, Select , Insert Update Delete Merge , Grant Revoke ,
Rollback Commit savepoint
Ans: Truncate Command will delete all the records where as Delete
Command will delete specified or all the records depending only on the condition given.
Ans: Alter command is used to modify the database objects where as the
Ans: Grant and Revoke are the two commands belong to the DCL Category.
Ans: Delete is the efficient command because using this command we can
Ans: Char (size), Nchar (size), Varchar2 (size), Nvarchar2 (size) data
35
Number (precision, scale), Number, Number (n), Float, Float (binary precision) data types
for numerical values, Date data type for date values,
Long, Raw (size), Long Raw, Clob, Blob, Nclob, Bfile for large objects.
Ans:
LOB LONG
sequential access.
characters and while querying the table varchar2 trims the extra spaces from the column
and fetches the rows that exactly match the criteria.
30. HOW MUCH MEMORY IS ALLOCATED FOR DATE DATATYPE? WHAT IS DEFAULT
Ans:
Datatype Range
precision 2 GB 4GB
following steps.
To Rename a Column:
a) Alter the table specifying new column name to be given and data type.
b) Then copy the values in the column to be renamed into new column.
ii. Alter the table column whose size is to be decreased using the same
Ans: Not Null, Unique, Check, Primary Key and Foreign Key or Referential Integrity.
Ans: Unique and Not Null is a combination of two Constraints that can be present any
number of times in a table and cant be a referential key to any column of an another table
where as Primary Key is single Constraint that can be only once for table and can be a
referential key to a column of another table becoming a referential integrity.
Ans: A Primary key created on combination of columns is called Composite Primary Key.
Ans: It is a part of composite primary key. Maximum 32 candidate key can be there in
composite primary key.
nor a space and any mathematical calculation with NULL is always NULL.
Ans: NULL.
42. WHAT IS CREATED IMPLICITLY FOR EVERY UNIQUE AND PRIMARY KEY
COLUMNS?
Ans: Index.
Ans: References is used as column level key word where as foreign key
Ans: when this key word is included in the definition of a child table
then whenever the records from the parent table is deleted automatically the respective
values in the child table will be deleted.
47. HOW TO DROP A PARENT TABLE WHEN ITS CHILD TABLE EXISTS?
Ans: NO
Ans: Columns that are not created explicitly by the user and can be
Ex:currval,nextval,sysdate,new,old,sqlcode,sqlerrm,rownum,rowid,level
Ans: Count () will count the specified column whereas count (*) will
Ans: A query within a query is called a sub query where the result of
Ans: Any: The Any (or its synonym SOME) operator computes the lowest
value from the set and compares a value to each returned by a sub query.
SUB QUERY?
for each Candidate row by the main query, which on execution uses a value from a column
in the outer query. In normal sub query the result of inner query is dynamically substituted
in the condition of the outer query where as in a correlated subquery, the column
value used in inner query refers to the column value present in the
query results.
EQUI Join
NON-EQUI Join
SELF Join
OUTER Join.
Ans: There shold be atleast one common column between the joining tables.
Ans:If there r any values in one table that do not have corresponding values in the other,in
an equi join that row will not be selected.Such rows can be forcefully selected by using
outer join symbol(+) on either of the sides(left or right) based on the requirement.
OPERATORS?
Ans: UNION will return the values distinctly whereas UNION ALL will
FUNCTIONS.
Round (m, [n]), Trunc (m, [n]), Power (m, n), Sqrt(n),
Character Functions:
Date Functions:
Ans: MAX is an aggregate function which takes only one column name of a table as
parameter whereas Greatest is a general function which can take any number of values and
column names from dual and table respectively.
'if-then-else' test.
Ans: It will return count of the no. Of days between January 1, 4712 BC
Ans: By using time format as 'hh [hh24]: mi: ss' in to_char() function.
FUNCTIONS?
Ans: Simple views can be modified whereas Complex views (created based
Ans: Inline view is basically a subquery with an alias that u can use
like a view inside a SQL statement. It is not a schema object like SQL-object.
Ans: "WITH CHECK OPTION" clause specifies that inserts and updates r performed through
the view r not allowed to create rows which the view cannot select and therefore allows
integrity constraints and data validation checks to be enforced on data being inserted or
updated.
Ans: Sequence is a Database Object used to generate unique integers to use as primary
keys. Nextval, Currval are the Pseudo Columns associated with the sequence.
45
method of storing tables that are intimately related and are often joined together into the
same area on the disk.
When cluster table exists then to drop cluster we have to drop the table first then only
cluster is to be dropped.
Ans: Materialized views can be used to replicate data. Earlier the data
was replicated through CREATE SNAPSHOT command. Now CREATE MATERIALIZED VIEW
can be used as synonym for CREATE SNAPSHOT. Query performance is improved using the
materialized view as these views pre calculate expensive joins and aggregate operations on
the table.
Ans: A Synonym is a database object that allows you to create alternate names for Oracle
tables and views. It is an alias for a table, view, snapshot, sequence, procedure, function or
package.
Ans: Only the user or table owner can reference Private synonym whereas
Ans: SQL commands are stored in the buffer whereas SQL*PLUS are not.
Ans: SPOOL file-name, SPOOL OFF, TTITLE, BTITLE, BREAK ON, COMPUTE <any
aggregate function> OF <column name> [break] ON <column name> etc are SQL*PLUS
REPORTING COMMANDS.
Ans: With Grant Option with Grant Command gives privileges to the
objects. A schema is owned by the database user and has the same name as that of user.
Each user owns a single schema. Schema objects include following
47
Ans: Startup and Shutdown Oracle database can be done by only the
100. HOW TO CHANGE LINE SIZE, PAGE SIZE AND SQL PROMPT?
Ans: DECLARE
<declarations>
BEGIN
<Exececutable Statements>
EXCEPTION
<Exception Handler(s)>
END;
Ans: DECLARE BLOCK: In this block all the declarations of the variable
used in the program is made. If no variables are used this block will become optional.
Ans: The PL/SQL engine accepts any valid PL/SQL block as input, executes the procedural
part of the statements and sends the SQL statements to the SQL statement executor in the
Oracle server.
Ans: NULL
Ans: There are two types of cursors namely Implicit Cursor, Explicit Cursor.
50
Ans: Cursor For Loop is shortcut process for Explicit Cursors because
the Cursor is Open, Rows are fetched once for each iteration and the cursor is closed
automatically when all the rows have been processed.
Ans: %Found
%NotFound
%IsOpen
Ans: Whenever an error occurs Exception raises. Error is a bug whereas the Exception is a
warning or error condition.
DECLARE
---------;
51
- - - - - - - - -;
BEGIN
- - - - - - - - -;
- - - - - - - - -;
EXCEPTION
- - - - - - - - -;
- - - - - - - - -;
END;
This will handle all the errors not already handled in the block.
handler is written.
PARAMATERS.
Ans: Function has return key word and returns a value whereas a
PROCEDURE?
Ans: A parameter, which gets value into the Procedure or Function and
Ans: NO.
Procedures.
53
NAME?
Ans: YES.
Ans: Constraints are always TRUE whereas Triggers are NOT always TRUE
133. WHAT ARE DIFFERENT EVENTS FOR A TRIGGER AND THEIR SCOPES?
134. WHAT IS DIFFERENCE BETWEEN TABLE LEVEL AND ROW LEVEL TRIGGERS?
Ans: Table level Triggers execute once for each table based transaction
whereas Row level Triggers will execute once FOR EACH ROW.
54
Transactions.
Ans: These Triggers are used with the Complex Views only to make
Ans: 18 Triggers
in the statement attempted to query or modify a table that was in the middle of being
modified by the statement that fired the trigger.
Action : Rewrite the trigger or function so it does not read the table.
Ans: The prefix :old is used to refer to values already present in the
table. The prefix :new is a correlation name that refers to the new value that is inserted /
updated.
Ans: Using CREATE [OR REPLACE] TYPE <type name> AS OBJECT (ATTRIBUTE
Ans: THE operator allows nested tables to be manipulated using DML when
it is stored in a Table.
transaction, which requires manipulation of more than one records from one or more tables.
There are two types Iterators namely Named Iterator and Positional Iterator.
Ans: Oracle8 allows tables and Indexes to be partitioned or broken up into smaller parts
based on range of key values. Partitioning is a divide and conquer strategy that improves
administration and performance in data warehouse and OLTP systems.
Ans: The basic oracle memory structure associated with Oracle includes:
Software Code Areas The System Global Area (SGA) ,The Database Buffer Cache
The shared Pool, The Program Global Areas (PGA), Stack Areas ,Data Areas, Sort Areas
Oracle that contains data and control information for one Oracle database instance. IF the
multiple users are concurrently connected to the same instance, the data in the instances
SGA is shared among the users.
Consequently, the SGA is often referred to as either the system Global Area or the
Shared
Global Area.
Ans: The Program Global Area is a memory buffer that contains data and
control information for a server process. A PGA is created by Oracle when a server process
is started. The information in a PGA depends on the configuration of Oracle.
58
background processes are started. The combination of these processes and memory buffers
is called an Oracle instance.
system that can be execute a series of steps. Some operating systems use terms jobs or
task. A process normally has its own private memory area in which it runs. An Oracle
database system has general types of process: User Processes and Oracle Processes.
startup. In a multiple instance system (one that uses the parallel server), SMON of one
instance can also perform instance recovery other instance that have failed whereas The
PMON (Process Monitor) performs process recovery when a user process fails.
Ans: The Data Base Writer writes modified blocks from the database
Ans: The Log Writer writes redo log files to disk. Redo log data is
59
generated in the redo log buffer of the SGA. As transactions commit and log buffer fills,
LGWR writes redo entries into an online redo log file.
Ans: The Recover (RECO) is used to resolve distributed transactions that are pending due to
network or system failure in a distributed database. At timed intervals, the local RECO
attempts to concept to remote database and automatically complete the commit or rollback
of the local portion of any pending distributed transactions.
Ans: The Archiver (ARCH) copies the online redo log files to archival storage when they are
full. ,ARCH is active only when a databases redo log is used ARCHILOG mode.
Ans: VIEW
code of an application program (such as PRO * Program) or an ORACLE tool (such as SQL *
DBA). The User process also manages the communication
configuration, a server Process handles requests for a single user process. A multithread
server configuration allows many user processes to share a small number of server
processes, minimizing the utilization of available system resources.
Ans: Table related to itself .Foreign key of the table links to primary key of the same table.
60
database. Rownum is count of records whereas Rowid is identification of the each row.
9i features:
9i Joins:
3. > select e.empno, e.ename, e.sal, e.job, e.deptno,d.dname, d.loc from emp e Join dept d
61
on(e.deptno = d.deptno) ;
4. > select e.empno, e.ename, e.sal, e.job, e.deptno, d.dname, d.loc from emp e Inner Join
dept d
on(e.deptno = d.deptno) ;
5. > select e.empno, e.ename, e.sal, e.job, e.deptno, d.dname, d.loc from emp e left outer
join dept d
on(e.deptno = d.deptno) ;
6. > select e.empno, e.ename, e.sal, e.job, e.deptno,d.dname, d.loc from emp e right outer
join dept d
on(e.deptno = d.deptno) ;
* 7. > select e.empno, e.ename, e.sal, e.job, e.deptno,d.dname, d.loc from emp e full outer
join dept d
on(e.deptno = d.deptno) ;
** left outer join union right outer join = full outer join
----------------------------------------------------------------------------
* Systimestamp : Gives date and time including fractional seconds in SERVER time zone
* current_timestamp: Gives date and time including fractional seconds in CLIENT time zone
* Extract : Used to retrieve a particular value from the given date ( day /
month / year ).
20-jan-09 6:48:23 pm
20-jan-09 6:52:23 pm
----------------------------------------------------------------------------
*nullif ( expr1,expr2 ) --- If expr1 and expr2 results are same it returns NULL value
otherwise it return expr1 result.
* Nvl2(expr1,expr2,expr3) --- If expr1 is null it manipulates expr3 ,if expr1 is not null it
manipulates expr2.
63
from emp;
---------------------------------------------------------------------------
Mutiple Inserts:
insert all
into D1 values(deptno,dname,loc)
into D2 values(deptno,dname,loc)
into D3 values(deptno,dname,loc)
Conditional Insert:
insert all
into D1 values(deptno,dname,loc)
into D2 values(deptno,dname,loc)
else
insert all
Student stu_oracle
--------- ------------
Roll Roll
name name
course fee
fee
----------------------------------------------------------------------------
Merge :
>merge Clauses:
t.comm = e.comm,
t.deptno = e.deptno,
t.job = e.job,
t.mgr = e.mgr
insert values(e.empno,e.ename,e.sal,e.comm,......);
Before :
After :
----------------------------------------------------------------------------
----------------------------------------------------------------------------
9i Supports :
Supports XML.