Thursday, September 15, 2011

VARIABLE DECLERATIONS AND CONSTANT DECLERATIONS

VARIABLE DECLERATIONS

Variables can be declared in declarative section of the block;
Ex:
DECLARE
      a number;
      b number := 5;
      c number default 6;
CONSTANT DECLERATIONS

To declare a constant, you include the CONSTANT keyword, and you must supply a default value.
Ex:
DECLARE
      b constant number := 5;
      c constant number default 6;

NOT NULL CLAUSE

You can also specify that the variable must be not null.
Ex:
DECLARE
      b constant number not null:= 5;
      c number not null default 6;

No comments:

Post a Comment

Oracle Escape Characters

Oracle allows the assignment of special escape characters to tell Oracle that the character is interpreted literally.  Certain characters ...