From 53c38183c27d8f6a6aeabccfd14d7602a4f87cac Mon Sep 17 00:00:00 2001 From: Gerald Venzl Date: Mon, 14 Jun 2021 12:23:50 -0700 Subject: [PATCH] Retire Exadata Express examples Signed-off-by: Gerald Venzl --- README.md | 1 - exadata-express/Example.js | 84 ------------------------- exadata-express/Example.php | 119 ------------------------------------ exadata-express/Example.py | 53 ---------------- exadata-express/Query.py | 37 ----------- 5 files changed, 294 deletions(-) delete mode 100644 exadata-express/Example.js delete mode 100644 exadata-express/Example.php delete mode 100644 exadata-express/Example.py delete mode 100644 exadata-express/Query.py diff --git a/README.md b/README.md index 568657d0..987d5a10 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ This repository stores a variety of examples demonstrating how to use the Oracle | ------------- | ------------- | | [db-sample-schemas](https://github.com/oracle/db-sample-schemas) | Git submodule of the Oracle Database Sample Schemas | | [dotnet](https://github.com/oracle/dotnet-db-samples) | .NET based examples | -| [exadata-express](./exadata-express) | Exadata Express examples | | [java](./java) | Java based examples | | [javascript](./javascript) | JavaScript based examples | | [machine-learning](./machine-learning) | Oracle Machine Learning examples | diff --git a/exadata-express/Example.js b/exadata-express/Example.js deleted file mode 100644 index a0951a9f..00000000 --- a/exadata-express/Example.js +++ /dev/null @@ -1,84 +0,0 @@ -/*---------------------------------------------------------------------- - -Example.js - -Demonstrate how to perform a database insert and query with Node.js in -Oracle Database Cloud services such as Exadata Express, Autonomous -Transaction Processing, Autonomous Data Warehouse, and others. - -Before running this script: - - Install Node.js and node-oracledb - - Install Oracle Instant Client - - Download and install the cloud service wallet - - Modify the getConnection() call below to use the credentials for your database. -See your cloud service's documentation for details. - -----------------------------------------------------------------------*/ - -var oracledb = require('oracledb'); - -async function run() { - let connection; - - try { - - let sql, binds, options, result; - - connection = await oracledb.getConnection( { - user : 'username', - password : 'password', - connectString : 'connect_string' - }); - - // Create a table - - await connection.execute( - `BEGIN - EXECUTE IMMEDIATE 'DROP TABLE mycloudtab'; - EXCEPTION - WHEN OTHERS THEN - IF SQLCODE NOT IN (-00942) THEN - RAISE; - END IF; - END;`); - - await connection.execute( - `CREATE TABLE mycloudtab (id NUMBER, data VARCHAR2(20))`); - - // Insert some data - - sql = `INSERT INTO mycloudtab VALUES (:1, :2)`; - binds = [ [101, "Alpha" ], [102, "Beta" ], [103, "Gamma" ] ]; - options = { - autoCommit: true, - bindDefs: [ - { type: oracledb.NUMBER }, - { type: oracledb.STRING, maxSize: 20 } - ] - }; - - await connection.executeMany(sql, binds, options); - - // Query the data - - sql = `SELECT * FROM mycloudtab`; - binds = {}; - options = {}; - - result = await connection.execute(sql, binds, options); - console.log(result.rows); - - } catch (err) { - console.error(err); - } finally { - if (connection) { - try { - await connection.close(); - } catch (err) { - console.error(err); - } - } - } -} - -run(); diff --git a/exadata-express/Example.php b/exadata-express/Example.php deleted file mode 100644 index 234ffe96..00000000 --- a/exadata-express/Example.php +++ /dev/null @@ -1,119 +0,0 @@ -\n"; - -// Print column headings - -$ncols = oci_num_fields($s); -echo "\n"; -for ($i = 1; $i <= $ncols; ++$i) { - $colname = oci_field_name($s, $i); - echo "".htmlspecialchars($colname,ENT_QUOTES|ENT_SUBSTITUTE)."\n"; -} -echo "\n"; - -// Print data - -while (($row = oci_fetch_array($s, OCI_ASSOC+OCI_RETURN_NULLS)) != false) { - echo "\n"; - foreach ($row as $item) { - echo ""; - echo $item !== null ? htmlspecialchars($item, ENT_QUOTES|ENT_SUBSTITUTE) : " "; - echo "\n"; - } - echo "\n"; -} -echo "\n"; - -?> diff --git a/exadata-express/Example.py b/exadata-express/Example.py deleted file mode 100644 index 2f258b7e..00000000 --- a/exadata-express/Example.py +++ /dev/null @@ -1,53 +0,0 @@ -#------------------------------------------------------------------------------ -# Example.py -# -# Demonstrate how to perform a database insert and query with Python -# in Oracle Database Cloud services such as Exadata Express, -# Autonomous Transaction Processing, Autonomous Data Warehouse, and -# others. -# -# Before running this script: -# - Install Python and the cx_Oracle interface -# - Install Oracle Instant Client -# - Download and install the cloud service wallet -# - Modify the connect() call below to use the credentials for your database. -# See your cloud service's documentation for details. -# -#------------------------------------------------------------------------------ - -from __future__ import print_function - -import cx_Oracle - -con = cx_Oracle.connect('username', 'password', 'connect_string') -cur = con.cursor() - -# Create a table - -cur.execute(""" -begin - execute immediate 'drop table mycloudtab'; - exception - when others then - if sqlcode not in (-00942) then - raise; - end if; -end; -"""); - -cur.execute('create table mycloudtab (id number, data varchar2(20))') - -# Insert some data - -rows = [ (1, "First" ), (2, "Second" ), - (3, "Third" ), (4, "Fourth" ), - (5, "Fifth" ), (6, "Sixth" ), - (7, "Seventh" ) ] - -cur.executemany("insert into mycloudtab(id, data) values (:1, :2)", rows) - -# Query the data - -cur.execute('select * from mycloudtab') -res = cur.fetchall() -print(res) diff --git a/exadata-express/Query.py b/exadata-express/Query.py deleted file mode 100644 index f446717b..00000000 --- a/exadata-express/Query.py +++ /dev/null @@ -1,37 +0,0 @@ -#------------------------------------------------------------------------------ -# Query.py -# -# Demonstrate how to perform a query of a database schema, configured with Oracle's sample HR Schema, in your Exadata Express -# Cloud Service. -# -# Before running this app: -# 1. From the Exadata Express Cloud Service Console, click on Develop, then click on Python. Follow displayed instructions to: -# - Install instant client. -# - Enable client access and download your Exadata Express Cloud Service credentials. -# - Install the Python Extension module (cx_Oracle) to enable access to your cloud service. -# 2. Create a schema using the Exadata Express Cloud Service Console. Remember the schema name and password for step 4. -# 3. Configure the schema with Oracle's Sample HR Schema. Scripts to configure this schema can be found on GitHub. -# See github.com/oracle/db-sample-schemas for scripts and instructions. -# 4. Modify cx_Oracle.connect to connect to the HR schema you created in step 2: -# - The first value is the name of your HR schema. -# - The second value is the password for your HR schema. -# - The third value is "dbaccess", which is defined in the wallet downloaded from the Exadata Express Cloud Service -#------------------------------------------------------------------------------ - -from __future__ import print_function - -import cx_Oracle - - -connection = cx_Oracle.connect('HR',password,'dbaccess') - -sql = """ -select * from employees where department_id = 90""" - - -print("Get all rows via iterator") -cursor = connection.cursor() -for result in cursor.execute(sql): - print(result) -print() -