@@ -36,6 +36,9 @@ limitations under the License.
36
36
- [ ` BIND_IN ` ] ( #oracledbconstantsbinddir ) , [ ` BIND_INOUT ` ] ( #oracledbconstantsbinddir ) , [ ` BIND_OUT ` ] ( #oracledbconstantsbinddir )
37
37
- 3.1.5 [ Privileged Connection Constants] ( #oracledbconstantsprivilege )
38
38
- [ ` SYSDBA ` ] ( #oracledbconstantsprivilege ) , [ ` SYSOPER ` ] ( #oracledbconstantsprivilege ) , [ ` SYSASM ` ] ( #oracledbconstantsprivilege ) , [ ` SYSBACKUP ` ] ( #oracledbconstantsprivilege ) , [ ` SYSDG ` ] ( #oracledbconstantsprivilege ) , [ ` SYSKM ` ] ( #oracledbconstantsprivilege ) , [ ` SYSRAC ` ] ( #oracledbconstantsprivilege )
39
+ - 3.1.6 [ SQL Statement Type Constants] ( #oracledbconstantsstmttype )
40
+ - [ ` STMT_TYPE_UNKNOWN ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_SELECT ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_UPDATE ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_DELETE ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_INSERT ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_CREATE ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_DROP ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_ALTER ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_BEGIN ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_DECLARE ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_CALL ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_EXPLAIN_PLAN ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_MERGE ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_ROLLBACK ` ] ( #oracledbconstantsstmttype ) , [ ` STMT_TYPE_COMMIT ` ] ( #oracledbconstantsstmttype )
41
+
39
42
- 3.2 [ Oracledb Properties] ( #oracledbproperties )
40
43
- 3.2.1 [ ` autoCommit ` ] ( #propdbisautocommit )
41
44
- 3.2.2 [ ` connectionClass ` ] ( #propdbconclass )
@@ -134,10 +137,11 @@ limitations under the License.
134
137
- 4.2.6.4.3 [ ` resultSet ` ] ( #execresultset )
135
138
- 4.2.6.4.4 [ ` rows ` ] ( #execrows )
136
139
- 4.2.6.4.5 [ ` rowsAffected ` ] ( #execrowsaffected )
137
- - 4.2.7 [ ` ping() ` ] ( #connectionping )
138
- - 4.2.8 [ ` queryStream() ` ] ( #querystream )
139
- - 4.2.9 [ ` release() ` ] ( #release )
140
- - 4.2.10 [ ` rollback() ` ] ( #rollback )
140
+ - 4.2.7 [ ` getStatementInfo() ` ] ( #getstmtinfo )
141
+ - 4.2.8 [ ` ping() ` ] ( #connectionping )
142
+ - 4.2.9 [ ` queryStream() ` ] ( #querystream )
143
+ - 4.2.10 [ ` release() ` ] ( #release )
144
+ - 4.2.11 [ ` rollback() ` ] ( #rollback )
141
145
5 . [ Lob Class] ( #lobclass )
142
146
- 5.1 [ Lob Properties] ( #lobproperties )
143
147
- 5.1.1 [ ` chunkSize ` ] ( #proplobchunksize )
@@ -558,6 +562,44 @@ oracledb.SYSKM // (524288) SYSKM privileges
558
562
oracledb.SYSRAC // (1048576) SYSRAC privileges
559
563
```
560
564
565
+ #### <a name =" oracledbconstantsstmttype " ></a > 3.1.6 SQL Statement Type Constants
566
+
567
+ Constants for [ ` connection.getStatementInfo() ` ] ( #getstmtinfo )
568
+ properties.
569
+
570
+
571
+ ```
572
+ oracledb.STMT_TYPE_UNKNOWN // (0) Unknown statement type
573
+
574
+ oracledb.STMT_TYPE_SELECT // (1) SELECT
575
+
576
+ oracledb.STMT_TYPE_UPDATE // (2) UPDATE
577
+
578
+ oracledb.STMT_TYPE_DELETE // (3) DELETE
579
+
580
+ oracledb.STMT_TYPE_INSERT // (4) INSERT
581
+
582
+ oracledb.STMT_TYPE_CREATE // (5) CREATE
583
+
584
+ oracledb.STMT_TYPE_DROP // (6) DROP
585
+
586
+ oracledb.STMT_TYPE_ALTER // (7) ALTER
587
+
588
+ oracledb.STMT_TYPE_BEGIN // (8) BEGIN
589
+
590
+ oracledb.STMT_TYPE_DECLARE // (9) DECLARE
591
+
592
+ oracledb.STMT_TYPE_CALL // (10) CALL
593
+
594
+ oracledb.STMT_TYPE_EXPLAIN_PLAN // (15) EXPLAIN PLAN
595
+
596
+ oracledb.STMT_TYPE_MERGE // (16) MERGE
597
+
598
+ oracledb.STMT_TYPE_ROLLBACK // (17) ROLLBACK
599
+
600
+ oracledb.STMT_TYPE_COMMIT // (21) COMMIT
601
+ ```
602
+
561
603
### <a name =" oracledbproperties " ></a > 3.2 Oracledb Properties
562
604
563
605
The properties of the * Oracledb* object are used for setting up
@@ -2164,7 +2206,7 @@ variables, and the number of rows affected by the execution of
2164
2206
2165
2207
Parameter | Description
2166
2208
----------|------------
2167
- [ ` String sql ` ] ( #executesqlparam ) | The SQL string that is executed. The SQL string may contain bind parameters.
2209
+ [ ` String sql ` ] ( #executesqlparam ) | The SQL statement that is executed. The statement may contain bind parameters.
2168
2210
[ ` Object bindParams ` ] ( #executebindParams ) | This function parameter is needed if there are bind parameters in the SQL statement.
2169
2211
[ ` Object options ` ] ( #executeoptions ) | This is an optional parameter to ` execute() ` that may be used to control statement execution.
2170
2212
[ ` function(Error error, [Object result]) ` ] ( #executecallback ) | Callback function with the execution results.
@@ -2469,7 +2511,69 @@ the number of rows affected, for example the number of rows
2469
2511
inserted. For non-DML statements such as queries, or if no rows are
2470
2512
affected, then ` rowsAffected ` will appear as undefined.
2471
2513
2472
- #### <a name =" connectionping " ></a > 4.2.7 ` connection.ping() `
2514
+ #### <a name =" getstmtinfo " ></a > 4.2.7 ` connection.getStatementInfo() `
2515
+
2516
+ ##### Prototype
2517
+
2518
+ Callback:
2519
+ ```
2520
+ getStatementInfo(String sql, function(Error error, [Object information]){});
2521
+ ```
2522
+ Promise:
2523
+ ```
2524
+ promise = getStatementInfo(String sql);
2525
+ ```
2526
+
2527
+ ##### Description
2528
+
2529
+ Parses a SQL statement and returns information about it. This is most
2530
+ useful for finding column names of queries, and for finding the names
2531
+ of bind variables used.
2532
+
2533
+ This method performs a round-trip to the database, so unnecessary
2534
+ calls should be avoided.
2535
+
2536
+ The information is provided by lower level APIs that have some
2537
+ limitations. Some uncommon statements will return the statement type
2538
+ as ` oracledb.STMT_TYPE_UNKNOWN ` . DDL statements are not parsed, so
2539
+ syntax errors in them will not be reported. The direction and types
2540
+ of bind variables cannot be determined.
2541
+
2542
+ This method was added in node-oracledb 2.2.
2543
+
2544
+ ##### Parameters
2545
+
2546
+ ```
2547
+ String sql
2548
+ ```
2549
+
2550
+ The SQL statement to parse.
2551
+
2552
+ ```
2553
+ function(Error error, [Object information])
2554
+ ```
2555
+
2556
+ The parameters of the callback function are:
2557
+
2558
+ Callback function parameter | Description
2559
+ ----------------------------|-------------
2560
+ * Error error* | If ` getStatementInfo() ` succeeds, ` error ` is NULL. If an error occurs, then ` error ` contains the [ error message] ( #errorobj ) .
2561
+ * Object information* | The ` information ` object, described below.
2562
+
2563
+ Depending on the statement type, the ` information ` object may contain:
2564
+
2565
+ - ` bindNames ` : an array of strings corresponding to the unique names
2566
+ of the bind variables used in the SQL statement.
2567
+
2568
+ - ` metaData ` : containing properties equivalent to those given by
2569
+ ` execute() ` [ extendedMetaData] ( #execmetadata ) . This property exists
2570
+ only for queries.
2571
+
2572
+ - ` statementType ` : an integer corresponding to one of the [ SQL
2573
+ Statement Type Constants] ( #oracledbconstantsstmttype ) .
2574
+
2575
+
2576
+ #### <a name =" connectionping " ></a > 4.2.8 ` connection.ping() `
2473
2577
2474
2578
##### Prototype
2475
2579
@@ -2490,7 +2594,7 @@ health checks. A ping only confirms that a single connection is
2490
2594
usable at the time of the ping.
2491
2595
2492
2596
Pinging doesn't replace error checking during statement execution,
2493
- since network or database failure may occur in the time between
2597
+ since network or database failure may occur in the interval between
2494
2598
` ping() ` and ` execute() ` calls.
2495
2599
2496
2600
Pinging requires a round-trip to the database so unnecessary ping
@@ -2513,7 +2617,7 @@ Callback function parameter | Description
2513
2617
----------------------------|-------------
2514
2618
* Error error* | If ` ping() ` succeeds, ` error ` is NULL. If an error occurs, then ` error ` contains the [ error message] ( #errorobj ) .
2515
2619
2516
- #### <a name =" querystream " ></a > 4.2.8 ` connection.queryStream() `
2620
+ #### <a name =" querystream " ></a > 4.2.9 ` connection.queryStream() `
2517
2621
2518
2622
##### Prototype
2519
2623
@@ -2552,11 +2656,11 @@ This method was added in node-oracledb 1.8.
2552
2656
2553
2657
See [ execute()] ( #execute ) .
2554
2658
2555
- #### <a name =" release " ></a > 4.2.9 ` connection.release() `
2659
+ #### <a name =" release " ></a > 4.2.10 ` connection.release() `
2556
2660
2557
2661
An alias for [ connection.close()] ( #connectionclose ) .
2558
2662
2559
- #### <a name =" rollback " ></a > 4.2.10 ` connection.rollback() `
2663
+ #### <a name =" rollback " ></a > 4.2.11 ` connection.rollback() `
2560
2664
2561
2665
##### Prototype
2562
2666
0 commit comments