How Parameters are Passed To and From Components

Previous Next

How parameters are passed to and from components depends on the sequence number and kind of parameter, and on the SQL syntax that the INVOKE clause is used in. The following example illustrates this:

UPDATE  MyTab1

SET     (col1, col2) =

(

    INVOKE    MyComponent.MyMethod WITH

    SELECT    colX, colY, colZ

    FROM      MyTab2

)

 

The following table shows the parameters defined for "MyMethod" and how they are used:

Par Seqno

Par Name

Par Kind

 

1

par1

In

Will be passed colX

2

par2

Out

Will go to col1

3

par3

Return

Will go to col2

4

par4

In

Will be passed colY

5

par5

In

Will be passed colZ

This example shows that the Return parameter is handled as if it were an Out parameter.

NOTE: This example shows the rules underpinning parameter use. It is usually a good idea to define In parameters before Out parameters, and Out parameters before the Return parameter.