You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/api.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,14 +255,14 @@ Oracledb.ARRAY // Fetch each row as array of column values
255
255
Oracledb.OBJECT // Fetch each row as an object
256
256
```
257
257
258
-
#### Type constants for `execute()`[bind parameter](#executebindParams) and [Lob](#proplobpiecesize)`type` properties, for [`fetchAsString`](#propdbfetchasstring), and for [`fetchInfo`](#propfetchinfo):
258
+
#### Type constants for `execute()`[bind parameter](#executebindParams) and [Lob](#proplobpiecesize)`type` properties, for [`fetchAsString`](#propdbfetchasstring), and for [`fetchInfo`](#propfetchinfo). Not all constants can be used in all places:
259
259
260
260
```
261
-
Oracledb.BLOB // Bind a BLOB to return a Node.js buffer
261
+
Oracledb.BLOB // Bind a BLOB to a Node.js Stream
262
262
263
-
Oracledb.BUFFER // Bind a RAW to return a Node.js Buffer
263
+
Oracledb.BUFFER // Bind a RAW to a Node.js Buffer
264
264
265
-
Oracledb.CLOB // Bind a CLOB to return a Node.js string
265
+
Oracledb.CLOB // Bind a CLOB to a Node.js Stream
266
266
267
267
Oracledb.CURSOR // Bind a REF CURSOR to a node-oracledb ResultSet class
`type` | The datatype to be bound. One of the [Oracledb Constants](#oracledbconstants)`STRING`, `NUMBER`, `DATE`, `CURSOR` or `BUFFER`.
1144
1144
`maxSize` | The maximum number of bytes that an OUT or IN OUT bind variable of type STRING or BUFFER can use. The default value is 200. The maximum limit is 32767.
1145
1145
1146
-
In case of BUFFER type, when using Oracle Database 12c, in the init.ora file
1147
-
if MAX_STRING_SIZE parameter has a value of STANDARD, then the maximum size of
1148
-
BUFFER type is 4000. If MAX_STRING_SIZE parameter has a value of EXTENDED then
1149
-
the maximum size of BUFFER type is 32767. In earlier versions of Oracle
1150
-
Database, the maximum size of BUFFER type is 4000.
1146
+
The maximum size of a `BUFFER` type is 2000 bytes, unless you are
1147
+
using Oracle Database 12c and the database initialization parameter
1148
+
`MAX_STRING_SIZE` has a value of `EXTENDED`. In this case the maximum
1149
+
size of a `BUFFER` is 32767.
1151
1150
1152
1151
With OUT binds, where the type cannot be inferred by node-oracledb
1153
1152
because there is no input data value, the type defaults to `STRING`
@@ -2902,8 +2901,9 @@ connection.execute("INSERT INTO countries VALUES (:country_id, :country_name)",
2902
2901
```
2903
2902
2904
2903
For IN binds the direction must be `BIND_IN`. The type can be
2905
-
`STRING`, `NUMBER`, `DATE` or `BUFFER`, matching the data. The type `CURSOR`
2906
-
cannot be used with IN binds.
2904
+
`STRING`, `NUMBER`, `DATE` matching the data. The type `BUFFER` can
2905
+
bind a Node.js Buffer to an Oracle Database `RAW` type. The type
2906
+
`CURSOR` cannot be used with IN binds.
2907
2907
2908
2908
### <a name="outbind"></a> 12.2 OUT and IN OUT Bind Parameters
2909
2909
@@ -2920,6 +2920,9 @@ For `BIND_INOUT` parameters, the `type` attribute should be `STRING`,
2920
2920
For `BIND_OUT` parameters the `type` attribute should be `STRING`,
2921
2921
`NUMBER`, `DATE`, `CURSOR`, `BLOB`, `CLOB` or `BUFFER`.
2922
2922
2923
+
The type `BUFFER` is used to bind an Oracle Database `RAW` to a
2924
+
Node.js Buffer.
2925
+
2923
2926
If `type` is not specified then `STRING` is assumed.
2924
2927
2925
2928
A `maxSize` should be set for `STRING` OUT or IN OUT binds. This is
@@ -2929,7 +2932,7 @@ output value does not fit in `maxSize` bytes, then an error such
2929
2932
too small* or *NJS-016: buffer is too small for OUT binds* occurs.
2930
2933
2931
2934
A default value of 200 bytes is used when `maxSize` is not provided
2932
-
for OUT binds of type `STRING`.
2935
+
for OUT binds of type `STRING` or `BUFFER`.
2933
2936
2934
2937
The `results` parameter of the `execute()` callback contains an
2935
2938
`outBinds` property that has the returned OUT and IN OUT binds as
0 commit comments