Posts

Showing posts from 2017

ORACLE JOINS

JOINS:             Join is combine columns from two or more tables into a single result set. Joins are two type 1) sql joins                               2)ANSI Joins ANSI joins:                it introduced complete join syntax in the from clause. joins are                 equi joins               nonequi joins               self join               cross join               inner join               outer join Equi joins:     To join the two or more tables using equality condition. example of equi join sql)  select a.id,a.name         from ...

CURSOR PARAMETERS

CURSOR WITH  PARAMETERS: A cursor can be declare with parameters. Note: cursor parameters can be assigned default values. the scope of the cursor  parameters is local to the cursor the mode of the  parameters can only be IN. Example: Declare   Cursor c1 (p_deptno  emp.deptno%type) is   select ename,sal,deptno   from emp   where deptno=p_deptno; begin     for i in c1 (10) loop     dbms_output.put_line(i.ename||' '||i.sal||'  '||i.deptno);     end loop;         for i in c1(20) loop         dbms_output.put_line(i.ename||' '||i.sal||'  '||i.deptno);         end loop;     dbms_output.put_line('hai'); end; /