node-oracledb/examples
Christopher Jones a921be1bdf queryStream and toQueryStream are sync. Refactor tests. 2021-04-08 11:25:11 +10:00
..
README.md Cross-ref to the doc. Explicitly list the pw step 2021-02-16 15:57:46 +11:00
aqmulti.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
aqobject.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
aqoptions.js Update doc links 2019-07-24 17:32:30 +10:00
aqraw.js Update doc links 2019-07-24 17:32:30 +10:00
blobhttp.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
calltimeout.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
clobexample.txt Move more links to http://oracle.github.io/node-oracledb/ 2018-03-27 16:12:28 +11:00
connect.js Update examples for async/await and other changes 2019-07-24 17:32:24 +10:00
connectionpool.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
cqn1.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
cqn2.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
date.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
dbconfig.js Update default connect string to match Oracle 19 PDB service name 2019-07-24 17:32:31 +10:00
dbmsoutputgetline.js Update examples for async/await and other changes 2019-07-24 17:32:24 +10:00
dbmsoutputpipe.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
demodrop.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
demosetup.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
dmlrupd1.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
dmlrupd2.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
em_batcherrors.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
em_dmlreturn1.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
em_dmlreturn2.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
em_insert1.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
em_insert2.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
em_plsql.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
em_rowcounts.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
endtoend.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
example.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
fetchinfo.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
fuzzydinosaur.jpg Update examples for node-oracledb 1.0 2015-08-17 16:03:41 +10:00
impres.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
insert1.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
insert2.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
lobbinds.js Update examples to show better use of stream destroy() 2020-03-21 08:13:36 +11:00
lobinsert1.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
lobinsert2.js Update examples to show better use of stream destroy() 2020-03-21 08:13:36 +11:00
lobinserttemp.js Update examples to show better use of stream destroy() 2020-03-21 08:13:36 +11:00
lobplsqltemp.js Update examples to show better use of stream destroy() 2020-03-21 08:13:36 +11:00
lobselect.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
lobstream1.js Update examples to show better use of stream destroy() 2020-03-21 08:13:36 +11:00
lobstream2.js Update examples to show better use of stream destroy() 2020-03-21 08:13:36 +11:00
metadata.js Add metadata for non-ResultSet nested cursors 2020-02-29 09:34:53 +11:00
plsqlarray.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
plsqlfunc.js Update example PL/SQL function to use an OUT param 2020-07-30 15:56:48 +10:00
plsqlproc.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
plsqlrecord.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
plsqlvarrayrecord.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
raw.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
refcursor.js Let getRows() return all rows in one call 2021-02-10 18:43:29 +11:00
refcursortoquerystream.js Update examples to show better use of stream destroy() 2020-03-21 08:13:36 +11:00
resultset1.js Add row prefetching and cursor IN binding 2020-06-13 08:16:36 +10:00
resultset2.js Rework schema setup in example scripts 2019-11-22 10:54:28 +11:00
resultsettoquerystream.js Update examples to show better use of stream destroy() 2020-03-21 08:13:36 +11:00
rowlimit.js Add row prefetching and cursor IN binding 2020-06-13 08:16:36 +10:00
select1.js Add row prefetching and cursor IN binding 2020-06-13 08:16:36 +10:00
select2.js Add row prefetching and cursor IN binding 2020-06-13 08:16:36 +10:00
selectgeometry.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
selectjson.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
selectjsonblob.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
selectnestedcursor.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
selectobject.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
selectstream.js queryStream and toQueryStream are sync. Refactor tests. 2021-04-08 11:25:11 +10:00
selectvarray.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
sessionfixup.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
sessiontagging1.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
sessiontagging2.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00
soda1.js Use explicit SODA metadata for maximum version interoperability in example 2021-03-08 18:46:59 +11:00
version.js Update examples for async/await and other changes 2019-07-24 17:32:24 +10:00
webapp.js Enforce stricter JS coding style rules 2021-04-01 15:48:37 +11:00

README.md

Node-oracledb Examples

This directory contains node-oracledb examples. Documentation is here .

To run the examples:

  • Install node-oracledb.

  • Edit dbconfig.js and set your username and the database connection string, for example:

    module.exports = {
        user: "hr",
        password: process.env.NODE_ORACLEDB_PASSWORD,
        connectString:"localhost/orclpdb1"
    };
    
    
  • In a terminal window, set the environment variable NODE_ORACLEDB_PASSWORD to the value of your database password.

  • Review the samples and then run them like:

    node example.js
    
  • After running example, the demonstration objects can be dropped with demodrop.js:

    node demodrop.js
    

Example Overview

If this is your first time with node-oracledb, start with example.js.

File Name Description
aqmulti.js Oracle Advanced Queuing (AQ) example passing multiple messages
aqobject.js Oracle Advanced Queuing (AQ) example passing an Oracle Database object
aqoptions.js Oracle Advanced Queuing (AQ) example setting options and message attributes
aqraw.js Basic Oracle Advanced Queuing (AQ) example passing text messages
blobhttp.js Simple web app that streams an image
calltimeout.js Shows how to cancel a SQL statement if it doesn't complete in a specified time
connect.js Basic example for creating a standalone (non-pooled) connection
connectionpool.js Basic example creating a pool of connections
cqn1.js Basic Continuous Query Notification (CQN) example
cqn2.js Continuous Query Notification with notification grouping
date.js Show some DATE and TIMESTAMP behaviors
dbconfig.js Common file used by examples for setting connection credentials
dbmsoutputgetline.js Show fetching DBMS_OUTPUT by binding buffers
dbmsoutputpipe.js Show fetching DBMS_OUTPUT by using a pipelined table
demodrop.js Drops the schema objects created by the examples
demosetup.js Used to create common schema objects for the examples
dmlrupd1.js Example of DML RETURNING with a single row match
dmlrupd2.js Example of DML RETURNING where multiple rows are matched
em_batcherrors.js executeMany() example showing handling data errors
em_dmlreturn1.js executeMany() example of DML RETURNING that returns single values
em_dmlreturn2.js executeMany() example of DML RETURNING that returns multiple values
em_insert1.js Array DML example using executeMany() with bind-by-name syntax
em_insert2.js Array DML example using executeMany() with bind by position
em_plsql.js executeMany() example calling PL/SQL multiple times with one call
em_rowcounts.js executeMany() example showing how to find the number of rows affected by each input row
endtoend.js Example showing setting tracing attributes
example.js Basic example showing creating a table, inserting multiple rows, and querying rows
fetchinfo.js Show how numbers and dates can be returned as strings using fetchAsString and fetchInfo
impres.js Shows PL/SQL 'Implict Results' returning multiple query results from PL/SQL code.
insert1.js Basic example creating a table and inserting data. Shows DDL and DML
insert2.js Basic example showing auto commit behavior
lobbinds.js Demonstrates how to bind and query LOBs
lobinsert1.js Shows inserting a file into a CLOB column
lobinsert2.js Inserts text into a CLOB column using the RETURNING INTO method.
lobinserttemp.js Writes data to a Temporary CLOB and then inserts it into the database
lobplsqltemp.js Streams data into a Temporary CLOB and then passes it to PL/SQL
lobselect.js Shows basic, non-streaming CLOB and BLOB queries
lobstream1.js Shows how to stream LOBs to files
lobstream2.js Shows using Stream data events to fetch a CLOB
metadata.js Shows the metadata available after executing SELECT statements
plsqlarray.js Examples of binding PL/SQL "INDEX BY" tables
plsqlfunc.js How to call a PL/SQL function
plsqlproc.js How to call a PL/SQL procedure
plsqlrecord.js Shows binding of PL/SQL RECORDS
plsqlvarrayrecord.js Shows binding a VARRAY of RECORD in PL/SQL
raw.js Shows using a Buffer to insert and select a RAW
refcursor.js Shows using a ResultSet to fetch rows from a REF CURSOR
refcursortoquerystream.js Converts a REF CURSOR returned from execute() to a query stream.
resultset1.js Executes a query and uses a ResultSet to fetch rows with getRow()
resultset2.js Executes a query and uses a ResultSet to fetch batches of rows with getRows()
resultsettoquerystream.js Converts a ResultSet returned from execute() into a Readable Stream.
rowlimit.js Shows ways to limit the number of records fetched by queries
select1.js Executes a basic query without using a connection pool or ResultSet
select2.js Executes queries to show array and object output formats
selectgeometry.js Insert and query Oracle Spatial geometries
selectjson.js Shows some JSON features of Oracle Database 21c
selectjsonblob.js Shows how to use a BLOB as a JSON column store
selectobject.js Insert and query a named Oracle database object
selectnestedcursor.js Shows selecting from a nested cursor
selectstream.js Executes a basic query using a Readable Stream
selectvarray.js Shows inserting and selecting from a VARRAY column
sessionfixup.js Shows a pooled connection callback to efficiently set session state
sessiontagging1.js Simple pooled connection tagging for setting session state
sessiontagging2.js More complex example of pooled connection tagging for setting session state
soda1.js Basic Simple Oracle Document Access (SODA) example
version.js Shows the node-oracledb version attributes
webapp.js A simple web application using a connection pool