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 Use "IN" Parameter Properly?
Submitted by: AdministratorHere are the rules about IN parameters:
► A formal IN parameter acts like constant. It can not be assigned with new values.
► An actual IN parameter can take a value or a variable.
► An actual IN parameter is passed by reference to the specified value or the value of the specified variable.
► An actual IN parameter will not receive any value from the formal parameter.
Here is good example of a procedure with an IN parameter:
SQL> CREATE OR REPLACE PROCEDURE WELCOME AS
2 SITE CHAR(80) := 'globalguideline.com';
3 PROCEDURE WELCOME_PRINT(S IN CHAR) AS
4 BEGIN
5 DBMS_OUTPUT.PUT_LINE('Welcome to ' || S);
6 -- S := 'Google.com'; -- Not allowed
7 END;
8 BEGIN
9 WELCOME_PRINT('MySpace.com');
10 WELCOME_PRINT(SITE);
11 END;
12 /
SQL> EXECUTE WELCOME;
Welcome to MySpace.com
Welcome to globalguideline.com
Submitted by: Administrator
► A formal IN parameter acts like constant. It can not be assigned with new values.
► An actual IN parameter can take a value or a variable.
► An actual IN parameter is passed by reference to the specified value or the value of the specified variable.
► An actual IN parameter will not receive any value from the formal parameter.
Here is good example of a procedure with an IN parameter:
SQL> CREATE OR REPLACE PROCEDURE WELCOME AS
2 SITE CHAR(80) := 'globalguideline.com';
3 PROCEDURE WELCOME_PRINT(S IN CHAR) AS
4 BEGIN
5 DBMS_OUTPUT.PUT_LINE('Welcome to ' || S);
6 -- S := 'Google.com'; -- Not allowed
7 END;
8 BEGIN
9 WELCOME_PRINT('MySpace.com');
10 WELCOME_PRINT(SITE);
11 END;
12 /
SQL> EXECUTE WELCOME;
Welcome to MySpace.com
Welcome to globalguideline.com
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.