Home >> FAQs/Tutorials >> Oracle Tutorials

Oracle Tutorials - Use "IN" Parameters

By: FYIcenter.com

(Continued from previous topic...)

How To Use "IN" Parameter Properly?

Here 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) := 'FYICenter.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 FYICenter.com

(Continued on next topic...)

  1. What Is a Procedure?
  2. What Is a Function?
  3. How To Define an Anonymous Procedure without Variables?
  4. How To Define an Anonymous Procedure with Variables?
  5. How To Create a Stored Procedure?
  6. How To Execute a Stored Procedure?
  7. How To Drop a Stored Procedure?
  8. How To Pass Parameters to Procedures?
  9. How To Create a Stored Function?
  10. How To Call a Stored Function?
  11. How To Drop a Stored Function?
  12. How To Call a Stored Function with Parameters?
  13. How To Define a Sub Procedure?
  14. How To Call a Sub Procedure?
  15. How To Define a Sub Function?
  16. Can Sub Procedure/Function Be Called Recursively?
  17. What Happens If Recursive Calls Get Out of Control?
  18. What Is the Order of Defining Local Variables and Sub Procedures/Functions?
  19. What Is the Difference between Formal Parameters and Actual Parameters?
  20. What Are the Parameter Modes Supported by PL/SQL?
  21. How To Use "IN" Parameter Properly?
  22. How To Use "OUT" Parameter Properly?
  23. How To Use "IN OUT" Parameter Properly?
  24. How To Define Default Values for Formal Parameters?
  25. What Are Named Parameters?
  26. What Is the Scope of a Local Variable?

Oracle Tutorials:

More...


Other Tutorials/FAQs:

More...


Related Resources:

More...


Selected Jobs:

More...