Skip to content

Commit b35151d

Browse files
committed
Do a pass over the doc for RAW
1 parent c1560fe commit b35151d

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

doc/api.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,14 @@ Oracledb.ARRAY // Fetch each row as array of column values
255255
Oracledb.OBJECT // Fetch each row as an object
256256
```
257257

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:
259259

260260
```
261-
Oracledb.BLOB // Bind a BLOB to return a Node.js buffer
261+
Oracledb.BLOB // Bind a BLOB to a Node.js Stream
262262
263-
Oracledb.BUFFER // Bind a RAW to return a Node.js Buffer
263+
Oracledb.BUFFER // Bind a RAW to a Node.js Buffer
264264
265-
Oracledb.CLOB // Bind a CLOB to return a Node.js string
265+
Oracledb.CLOB // Bind a CLOB to a Node.js Stream
266266
267267
Oracledb.CURSOR // Bind a REF CURSOR to a node-oracledb ResultSet class
268268
@@ -1143,11 +1143,10 @@ Bind Property | Description
11431143
`type` | The datatype to be bound. One of the [Oracledb Constants](#oracledbconstants) `STRING`, `NUMBER`, `DATE`, `CURSOR` or `BUFFER`.
11441144
`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.
11451145

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.
11511150

11521151
With OUT binds, where the type cannot be inferred by node-oracledb
11531152
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)",
29022901
```
29032902
29042903
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.
29072907
29082908
### <a name="outbind"></a> 12.2 OUT and IN OUT Bind Parameters
29092909
@@ -2920,6 +2920,9 @@ For `BIND_INOUT` parameters, the `type` attribute should be `STRING`,
29202920
For `BIND_OUT` parameters the `type` attribute should be `STRING`,
29212921
`NUMBER`, `DATE`, `CURSOR`, `BLOB`, `CLOB` or `BUFFER`.
29222922
2923+
The type `BUFFER` is used to bind an Oracle Database `RAW` to a
2924+
Node.js Buffer.
2925+
29232926
If `type` is not specified then `STRING` is assumed.
29242927
29252928
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
29292932
too small* or *NJS-016: buffer is too small for OUT binds* occurs.
29302933
29312934
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`.
29332936
29342937
The `results` parameter of the `execute()` callback contains an
29352938
`outBinds` property that has the returned OUT and IN OUT binds as

0 commit comments

Comments
 (0)