What does the =>
symbol mean in PL/SQL? e.g.
GetAttrNumber(toitemtype => toitemtype,
toitemkey => toitemkey,
toactid => toactid)
That is the keyword/value notation for passing parameters to a PL/SQL procedure or function. The left side is the name of the parameter, the right is the value being passed. It's useful when you don't want to keep to a specific ordering of parameters, or for self-documenting code.
In Oracle, you can use the >= operator to test for an expression greater than or equal to. SELECT * FROM suppliers WHERE supplier_id >= 1000; In this example, the SELECT statement would return all rows from the suppliers table where the supplier_id is greater than or equal to 1000.
An expression is a combination of one or more values, operators, and SQL functions that evaluate to a value. An expression generally assumes the data type of its components. Expressions have several forms. The sections that follow show the syntax for each form of expression.
That is the keyword/value notation for passing parameters to a PL/SQL procedure or function.
The left side is the name of the parameter, the right is the value being passed.
It's useful when you don't want to keep to a specific ordering of parameters, or for self-documenting code.
The keyword/value notation can be very useful if you have a long list of parameters and only need to specify subset of them. Especially if you want to skip some of the parameters in the middle of the list of parameters (this requires the skipped parameters to use DEFAULT values). As an example if you have a procedure like this:
PROCEDURE my_proc(
p_param1 NUMBER DEFAULT 1
, p_param2 NUMBER DEFAULT 2
, p_param3 NUMBER DEFAULT 3
, p_param4 NUMBER DEFAULT 4
, p_param5 NUMBER DEFAULT 5
);
Now you can call my_proc() only with only first and last parameter,
my_proc(p_param1 => value1, p_param5 => value2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With