Skip to content

Commit

Permalink
Merge pull request #4768 from EnterpriseDB/docs/epas/constructor-fix-…
Browse files Browse the repository at this point in the history
…redo

EPAS: constructor fix
  • Loading branch information
drothery-edb authored Sep 11, 2023
2 parents 0ad4b97 + 4a6479c commit 6d0c26e
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ where `subprogram_spec` is the following:
where `constructor` is the following:

```text
CONSTRUCTOR <func_name>
[ ( [ SELF [ IN | IN OUT ] <name> ]
[, <parm1> [ IN | IN OUT | OUT ] <datatype1>
CONSTRUCTOR FUNCTION <func_name>
[ ( [ <parm1> [ IN | IN OUT | OUT ] <datatype1>
[ DEFAULT <value1> ] ]
[, <parm2> [ IN | IN OUT | OUT ] <datatype2>
[ DEFAULT <value2> ]
] ...)
]
RETURN self AS RESULT
RETURN <return_type>;
```

!!! Note
Expand Down Expand Up @@ -104,22 +103,16 @@ Prior to the definition of a method, `[ NOT ] INSTANTIABLE` specifies whether or

`proc_name` is an identifier of a procedure. If the `SELF` parameter is specified, `name` is the object type name given in the `CREATE TYPE` command. If specified, `parm1, parm2, …` are the formal parameters of the procedure. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters.

Include the `CONSTRUCTOR` keyword and function definition to define a constructor function.
Include the `CONSTRUCTOR FUNCTION` keyword and function definition to define a constructor function.

`func_name` is an identifier of a function. If the `SELF` parameter is specified, `name` is the object type name given in the `CREATE TYPE` command. If specified, `parm1, parm2, …` are the formal parameters of the function. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters. `return_type` is the data type of the value the function returns.
`func_name` is an identifier of a function. If specified, `parm1, parm2, …` are the formal parameters of the function. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters. `return_type` is the data type of the value the function returns.

The following points should be noted about an object type specification:

- There must be at least one attribute defined in the object type.

- There may be none, one, or more methods defined in the object type.

- For each member method there is an implicit, built-in parameter named `SELF`, whose data type is that of the object type being defined.

`SELF` refers to the object instance that is currently invoking the method. `SELF` can be explicitly declared as an `IN` or `IN OUT` parameter in the parameter list (for example as `MEMBER FUNCTION (SELF IN OUT object_type ...)).`

If `SELF` is explicitly declared, `SELF` must be the first parameter in the parameter list. If `SELF` is not explicitly declared, its parameter mode defaults to `IN OUT` for member procedures and `IN` for member functions.

- A static method cannot be overridden (`OVERRIDING` and `STATIC` cannot be specified together in `method_spec`).

- A static method must be instantiable (`NOT INSTANTIABLE` and `STATIC` cannot be specified together in `method_spec`).
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,14 @@ and `subprogram_spec` is the following:
where `constructor` is:

```text
CONSTRUCTOR <func_name>
[ ( [ SELF [ IN | IN OUT ] <name> ]
[, <parm1> [ IN | IN OUT | OUT ] <datatype1>
CONSTRUCTOR FUNCTION <func_name>
[ ( [ <parm1> [ IN | IN OUT | OUT ] <datatype1>
[ DEFAULT <value1> ] ]
[, <parm2> [ IN | IN OUT | OUT ] <datatype2>
[ DEFAULT <value2> ]
] ...)
]
RETURN self AS RESULT
RETURN <return_type>;
{ IS | AS }
[ <declarations> ]
BEGIN
Expand All @@ -95,7 +94,7 @@ If `NOT INSTANTIABLE` was specified in `method_spec` of the `CREATE TYPE` comman

`proc_name` is an identifier of a procedure specified in the `CREATE TYPE` command. The parameter declarations have the same meaning as described for the `CREATE TYPE` command, and must be specified in the `CREATE TYPE BODY` command in the same manner as specified in the `CREATE TYPE` command.

Include the `CONSTRUCTOR` keyword and function definition to define a constructor function.
Include the `CONSTRUCTOR FUNCTION` keyword and function definition to define a constructor function.

`func_name` is an identifier of a function specified in the `CREATE TYPE` command. The parameter declarations have the same meaning as described for the `CREATE TYPE` command, and must be specified in the `CREATE TYPE BODY` command in the same manner as specified in the `CREATE TYPE` command. `return_type` is the data type of the value the function returns and must match `return_type` given in the `CREATE TYPE` command.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ where `subprogram_spec` is the following:
where `constructor` is the following:

```text
CONSTRUCTOR <func_name>
[ ( [ SELF [ IN | IN OUT ] <name> ]
[, <parm1> [ IN | IN OUT | OUT ] <datatype1>
CONSTRUCTOR FUNCTION <func_name>
[ ( [ <parm1> [ IN | IN OUT | OUT ] <datatype1>
[ DEFAULT <value1> ] ]
[, <parm2> [ IN | IN OUT | OUT ] <datatype2>
[ DEFAULT <value2> ]
] ...)
]
RETURN self AS RESULT
RETURN <return_type>;
```

!!! Note
Expand Down Expand Up @@ -104,22 +103,16 @@ Prior to the definition of a method, `[ NOT ] INSTANTIABLE` specifies whether or

`proc_name` is an identifier of a procedure. If the `SELF` parameter is specified, `name` is the object type name given in the `CREATE TYPE` command. If specified, `parm1, parm2, …` are the formal parameters of the procedure. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters.

Include the `CONSTRUCTOR` keyword and function definition to define a constructor function.
Include the `CONSTRUCTOR FUNCTION` keyword and function definition to define a constructor function.

`func_name` is an identifier of a function. If the `SELF` parameter is specified, `name` is the object type name given in the `CREATE TYPE` command. If specified, `parm1, parm2, …` are the formal parameters of the function. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters. `return_type` is the data type of the value the function returns.
`func_name` is an identifier of a function. If specified, `parm1, parm2, …` are the formal parameters of the function. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters. `return_type` is the data type of the value the function returns.

The following points should be noted about an object type specification:

- There must be at least one attribute defined in the object type.

- There may be none, one, or more methods defined in the object type.

- For each member method there is an implicit, built-in parameter named `SELF`, whose data type is that of the object type being defined.

`SELF` refers to the object instance that is currently invoking the method. `SELF` can be explicitly declared as an `IN` or `IN OUT` parameter in the parameter list (for example as `MEMBER FUNCTION (SELF IN OUT object_type ...)).`

If `SELF` is explicitly declared, `SELF` must be the first parameter in the parameter list. If `SELF` is not explicitly declared, its parameter mode defaults to `IN OUT` for member procedures and `IN` for member functions.

- A static method cannot be overridden (`OVERRIDING` and `STATIC` cannot be specified together in `method_spec`).

- A static method must be instantiable (`NOT INSTANTIABLE` and `STATIC` cannot be specified together in `method_spec`).
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,14 @@ and `subprogram_spec` is the following:
where `constructor` is:

```text
CONSTRUCTOR <func_name>
[ ( [ SELF [ IN | IN OUT ] <name> ]
[, <parm1> [ IN | IN OUT | OUT ] <datatype1>
CONSTRUCTOR FUNCTION <func_name>
[ ( [ <parm1> [ IN | IN OUT | OUT ] <datatype1>
[ DEFAULT <value1> ] ]
[, <parm2> [ IN | IN OUT | OUT ] <datatype2>
[ DEFAULT <value2> ]
] ...)
]
RETURN self AS RESULT
RETURN <return_type>;
{ IS | AS }
[ <declarations> ]
BEGIN
Expand All @@ -95,7 +94,7 @@ If `NOT INSTANTIABLE` was specified in `method_spec` of the `CREATE TYPE` comman

`proc_name` is an identifier of a procedure specified in the `CREATE TYPE` command. The parameter declarations have the same meaning as described for the `CREATE TYPE` command, and must be specified in the `CREATE TYPE BODY` command in the same manner as specified in the `CREATE TYPE` command.

Include the `CONSTRUCTOR` keyword and function definition to define a constructor function.
Include the `CONSTRUCTOR FUNCTION` keyword and function definition to define a constructor function.

`func_name` is an identifier of a function specified in the `CREATE TYPE` command. The parameter declarations have the same meaning as described for the `CREATE TYPE` command, and must be specified in the `CREATE TYPE BODY` command in the same manner as specified in the `CREATE TYPE` command. `return_type` is the data type of the value the function returns and must match `return_type` given in the `CREATE TYPE` command.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,14 @@ where `subprogram_spec` is the following:
where `constructor` is the following:

```text
CONSTRUCTOR <func_name>
[ ( [ SELF [ IN | IN OUT ] <name> ]
[, <parm1> [ IN | IN OUT | OUT ] <datatype1>
CONSTRUCTOR FUNCTION <func_name>
[ ( [ <parm1> [ IN | IN OUT | OUT ] <datatype1>
[ DEFAULT <value1> ] ]
[, <parm2> [ IN | IN OUT | OUT ] <datatype2>
[ DEFAULT <value2> ]
] ...)
]
RETURN self AS RESULT
RETURN <return_type>;
```

!!! Note
Expand Down Expand Up @@ -107,22 +106,16 @@ Prior to the definition of a method, `[ NOT ] INSTANTIABLE` specifies whether or

`proc_name` is an identifier of a procedure. If the `SELF` parameter is specified, `name` is the object type name given in the `CREATE TYPE` command. If specified, `parm1, parm2, …` are the formal parameters of the procedure. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters.

Include the `CONSTRUCTOR` keyword and function definition to define a constructor function.
Include the `CONSTRUCTOR FUNCTION` keyword and function definition to define a constructor function.

`func_name` is an identifier of a function. If the `SELF` parameter is specified, `name` is the object type name given in the `CREATE TYPE` command. If specified, `parm1, parm2, …` are the formal parameters of the function. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters. `return_type` is the data type of the value the function returns.
`func_name` is an identifier of a function. If specified, `parm1, parm2, …` are the formal parameters of the function. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN, IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. If none are specified, the default is `IN`. `value1, value2, …` are default values that may be specified for `IN` parameters. `return_type` is the data type of the value the function returns.

The following points should be noted about an object type specification:

- There must be at least one attribute defined in the object type.

- There may be none, one, or more methods defined in the object type.

- For each member method there is an implicit, built-in parameter named `SELF`, whose data type is that of the object type being defined.

`SELF` refers to the object instance that is currently invoking the method. `SELF` can be explicitly declared as an `IN` or `IN OUT` parameter in the parameter list (for example as `MEMBER FUNCTION (SELF IN OUT object_type ...)).`

If `SELF` is explicitly declared, `SELF` must be the first parameter in the parameter list. If `SELF` is not explicitly declared, its parameter mode defaults to `IN OUT` for member procedures and `IN` for member functions.

- A static method cannot be overridden (`OVERRIDING` and `STATIC` cannot be specified together in `method_spec`).

- A static method must be instantiable (`NOT INSTANTIABLE` and `STATIC` cannot be specified together in `method_spec`).
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,14 @@ and `subprogram_spec` is the following:
where `constructor` is:

```text
CONSTRUCTOR <func_name>
[ ( [ SELF [ IN | IN OUT ] <name> ]
[, <parm1> [ IN | IN OUT | OUT ] <datatype1>
CONSTRUCTOR FUNCTION <func_name>
[ ( [ <parm1> [ IN | IN OUT | OUT ] <datatype1>
[ DEFAULT <value1> ] ]
[, <parm2> [ IN | IN OUT | OUT ] <datatype2>
[ DEFAULT <value2> ]
] ...)
]
RETURN self AS RESULT
RETURN <return_type>;
{ IS | AS }
[ <declarations> ]
BEGIN
Expand All @@ -98,7 +97,7 @@ If `NOT INSTANTIABLE` was specified in `method_spec` of the `CREATE TYPE` comman

`proc_name` is an identifier of a procedure specified in the `CREATE TYPE` command. The parameter declarations have the same meaning as described for the `CREATE TYPE` command, and must be specified in the `CREATE TYPE BODY` command in the same manner as specified in the `CREATE TYPE` command.

Include the `CONSTRUCTOR` keyword and function definition to define a constructor function.
Include the `CONSTRUCTOR FUNCTION` keyword and function definition to define a constructor function.

`func_name` is an identifier of a function specified in the `CREATE TYPE` command. The parameter declarations have the same meaning as described for the `CREATE TYPE` command, and must be specified in the `CREATE TYPE BODY` command in the same manner as specified in the `CREATE TYPE` command. `return_type` is the data type of the value the function returns and must match `return_type` given in the `CREATE TYPE` command.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ Where `subprogram_spec` is the following:
Where `constructor` is the following:

```text
CONSTRUCTOR <func_name>
[ ( [ SELF [ IN | IN OUT ] <name> ]
[, <parm1> [ IN | IN OUT | OUT ] <datatype1>
CONSTRUCTOR FUNCTION <func_name>
[ ( [ <parm1> [ IN | IN OUT | OUT ] <datatype1>
[ DEFAULT <value1> ] ]
[, <parm2> [ IN | IN OUT | OUT ] <datatype2>
[ DEFAULT <value2> ]
] ...)
]
RETURN self AS RESULT
RETURN <return_type>;
```

!!! Note
Expand Down Expand Up @@ -103,22 +102,16 @@ Before defining a method, use `[ NOT ] INSTANTIABLE` to specify whether the obje

`proc_name` is an identifier of a procedure. If you specify the `SELF` parameter, `name` is the object type name given in the `CREATE TYPE` command. If specified, `parm1, parm2, …` are the formal parameters of the procedure. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN`, `IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. The default is `IN`. `value1, value2, …` are default values that you can specify for `IN` parameters.

Include the `CONSTRUCTOR` keyword and function definition to define a constructor function.
Include the `CONSTRUCTOR FUNCTION` keyword and function definition to define a constructor function.

`func_name` is an identifier of a function. If you specify the `SELF` parameter, `name` is the object type name given in the `CREATE TYPE` command. If specified, `parm1, parm2, …` are the formal parameters of the function. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN`, `IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. The default is `IN`. `value1, value2, …` are default values that you can specify for `IN` parameters. `return_type` is the data type of the value the function returns.
`func_name` is an identifier of a function. If specified, `parm1, parm2, …` are the formal parameters of the function. `datatype1, datatype2, …` are the data types of `parm1, parm2, …` respectively. `IN`, `IN OUT`, and `OUT` are the possible parameter modes for each formal parameter. The default is `IN`. `value1, value2, …` are default values that you can specify for `IN` parameters. `return_type` is the data type of the value the function returns.

Note the following about an object type specification:

- There must be at least one attribute defined in the object type.

- There can be zero, one, or more methods defined in the object type.

- For each member method, there is an implicit, built-in parameter named `SELF` whose data type is that of the object type being defined.

`SELF` refers to the object instance that's currently invoking the method. `SELF` can be explicitly declared as an `IN` or `IN OUT` parameter in the parameter list (for example, as `MEMBER FUNCTION (SELF IN OUT object_type ...)`).

If `SELF` is explicitly declared, `SELF` must be the first parameter in the parameter list. If `SELF` isn't explicitly declared, its parameter mode defaults to `IN OUT` for member procedures and `IN` for member functions.

- A static method can't be overridden. You can't specify `OVERRIDING` and `STATIC` together in `method_spec`.

- A static method must be instantiable. You can't specify `NOT INSTANTIABLE` and `STATIC` together in `method_spec`.
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,14 @@ Where `method_spec` is `subprogram_spec`, and `subprogram_spec` is the following
Where `constructor` is:

```text
CONSTRUCTOR <func_name>
[ ( [ SELF [ IN | IN OUT ] <name> ]
[, <parm1> [ IN | IN OUT | OUT ] <datatype1>
CONSTRUCTOR FUNCTION <func_name>
[ ( [ <parm1> [ IN | IN OUT | OUT ] <datatype1>
[ DEFAULT <value1> ] ]
[, <parm2> [ IN | IN OUT | OUT ] <datatype2>
[ DEFAULT <value2> ]
] ...)
]
RETURN self AS RESULT
RETURN <return_type>;
{ IS | AS }
[ <declarations> ]
BEGIN
Expand All @@ -92,7 +91,7 @@ If `NOT INSTANTIABLE` was specified in `method_spec` of the `CREATE TYPE` comman

`proc_name` is an identifier of a procedure specified in the `CREATE TYPE` command. The parameter declarations have the same meaning as described for the `CREATE TYPE` command. They must be specified in the `CREATE TYPE BODY` command in the same manner as in the `CREATE TYPE` command.

Include the `CONSTRUCTOR` keyword and function definition to define a constructor function.
Include the `CONSTRUCTOR FUNCTION` keyword and function definition to define a constructor function.

`func_name` is an identifier of a function specified in the `CREATE TYPE` command. The parameter declarations have the same meaning as described for the `CREATE TYPE` command and must be specified in the `CREATE TYPE BODY` command in the same manner as in the `CREATE TYPE` command. `return_type` is the data type of the value the function returns and must match the `return_type` given in the `CREATE TYPE` command.

Expand Down

1 comment on commit 6d0c26e

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.