@things-factory/integration-base 6.1.122 → 6.1.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/images/oracle-procedure-example1.png +0 -0
- package/assets/images/oracle-procedure-example2.png +0 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/integration/task/oracle-procedure.ko.md +12 -8
- package/helps/integration/task/oracle-procedure.md +44 -41
- package/helps/integration/task/oracle-procedure.ms.md +139 -0
- package/helps/integration/task/oracle-procedure.zh.md +141 -0
- package/helps/integration/task/sleep.md +2 -2
- package/package.json +8 -8
@@ -5,16 +5,21 @@ Oracle 데이터베이스에 저장되어 있는 프로시저를 호출하는
|
|
5
5
|
|
6
6
|
## Parameters
|
7
7
|
|
8
|
-
### 프로시저
|
9
|
-
-
|
10
|
-
-
|
11
|
-
|
12
|
-
- 프로시저 작성 예는 다음과 같다.
|
13
|
-
|
14
|
-
```sql
|
8
|
+
### 프로시저 코드
|
9
|
+
- 프로시저 코드는 *프로시저 이름*과 *파라미터*에 의해서 자동으로 생성되는 코드로서, 별도로 사용자가 입력할 필요는 없다.
|
10
|
+
- 만약, 프로시저의 이름이 *mcs.myproc*이고, 파라미터가 *id*와 *out_name*으로 구성된다면, 다음과 같이 표현된다.
|
11
|
+
```text
|
15
12
|
mcs.myproc(:id, :out_name);
|
16
13
|
```
|
17
14
|
|
15
|
+
### 프로시저 이름
|
16
|
+
- 프로시저의 이름을 지정한다.
|
17
|
+
- 프로시저가 패키지나 사용자 이름등으로 구분이 필요할 경우 '.'을 통해서 구분한다.
|
18
|
+
- 사용 예.
|
19
|
+
```text
|
20
|
+
mcs.myproc
|
21
|
+
```
|
22
|
+
|
18
23
|
### 파라미터
|
19
24
|
- 파라미터는 다음과 같은 요소로 구성되어 있다.
|
20
25
|
- 파라미터 이름
|
@@ -101,7 +106,6 @@ BEGIN
|
|
101
106
|
SELECT * FROM FARMWEATHER WHERE rownum <= 1000;
|
102
107
|
END;
|
103
108
|
END PROCEDURE1;
|
104
|
-
|
105
109
|
```
|
106
110
|
|
107
111
|
### 프로시저 호출 예
|
@@ -1,48 +1,51 @@
|
|
1
1
|
# Oracle Procedure Task
|
2
2
|
|
3
|
-
A task that calls a procedure stored in
|
4
|
-
|
3
|
+
A task that calls a procedure stored in the Oracle database,
|
4
|
+
It returns a list of data or a value of a specific data type, depending on the individual data type.
|
5
5
|
|
6
6
|
## Parameters
|
7
7
|
|
8
|
-
### Procedure
|
9
|
-
-
|
10
|
-
-
|
11
|
-
|
12
|
-
- An example of writing a procedure is as follows
|
13
|
-
|
14
|
-
```sql
|
8
|
+
### Procedure Code
|
9
|
+
- The procedure code is the code that is automatically generated by the *procedure name* and *parameters* and does not need to be entered by the user.
|
10
|
+
- If a procedure is named *mcs.myproc* and the parameters consist of *id* and *out_name*, it would look like this
|
11
|
+
```text
|
15
12
|
mcs.myproc(:id, :out_name);
|
16
13
|
```
|
17
14
|
|
15
|
+
### Procedure Name
|
16
|
+
- Specifies the name of the procedure.
|
17
|
+
- If the procedure needs to be separated by a package or user name, use a '.' to separate them.
|
18
|
+
- Example.
|
19
|
+
```text
|
20
|
+
mcs.myproc
|
21
|
+
```text mcs.myproc
|
22
|
+
|
18
23
|
### Parameters
|
19
24
|
- A parameter consists of the following elements
|
20
|
-
-
|
25
|
+
- A parameter name
|
21
26
|
- Input/output designation: IN, INOUT, OUT
|
22
27
|
- Parameter type: String, Number, Date, Cursor
|
23
28
|
- Value: If the variable is an input, the value for that input.
|
24
|
-
- MaxSize: If the variable is of type String or Buffer,
|
29
|
+
- MaxSize: If the variable is of type String or Buffer, the maximum size of the variable.
|
25
30
|
|
26
|
-
####
|
31
|
+
#### Parameter names
|
27
32
|
|
28
|
-
|
33
|
+
The parameter name specifies the name of the parameter used in the procedure.
|
29
34
|
For the previous example,
|
30
|
-
|
31
35
|
```sql
|
32
36
|
mcs.myproc(:id, :out_name);
|
33
37
|
```
|
38
|
+
id and out_name are the parameter names.
|
34
39
|
|
35
|
-
|
40
|
+
### Specifying input and output
|
36
41
|
|
37
|
-
|
42
|
+
Specifies whether the variable is input (IN) or output (OUT).
|
38
43
|
|
39
|
-
|
44
|
+
### parameter type
|
40
45
|
|
41
|
-
|
46
|
+
Specifies the type of the parameter. The type must be the same as the name specified in the actual procedure creation.
|
42
47
|
|
43
|
-
|
44
|
-
|
45
|
-
If the procedure is implemented as follows,
|
48
|
+
If the procedure is implemented like this
|
46
49
|
|
47
50
|
```sql
|
48
51
|
CREATE OR REPLACE NONEDITIONABLE PROCEDURE myproc (in_id IN VARCHAR2, out_name OUT VARCHAR2) AS
|
@@ -51,35 +54,36 @@ BEGIN
|
|
51
54
|
END;
|
52
55
|
```
|
53
56
|
|
54
|
-
|
57
|
+
Note that both the first and second parameters are specified as VARCHAR2,
|
55
58
|
|
56
|
-
If you need to call these procedures, the parameter types
|
59
|
+
If you need to call these procedures, the parameter types must be specified as String,
|
57
60
|
For the output, the maximum size should be specified.
|
58
61
|
|
59
62
|
An example call specification is as follows
|
60
63
|
|
61
|
-

|
65
|
+
|
62
66
|
|
67
|
+
### Accessor [accessor](../concept/data-accessor.md)
|
63
68
|
|
64
|
-
|
69
|
+
Follow the [JSONATA documentation](http://docs.jsonata.org/overview.html) for configuration.
|
65
70
|
|
66
|
-
- Set when you want to propagate only a part of the data object of the source component or the transformed data.
|
67
|
-
- The setting method follows [JSONATA document](http://docs.jsonata.org/overview.html).
|
68
71
|
|
69
|
-
### Value
|
72
|
+
### Value
|
70
73
|
|
71
74
|
If the parameter is an input (IN), specify its value.
|
72
|
-
Do not enter a constant value directly into the value, but
|
75
|
+
Do not enter a constant value directly into the value, but specify a specific task name.
|
73
76
|
|
74
|
-
In the example above, if the input value
|
77
|
+
In the example above, if the input value of id is specified as ID, specify the value returned by the ID task as the input value.
|
75
78
|
|
76
|
-
### Maxsize
|
77
79
|
|
78
|
-
|
80
|
+
### Maximum size
|
81
|
+
|
82
|
+
If the parameter type is String or Buffer, specify the maximum size. For other types, do not specify a value and ignore it.
|
79
83
|
|
80
84
|
## Task Result
|
81
85
|
|
82
|
-
The result of
|
86
|
+
The result of the procedure call is returned in the form of an Object, and the parameter name specified as the output is the key and returns the value.
|
83
87
|
|
84
88
|
For example, the task introduced above returns the following result value.
|
85
89
|
|
@@ -90,26 +94,25 @@ For example, the task introduced above returns the following result value.
|
|
90
94
|
```
|
91
95
|
|
92
96
|
|
93
|
-
##
|
97
|
+
## Other usage examples (cursor)
|
94
98
|
|
95
|
-
###
|
99
|
+
### Example of writing a procedure
|
96
100
|
|
97
101
|
```sql
|
98
|
-
CREATE OR
|
102
|
+
CREATE OR REPLACE NONEDITIONABLE PROCEDURE PROCEDURE1(out_cursor OUT SYS_REFCURSOR) AS
|
99
103
|
BEGIN
|
100
104
|
BEGIN
|
101
105
|
OPEN out_cursor FOR
|
102
106
|
SELECT * FROM FARMWEATHER WHERE rownum <= 1000;
|
103
107
|
END;
|
104
108
|
END PROCEDURE1;
|
105
|
-
|
106
109
|
```
|
107
110
|
|
108
|
-
###
|
111
|
+
### Example of calling a procedure
|
109
112
|
|
110
|
-

|
111
114
|
|
112
|
-
###
|
115
|
+
### Procedure task call result
|
113
116
|
|
114
117
|
```javascript
|
115
118
|
{
|
@@ -133,4 +136,4 @@ END PROCEDURE1;
|
|
133
136
|
...
|
134
137
|
]
|
135
138
|
}
|
136
|
-
```
|
139
|
+
```
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# Tugas Prosedur Oracle
|
2
|
+
|
3
|
+
Tugas ini memanggil prosedur yang disimpan dalam pangkalan data Oracle,
|
4
|
+
dan mengembalikan senarai data atau nilai jenis data tertentu bergantung pada jenis data individu.
|
5
|
+
|
6
|
+
## Parameter
|
7
|
+
|
8
|
+
### Kod Prosedur
|
9
|
+
- Kod prosedur adalah kod yang dihasilkan secara automatik oleh *nama prosedur* dan *parameter*, dan pengguna tidak perlu memasukkannya secara berasingan.
|
10
|
+
- Jika nama prosedur adalah *mcs.myproc* dan parameter terdiri daripada *id* dan *out_name*, ia akan dinyatakan seperti berikut.
|
11
|
+
```text
|
12
|
+
mcs.myproc(:id, :out_name);
|
13
|
+
```
|
14
|
+
|
15
|
+
### Nama Prosedur
|
16
|
+
- Tentukan nama prosedur.
|
17
|
+
- Jika prosedur perlu dibezakan dengan nama pakej atau pengguna, dll., ia dibezakan dengan '.'.
|
18
|
+
- Contoh penggunaan.
|
19
|
+
```text
|
20
|
+
mcs.myproc
|
21
|
+
```
|
22
|
+
|
23
|
+
### Parameter
|
24
|
+
- Parameter terdiri daripada elemen-elemen berikut.
|
25
|
+
- Nama parameter
|
26
|
+
- Penentuan input / output: IN, INOUT, OUT
|
27
|
+
- Jenis parameter: String, Number, Date, Cursor
|
28
|
+
- Nilai: Jika pemboleh ubah itu adalah input, nilai untuk input itu
|
29
|
+
- Saiz maksimum: Jika jenis pemboleh ubah adalah String atau Buffer, tentukan saiz maksimum pemboleh ubah.
|
30
|
+
|
31
|
+
#### Nama Parameter
|
32
|
+
|
33
|
+
Nama parameter menentukan nama parameter yang digunakan semasa membuat prosedur.
|
34
|
+
Dalam contoh di atas,
|
35
|
+
```sql
|
36
|
+
mcs.myproc(:id, :out_name);
|
37
|
+
```
|
38
|
+
id dan out_name adalah nama parameter masing-masing.
|
39
|
+
|
40
|
+
### Penentuan Input / Output
|
41
|
+
|
42
|
+
Tentukan sama ada pemboleh ubah itu adalah input (IN) atau output (OUT).
|
43
|
+
|
44
|
+
### Jenis Parameter
|
45
|
+
|
46
|
+
Tentukan jenis parameter. Jenis harus ditentukan sama dengan nama yang ditentukan semasa membuat prosedur sebenar.
|
47
|
+
|
48
|
+
Jika prosedur diimplementasikan seperti berikut,
|
49
|
+
|
50
|
+
```sql
|
51
|
+
CREATE OR REPLACE NONEDITIONABLE PROCEDURE myproc (in_id IN VARCHAR2, out_name OUT VARCHAR2) AS
|
52
|
+
BEGIN
|
53
|
+
SELECT name INTO out_name FROM MCS.FMB_USERS WHERE id = in_id ;
|
54
|
+
END;
|
55
|
+
```
|
56
|
+
|
57
|
+
Parameter pertama dan kedua kedua-duanya ditentukan sebagai VARCHAR2,
|
58
|
+
|
59
|
+
Jika anda perlu memanggil prosedur seperti itu, anda harus menentukan semua jenis parameter sebagai String,
|
60
|
+
dan dalam kes output, anda juga harus menentukan saiz maksimum.
|
61
|
+
|
62
|
+
Contoh penentuan panggilan adalah seperti berikut.
|
63
|
+
|
64
|
+

|
65
|
+
|
66
|
+
|
67
|
+
### Akses [accessor](../concept/data-accessor.md)
|
68
|
+
|
69
|
+
Cara menetapkan mengikuti [dokumen JSONATA](http://docs.jsonata.org/overview.html).
|
70
|
+
|
71
|
+
|
72
|
+
### Nilai
|
73
|
+
|
74
|
+
Jika parameter adalah input (IN), tentukan nilainya.
|
75
|
+
Alih-alih memasukkan nilai konstan secara langsung ke dalam nilai ini, tentukan nama tugas tertentu.
|
76
|
+
|
77
|
+
Dalam contoh di atas, jika nilai input untuk id ditetapkan sebagai ID, nilai yang dikembalikan oleh tugas ID ditetapkan sebagai nilai input.
|
78
|
+
|
79
|
+
|
80
|
+
### Saiz Maksimum
|
81
|
+
|
82
|
+
Jika jenis parameter adalah String atau Buffer, tentukan saiz maksimum. Untuk jenis lain, abaikan nilai yang tidak ditentukan.
|
83
|
+
|
84
|
+
## Hasil Tugas
|
85
|
+
|
86
|
+
Hasil panggilan prosedur dikembalikan dalam bentuk Objek, dan nama parameter yang ditetapkan sebagai output menjadi kunci untuk mengembalikan nilainya.
|
87
|
+
|
88
|
+
Jika tugas yang diperkenalkan di atas mengembalikan hasil seperti berikut.
|
89
|
+
|
90
|
+
```javascript
|
91
|
+
{
|
92
|
+
out_name: 'Admin'
|
93
|
+
}
|
94
|
+
```
|
95
|
+
|
96
|
+
|
97
|
+
## Contoh Penggunaan Lain (Kursor)
|
98
|
+
|
99
|
+
### Contoh Pembuatan Prosedur
|
100
|
+
|
101
|
+
```sql
|
102
|
+
CREATE OR REPLACDE NONEDITIONABLE PROCEDURE PROCEDURE1(out_cursor OUT SYS_REFCURSOR) AS
|
103
|
+
BEGIN
|
104
|
+
BEGIN
|
105
|
+
OPEN out_cursor FOR
|
106
|
+
SELECT * FROM FARMWEATHER WHERE rownum <= 1000;
|
107
|
+
END;
|
108
|
+
END PROCEDURE1;
|
109
|
+
```
|
110
|
+
|
111
|
+
### Contoh Panggilan Prosedur
|
112
|
+
|
113
|
+

|
114
|
+
|
115
|
+
### Hasil Panggilan Tugas Prosedur
|
116
|
+
|
117
|
+
```javascript
|
118
|
+
{
|
119
|
+
"out_cursor": [
|
120
|
+
{
|
121
|
+
"FARMDATE": "2006-01-07T15:00:00.000Z",
|
122
|
+
"MAXT": 29.5,
|
123
|
+
"MINT": 21.8,
|
124
|
+
"WINDSPEED": 1.6,
|
125
|
+
"FARMHUM": 70.2,
|
126
|
+
"PRECIPITATION": 0
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"FARMDATE": "2006-01-08T15:00:00.000Z",
|
130
|
+
"MAXT": 30.1,
|
131
|
+
"MINT": 21,
|
132
|
+
"WINDSPEED": 1.6,
|
133
|
+
"FARMHUM": 67.4,
|
134
|
+
"PRECIPITATION": 0
|
135
|
+
},
|
136
|
+
..
|
137
|
+
]
|
138
|
+
}
|
139
|
+
```
|
@@ -0,0 +1,141 @@
|
|
1
|
+
# Oracle 存储过程任务
|
2
|
+
|
3
|
+
调用 Oracle 数据库中存储的存储过程的任务、
|
4
|
+
它根据数据类型返回数据列表或特定数据类型的值。
|
5
|
+
|
6
|
+
### 参数
|
7
|
+
|
8
|
+
### 过程代码
|
9
|
+
- 存储过程代码是由*存储过程名称*和*参数*自动生成的代码,用户无需输入。
|
10
|
+
- 例如,如果存储过程的名称为 *mcs.myproc*,参数为 *id* 和 *out_name*,那么存储过程代码将如下所示
|
11
|
+
```文本
|
12
|
+
mcs.myproc(:id, :out_name);
|
13
|
+
```
|
14
|
+
|
15
|
+
### 存储过程名称
|
16
|
+
- 指定存储过程的名称。
|
17
|
+
- 如果存储过程需要用包或用户名分隔,请使用". "分隔。
|
18
|
+
- 例如
|
19
|
+
文本
|
20
|
+
mcs.myproc
|
21
|
+
文本 mcs.myproc
|
22
|
+
|
23
|
+
### 参数
|
24
|
+
- 参数由以下元素组成
|
25
|
+
- 参数名称
|
26
|
+
- 输入/输出名称:IN、INOUT、OUT
|
27
|
+
- 参数类型:字符串、数字、日期、光标
|
28
|
+
- 值:如果变量是输入,则是该输入的值。
|
29
|
+
- MaxSize:如果变量是字符串或缓冲区类型,则为变量的最大大小。
|
30
|
+
|
31
|
+
#### 参数名称
|
32
|
+
|
33
|
+
参数名指定存储过程中使用的参数名称。
|
34
|
+
例如
|
35
|
+
``sql
|
36
|
+
mcs.myproc(:id, :out_name);
|
37
|
+
```
|
38
|
+
id 和 out_name 是参数名。
|
39
|
+
|
40
|
+
### 指定输入和输出
|
41
|
+
|
42
|
+
指定变量是输入(IN)还是输出(OUT)。
|
43
|
+
|
44
|
+
### 参数类型
|
45
|
+
|
46
|
+
指定参数的类型。类型必须与实际创建存储过程时指定的名称相同。
|
47
|
+
|
48
|
+
如果存储过程以
|
49
|
+
|
50
|
+
存储过程
|
51
|
+
CREATE OR REPLACE NONEDITIONABLE PROCEDURE myproc (in_id IN VARCHAR2, out_name OUT VARCHAR2) AS
|
52
|
+
开始
|
53
|
+
SELECT name INTO out_name FROM MCS.FMB_USERS WHERE id = in_id ;
|
54
|
+
结束;
|
55
|
+
```
|
56
|
+
|
57
|
+
请注意,第一个和第二个参数都指定为 VARCHAR2、
|
58
|
+
|
59
|
+
如果需要调用这些存储过程,必须将参数类型指定为字符串、
|
60
|
+
对于输出,必须指定最大大小。
|
61
|
+
|
62
|
+
调用说明示例如下
|
63
|
+
|
64
|
+
[存储过程 example1](./assets/././././././././assets/images/oracle-procedure-example1.png '存储过程 example1')
|
65
|
+
|
66
|
+
|
67
|
+
### Accessor [accessor](../concept/data-accessor.md)
|
68
|
+
|
69
|
+
按照 [JSONATA 文档](http://docs.jsonata.org/overview.html) 进行配置。
|
70
|
+
|
71
|
+
|
72
|
+
### 值
|
73
|
+
|
74
|
+
如果参数是输入(IN),请指定其值。
|
75
|
+
不要直接在值中输入常量,而应指定具体的任务名称。
|
76
|
+
|
77
|
+
在上例中,如果 id 的输入值指定为 ID,则指定 ID 任务返回的值作为输入值。
|
78
|
+
|
79
|
+
|
80
|
+
### 最大大小
|
81
|
+
|
82
|
+
如果参数类型为字符串或缓冲区,请指定最大大小。对于其他类型,请不要指定值,并忽略它。
|
83
|
+
|
84
|
+
### 任务结果
|
85
|
+
|
86
|
+
存储过程调用的结果以对象的形式返回,指定为输出的参数名称是关键字,并返回值。
|
87
|
+
|
88
|
+
例如,上面介绍的任务会返回以下结果值。
|
89
|
+
|
90
|
+
```javascript
|
91
|
+
}
|
92
|
+
out_name: 'Admin
|
93
|
+
}
|
94
|
+
```
|
95
|
+
|
96
|
+
|
97
|
+
### 其他使用示例(光标)
|
98
|
+
|
99
|
+
### 编写存储过程的示例
|
100
|
+
|
101
|
+
``sql
|
102
|
+
CREATE OR REPLACE NONEDITIONABLE PROCEDURE PROCEDURE1(out_cursor OUT SYS_REFCURSOR) AS
|
103
|
+
开始
|
104
|
+
开始
|
105
|
+
打开 out_cursor FOR
|
106
|
+
SELECT * FROM FARMWEATHER WHERE rownum <= 1000;
|
107
|
+
结束;
|
108
|
+
结束过程1;
|
109
|
+
```
|
110
|
+
|
111
|
+
### 调用存储过程的示例
|
112
|
+
|
113
|
+

|
114
|
+
|
115
|
+
### 程序任务调用结果
|
116
|
+
|
117
|
+
```javascript
|
118
|
+
{ }
|
119
|
+
"out_cursor": [].
|
120
|
+
{
|
121
|
+
"FARMDATE": "2006-01-07T15:00:00.000Z",
|
122
|
+
"MAXT": 29.5,
|
123
|
+
"MINT": 21.8,
|
124
|
+
"WINDSPEED": 1.6,
|
125
|
+
"FARMHUM": 70: 70.2,
|
126
|
+
"降水量": 0 0
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"FARMDATE": "2006-01-08T15:00:00.000Z",
|
130
|
+
"MAXT": 30.1,
|
131
|
+
"MINT": 21,
|
132
|
+
"WINDSPEED": 1.6,
|
133
|
+
"FARMHUM": 67: 67.4,
|
134
|
+
"precipitation": 0 0
|
135
|
+
},
|
136
|
+
...
|
137
|
+
]
|
138
|
+
}
|
139
|
+
```
|
140
|
+
|
141
|
+
通过www.DeepL.com/Translator(免费版)翻译
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/integration-base",
|
3
|
-
"version": "6.1.
|
3
|
+
"version": "6.1.127",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -26,12 +26,12 @@
|
|
26
26
|
},
|
27
27
|
"dependencies": {
|
28
28
|
"@apollo/client": "^3.6.9",
|
29
|
-
"@things-factory/api": "^6.1.
|
30
|
-
"@things-factory/auth-base": "^6.1.
|
31
|
-
"@things-factory/env": "^6.1.
|
32
|
-
"@things-factory/oauth2-client": "^6.1.
|
33
|
-
"@things-factory/scheduler-client": "^6.1.
|
34
|
-
"@things-factory/shell": "^6.1.
|
29
|
+
"@things-factory/api": "^6.1.127",
|
30
|
+
"@things-factory/auth-base": "^6.1.127",
|
31
|
+
"@things-factory/env": "^6.1.127",
|
32
|
+
"@things-factory/oauth2-client": "^6.1.127",
|
33
|
+
"@things-factory/scheduler-client": "^6.1.127",
|
34
|
+
"@things-factory/shell": "^6.1.127",
|
35
35
|
"async-mqtt": "^2.5.0",
|
36
36
|
"chance": "^1.1.11",
|
37
37
|
"cross-fetch": "^3.0.4",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"devDependencies": {
|
47
47
|
"@types/cron": "^2.0.1"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "1e37585e8021af947ffdf03c11c90754a949a318"
|
50
50
|
}
|