-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2025 from EnterpriseDB/release/2021-11-09
Release: 2021-11-09
- Loading branch information
Showing
4 changed files
with
32 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
--- | ||
title: "Demonstration of Oracle compatible functions and syntax" | ||
navTitle: "Demo: Oracle compatibility" | ||
title: "Demonstration of Oracle SQL compatible functions and syntax" | ||
navTitle: "Demo: Oracle SQL compatibility" | ||
--- | ||
<figure class="float-right ml-1 mb-1"> | ||
<iframe width="360" height="202" src="https://www.youtube.com/embed/lV4QQ53kgew" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | ||
<figcaption class="text-center font-italic">Video recording of this demonstration</figcaption> | ||
</figure> | ||
|
||
[EDB Postgres Advanced Server's Oracle compatible syntax and supporting packages](https://www.enterprisedb.com/docs/epas/latest/epas_compat_ora_dev_guide/) are available in BigAnimal. If you'd like to see them in action, there's a test cluster available, populated with the [Chinook sample database](https://github.com/lerocha/chinook-database): feel free to connect and try out a few queries! This topic presents a couple to get you started... | ||
BigAnimal lets you run Oracle SQL queries in the cloud via [EDB Postgres Advanced Server](https://www.enterprisedb.com/docs/epas/latest/epas_compat_ora_dev_guide/). This topic demonstrates two Oracle SQL-syntax queries running unmodified on a BigAnimal test cluster, populated with the [Chinook sample database](https://github.com/lerocha/chinook-database). | ||
|
||
Watch the video, or load up psql and follow along below! | ||
|
||
<figure class="embed-responsive embed-responsive-16by9"> | ||
<iframe src="https://www.youtube.com/embed/lV4QQ53kgew" | ||
title="Video recording of this demonstration" | ||
class="embed-responsive-item" | ||
frameborder="0" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | ||
</figure> | ||
|
||
## Connecting to the demo cluster with psql | ||
|
||
You can use any recent version of psql to connect to EDB Postgres Advanced Server. If you choose to use the version that ships with Advanced Server, you'll get a few nice SQL\*Plus compatibility features (with more availability in [EDB\*Plus](https://www.enterprisedb.com/docs/epas/latest/edb_plus/)). The queries and commands that we'll examine here will work the same in either version of psql. For convenience, these examples use the version of psql available in Azure's Cloud Shell; you can launch this directly from the Azure portal, or on your desktop using Windows Terminal: | ||
|
||
|
@@ -24,7 +31,8 @@ $ | |
The connection string for the demo Advanced Server cluster looks like this: | ||
|
||
``` | ||
postgres://demo:[email protected]:5432/chinook?sslmode=require``` | ||
postgres://demo:[email protected]:5432/chinook?sslmode=require | ||
``` | ||
|
||
In case you're unfamiliar with [PostgreSQL connection URIs](https://www.postgresql.org/docs/current/libpq-connect.html#id-1.7.3.8.3.6), let's break that down: | ||
|
||
|
@@ -104,14 +112,14 @@ __OUTPUT__ | |
... | ||
``` | ||
|
||
This table has a "reportsto" field - that means this is a heirarchical reporting structure, with some employees reporting to | ||
This table has a "reportsto" field - that means this is a hierarchical reporting structure, with some employees reporting to | ||
other employees who may in turn report to still *other* employees. | ||
|
||
## Demo #1: exposing an organization heirarchy with `CONNECT BY` | ||
## Demo #1: exposing an organization hierarchy with `CONNECT BY` | ||
|
||
Let's construct a [heirarchical query](https://www.enterprisedb.com/docs/epas/latest/epas_compat_ora_dev_guide/03_advanced_concepts/05_hierarchical_queries/) to expose this [chain of command](https://en.wikipedia.org/wiki/Chain_of_command). | ||
Let's construct a [hierarchical query](https://www.enterprisedb.com/docs/epas/latest/epas_compat_ora_dev_guide/03_advanced_concepts/05_hierarchical_queries/) to expose this [chain of command](https://en.wikipedia.org/wiki/Chain_of_command). | ||
|
||
Modern SQL would use a recursive CTE for this, as those are widely supported. But Oracle has, for decades, supported an alternative mechanism for querying heirarchy in the form of `CONNECT BY` - let's put that into action: | ||
Modern SQL would use a recursive CTE for this, as those are widely supported. But Oracle has, for decades, supported an alternative mechanism for querying hierarchy in the form of `CONNECT BY` - let's put that into action: | ||
|
||
```sql | ||
SELECT firstname, lastname, ( | ||
|
@@ -227,5 +235,8 @@ In both of the examples shown here, you probably would not use the functions and | |
better, more familiar or at least more widely-available equivalents provided natively by PostgreSQL (and many other databases). But by supporting them, EDB Advanced Server gives you the ability to reuse existing logic with minimal modification, allowing | ||
you to focus your time and expertise on solving new problems. | ||
|
||
For more information on Oracle compatibility features in EDB Postgres Advanced Server, refer to the [EDB Advanced Server documentation](https://www.enterprisedb.com/docs/epas/latest/). | ||
### Next steps | ||
|
||
- Read more on Oracle compatibility features in EDB Postgres Advanced Server: [EDB Advanced Server documentation](https://www.enterprisedb.com/docs/epas/latest/). | ||
|
||
- Learn about [migrating existing Oracle databases to BigAnimal](/biganimal/latest/migration/#migrating-from-oracle) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters