9 December 2014

Operators in pl sql

Hi friends,today will discuss Operators in plsql.So first thing what is Operators.

Definition of Operator :

in computer programming, an operator is a character that represents an action, as for example x is an arithmetic operator that represents multiplication.* is an arithmetic operation in plsql.


There is number of operator in pl sql like Logical Operator,Assignment Operator etc.There is a List of all Operators in pl sql:-

ØLogical Operators  :  AND  OR  NOT

ØArithmetic Operators  :  +     -    *    /

ØAssignment Operator  :  :=

ØConcatenation Operators  :  ||

ØComparision operators  :  =  !=  <  >  <=  >=

ØSQL * Plus  :  IS  NULL  LIKE  BETWEEN  IN
Concatenation Operator is used to Concatenate String with variable like '+' in java.we will see in Example.

Comments in pl sql:-

Comments are used to aids understanding.

ØSingle Line Comment :

Ø(--)

Ø-- Single Line Comment

ØMultiple Line Comment :

Ø(/*…….*/)

/*
  Multiple

  Line

  Comment 

*/





Nested Block and Variable Scope


A variable declared in outer block can accessible by inner block but inner block variable can access by only inner block ex:- 
         DECLARE
  A VARCHAR2(30) := 'Hello Guys' ;
 
  -- OUTER BLOCK

  BEGIN

  DBMS
_
OUTPUT.PUT_LINE('The Value of Outer String is : ' || A);
 
  -- INNER BLOCK

  DECLARE

  A INTEGER := 2000 ;

  BEGIN

  DBMS_OUTPUT.PUT_LINE('The Value of Inner String is : ' || A);

  END;

  DBMS_OUTPUT.PUT_LINE('The Value of Outer String is : ' || A);

  END;

/

What is Varchar2 and all Read  basic pl sql : Introduction of pl sql

I will come back with basic pl sql programs.Then most doubt will be clear.
















No comments:

Post a Comment

Ads Inside Post

Contributors