Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews DB Oracle Interviews:Concepts and ArchitectureData AccessDatabase ArchitectureDatabase ManagementDatabase Security OracleDistributed ProcessingFlexfieldForms ReportsGeneral OracleMemory ManagementMTO-SAP Financial AccountingOCIOracle AOLOracle AROracle Backup RecoveryOracle D2KOracle DatabaseOracle Database DeveloperOracle DB OptimizationOracle DBAOracle DeveloperOracle ETLOracle Forms 3.0Oracle Forms 4.0Oracle GLOracle PL-SQLOracle RMANOracle ScenariosOracle SecurityOracle SQLOracle System ArchitectureOracle Technology Network (OTN)Programmatic ConstructsRAC (Real Application Clusters)SQL Plus
Copyright © 2018. All Rights Reserved
Oracle Database Interview Question:
How To Define Default Values for Formal Parameters?
Submitted by: AdministratorIf you have an IN parameter, you can make it as an optional parameter for the calling statement by defining the formal parameter with the DEFAULT clause. This gives you the freedom of not providing the actual parameter when calling this procedure or function. See the following tutorial script shows you an example procedure with an optional parameter:
SQL> CREATE OR REPLACE PROCEDURE WELCOME AS
2 PROCEDURE GREETING(S IN CHAR DEFAULT 'globalguideline') AS
3 BEGIN
4 DBMS_OUTPUT.PUT_LINE('Welcome to ' || S);
5 END;
6 BEGIN
7 GREETING('MySpace.com');
8 GREETING;
9 END;
10 /
Procedure created.
SQL> EXECUTE WELCOME;
Welcome to MySpace.com
Welcome to globalguideline
Submitted by: Administrator
SQL> CREATE OR REPLACE PROCEDURE WELCOME AS
2 PROCEDURE GREETING(S IN CHAR DEFAULT 'globalguideline') AS
3 BEGIN
4 DBMS_OUTPUT.PUT_LINE('Welcome to ' || S);
5 END;
6 BEGIN
7 GREETING('MySpace.com');
8 GREETING;
9 END;
10 /
Procedure created.
SQL> EXECUTE WELCOME;
Welcome to MySpace.com
Welcome to globalguideline
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.