A function call calls a specified function.
function-call::=[authorization-identifier.] routine-identifier
([argument [, argument]...])
argument::=value-expression [AS data-type]
For the default values for an authorization identifier, see 1.1.9 Schema path.
Table 2-77 Priorities of predefined data types
Data type of argument | Priority order |
---|---|
Numeric data | SMALLINT![]() ![]() ![]() ![]() |
Character data | CHAR![]() |
National character data | NCHAR![]() |
Mixed character data | MCHAR![]() |
Large-object data and binary data | BINARY ![]() |
Table 2-78 Priorities of abstract data types
Data type of argument | Priority order |
---|---|
Abstract data type | Same data type ![]() |
Determine the function to be called when an abstract data type is included
Let A, B, and C denote abstract data types, where C is the super type of B and B is the super type of A (priority of abstract data types: A B
C).
CREATE TABLE T1(C1 C)
f(A), f(B), f(C)
SELECT f(C1) FROM T1
f(C)
f(A),f(B),f(C)
Actual value of T1.C1 | Function to be called |
---|---|
Type A | f(A) |
Type B | f(B) |
Type C | f(C) |
NULL value | f(C) |
CREATE TABLE T1(C1 C,C2 B)
f(A,A), f(A,B), f(A,C), f(B,A), f(B,C), f(C,A), f(C,B), f(C,C)
SELECT f(C1,C2) FROM T1
f(C,B)
f(A,A),f(A,B),f(A,C),f(B,A),f(B,C),f(C,A),f(C,B)
Actual value of T1.C1 | Actual value of T1.C2 | Function to be called |
---|---|---|
Type A | Type A | f(A,A) |
Type B | f(A,B) | |
NULL value | f(A,B) | |
Type B | Type A | f(B,A) |
Type B | f(B,C) | |
NULL value | f(B,C) | |
Type C | Type A | f(C,A) |
Type B | f(C,B) | |
NULL value | f(C,B) | |
NULL value | Type A | f(C,A) |
Type B | f(C,B) | |
NULL value | f(C,B) |