How To Initialize Variables with Default Values?
Submitted by: AdministratorThere are two ways to assign default values to variables at the time of declaration:
► Using key word DEFAULT - Appending "DEFAULT value" to the end of declaration statements.
► Using assignment operator - Appending ":= value" to the end of declaration statements.
The script below show you some examples of declaration statements with default values:
PROCEDURE proc_var_1 AS
domain VARCHAR2(80) := 'globalguideline.com';
price REAL DEFAULT 999999.99;
is_for_sale CHAR := 'N';
BEGIN
-- Executable statements
END;
Submitted by: Administrator
► Using key word DEFAULT - Appending "DEFAULT value" to the end of declaration statements.
► Using assignment operator - Appending ":= value" to the end of declaration statements.
The script below show you some examples of declaration statements with default values:
PROCEDURE proc_var_1 AS
domain VARCHAR2(80) := 'globalguideline.com';
price REAL DEFAULT 999999.99;
is_for_sale CHAR := 'N';
BEGIN
-- Executable statements
END;
Submitted by: Administrator
Read Online Oracle Database Job Interview Questions And Answers
Top Oracle Database Questions
☺ | How To Call a Stored Function in Oracle? |
☺ | How Run SQL*Plus Commands That Are Stored in a Local File? |
☺ | What Is Input Buffer in SQL*Plus? |
☺ | What Happens to Indexes If You Drop a Table? |
☺ | How To Use Values from Other Tables in UPDATE Statements using Oracle? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Forms Reports Interview Questions. |