Trigger: –

Trigger: - A trigger is the code, which is executed for certain database events like DML operation on table. The user can write trigger on a table or a view trigger are used for implementing complex validation, complex security, auditing and replication of data. Before triggers are used for validation and security while after trigger... Continue Reading →


An example of function subroutine?

  1   declare   2       a number(2);   3       b number(2);   4       c number(2);   5       function large(x in number,y in number)   6               return number is z number;   7       begin   8       if x>y then   9               Z:=x;  10       else  11               z:=y;  12       end if;  13       return z;  14       end;  15    begin... Continue Reading →

An example of procedure subroutine?

  1  declare   2     a number;   3     b number;   4     c number;   5     procedure sum(x IN number,y IN number,z OUT number) is   6     begin   7             z:=x+y;   8     end;   9  begin  10     a:=5;  11     b:=10;  12     sum(a,b,c);  13     dbms_output.put_line('Sum : '||to_char(c));  14* end; SQL> / Sum : 15... Continue Reading →

Subroutine programs: –

Subroutine programs: - Subroutine programs are used to provide modularity and encapsulation in application. Through sub programs, we can have built application using small building blocks. These building blocks are easy to construct and easy to maintain. We can break a large program into manageable small module, which can easily we constructed. It is called... Continue Reading →

An example of cursor?

SQL> declare   2       cursor c1 is   3       select * from batch;   4       z c1 %rowtype;   5    begin   6       open c1;   7       fetch c1 into z;   8       while (c1 %notfound) loop   9               dbms_output.put_line('Batch Code is : '||z.batchcode);  10               fetch c1 into z;  11       end loop;  12       close c1;... Continue Reading →

Scalar data type: –

Scalar data type: - A scalar data type holds a single value and has no internal components. Scalar data types can be classified into four different categories such as number, character, data and Boolean. Character and number data type have sub types that associates a base type to a constraint. For example, integer and positive... Continue Reading →

Write a program in PL/SQL to input a number calculate and print factorial of input number?

SQL> accept a prompt 'Enter A Number : ' Enter A Number : 5 SQL> declare   2     b integer;   3     c integer;   4     d integer;   5  begin   6     b:=&a;   7     c:=1;   8  for d in 1..b loop   9     c:=c*d;  10  end loop;  11  dbms_output.put_line('Factorial = '||c);  12 ... Continue Reading →

Create a website or blog at

Up ↑

%d bloggers like this: