1
1
# Node-oracledb Examples
2
2
3
- This directory contains [ node-oracledb 3.1 ] ( https://www.npmjs.com/package/oracledb ) examples.
3
+ This directory contains [ node-oracledb 4.0 ] ( https://www.npmjs.com/package/oracledb ) examples.
4
4
5
5
The node-oracledb add-on for Node.js powers high performance Oracle Database applications.
6
6
@@ -15,7 +15,7 @@ Slack](https://node-oracledb.slack.com/join/shared_invite/enQtNDU4Mjc2NzM5OTA2LT
15
15
16
16
To run the examples:
17
17
18
- - [ Install node-oracledb] ( https://oracle.github.io/node-oracledb/INSTALL.html ) .
18
+ - [ Install node-oracledb] ( https://oracle.github.io/node-oracledb/INSTALL.html#quickstart ) .
19
19
20
20
21
21
- Use ` demo.sql ` to create schema objects used by the samples. For
@@ -33,7 +33,7 @@ connection string:
33
33
module.exports = {
34
34
user: "hr",
35
35
password: process.env.NODE_ORACLEDB_PASSWORD,
36
- connectString:"localhost/orclpdb "
36
+ connectString:"localhost/orclpdb1 "
37
37
};
38
38
```
39
39
@@ -60,3 +60,77 @@ The demonstration objects can be dropped with `demodrop.sql`:
60
60
```
61
61
sqlplus hr/welcome@localhost/orclpdb @demodrop.sql
62
62
```
63
+
64
+ ## Example Overview
65
+
66
+ If this is your first time with node-oracledb, start with
67
+ [ ` example.js ` ] ( example.js ) .
68
+
69
+ File Name | Description
70
+ ----------------------------|----------------------------------------------------------------------------------
71
+ aqoptions.js | Oracle Advanced Queuing (AQ) example setting options and message attributes
72
+ aqmulti.js | Oracle Advanced Queuing (AQ) example passing multiple messages
73
+ aqobject.js | Oracle Advanced Queuing (AQ) example passing an Oracle Database object
74
+ aqraw.js | Basic Oracle Advanced Queuing (AQ) example passing text messages
75
+ blobhttp.js | Simple web app that streams an image
76
+ calltimeout.js | Shows how to cancel a SQL statement if it doesn't complete in a specified time
77
+ connect.js | Basic example for creating a standalone (non-pooled) connection
78
+ connectionpool.js | Basic example creating a pool of connections
79
+ cqn1.js | Basic Continuous Query Notification (CQN) example
80
+ cqn2.js | Continuous Query Notification with notification grouping
81
+ date.js | Show some DATE and TIMESTAMP behaviors
82
+ dbconfig.js | Common file used by examples for setting connection credentials
83
+ dbmsoutputgetline.js | Show fetching DBMS_OUTPUT by binding buffers
84
+ dbmsoutputpipe.js | Show fetching DBMS_OUTPUT by using a pipelined table
85
+ demo.sql | SQL script to create extra schema objects for the examples
86
+ demodrop.sql | SQL script to drop the extra schema objects for the examples
87
+ dmlrupd1.js | Example of DML RETURNING with a single row match
88
+ dmlrupd2.js | Example of DML RETURNING where multiple rows are matched
89
+ em_batcherrors.js | ` executeMany() ` example showing handling data errors
90
+ em_dmlreturn1.js | ` executeMany() ` example of DML RETURNING that returns single values
91
+ em_dmlreturn2.js | ` executeMany() ` example of DML RETURNING that returns multiple values
92
+ em_insert1.js | Array DML example using ` executeMany() ` with bind-by-name syntax
93
+ em_insert2.js | Array DML example using ` executeMany() ` with bind by position
94
+ em_plsql.js | ` executeMany() ` example calling PL/SQL multiple times with one call
95
+ em_rowcounts.js | ` executeMany() ` example showing how to find the number of rows affected by each input row
96
+ endtoend.js | Example showing setting tracing attributes
97
+ example.js | Basic example showing creating a table, inserting multiple rows, and querying rows
98
+ fetchinfo.js | Show how numbers and dates can be returned as strings using ` fetchAsString ` and ` fetchInfo `
99
+ impres.js | Shows PL/SQL 'Implict Results' returning multiple query results from PL/SQL code.
100
+ insert1.js | Basic example creating a table and inserting data. Shows DDL and DML
101
+ insert2.js | Basic example showing auto commit behavior
102
+ lobbinds.js | Demonstrates how to bind and query LOBs
103
+ lobinsert1.js | Shows inserting a file into a CLOB column
104
+ lobinsert2.js | Inserts text into a CLOB column using the RETURNING INTO method.
105
+ lobinserttemp.js | Writes data to a Temporary CLOB and then inserts it into the database
106
+ lobplsqltemp.js | Streams data into a Temporary CLOB and then passes it to PL/SQL
107
+ lobselect.js | Shows basic, non-streaming CLOB and BLOB queries
108
+ lobstream1.js | Shows how to stream LOBs to files
109
+ lobstream2.js | Shows using Stream data events to fetch a CLOB
110
+ metadata.js | Shows the metadata available after executing SELECT statements
111
+ plsqlarray.js | Examples of binding PL/SQL "INDEX BY" tables
112
+ plsqlfunc.js | How to call a PL/SQL function
113
+ plsqlproc.js | How to call a PL/SQL procedure
114
+ plsqlrecord.js | Shows binding of PL/SQL RECORDS
115
+ plsqlvarrayrecord.js | Shows binding a VARRAY of RECORD in PL/SQL
116
+ raw1.js | Shows using a Buffer to insert and select a RAW
117
+ refcursor.js | Shows using a ResultSet to fetch rows from a REF CURSOR
118
+ refcursortoquerystream.js | Converts a REF CURSOR returned from ` execute() ` to a query stream.
119
+ resultset1.js | Executes a query and uses a ResultSet to fetch rows with ` getRow() `
120
+ resultset2.js | Executes a query and uses a ResultSet to fetch batches of rows with ` getRows() `
121
+ resultsettoquerystream.js | Converts a ResultSet returned from ` execute() ` into a Readable Stream.
122
+ rowlimit.js | Shows ways to limit the number of records fetched by queries
123
+ select1.js | Executes a basic query without using a connection pool or ResultSet
124
+ select2.js | Executes queries to show array and object output formats
125
+ selectgeometry.js | Insert and query Oracle Spatial geometries
126
+ selectjson.js | Shows some JSON features of Oracle Database
127
+ selectjsonblob.js | Shows how to use a BLOB as a JSON column store
128
+ selectobject.js | Insert and query a named Oracle database object
129
+ selectstream.js | Executes a basic query using a Readable Stream
130
+ selectvarray.js | Shows inserting and selecting from a VARRAY column
131
+ sessionfixup.js | Shows a pooled connection callback to efficiently set session state
132
+ sessiontagging1.js | Simple pooled connection tagging for setting session state
133
+ sessiontagging2.js | More complex example of pooled connection tagging for setting session state
134
+ soda1.js | Basic Simple Oracle Document Access (SODA) example
135
+ version.js | Shows the node-oracledb version attributes
136
+ webappawait.js | A simple web application using a connection pool
0 commit comments