Skip to content

Commit

Permalink
Merge pull request #2025 from EnterpriseDB/release/2021-11-09
Browse files Browse the repository at this point in the history
Release: 2021-11-09
  • Loading branch information
josh-heyer authored Nov 10, 2021
2 parents bea5468 + aeb48ca commit 34e4df6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
7 changes: 4 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ module.exports = {
pathPrefix: "/docs",
siteMetadata: {
title: "EDB Docs",
baseUrl: "https://enterprisedb.com/docs",
imageUrl: "https://enterprisedb.com/docs/images/social.jpg",
siteUrl: "https://enterprisedb.com/docs",
baseUrl: "https://www.enterprisedb.com/docs",
imageUrl: "https://www.enterprisedb.com/docs/images/social.jpg",
siteUrl: "https://www.enterprisedb.com/docs",
algoliaIndex: algoliaIndex,
isDevelopment: !isBuild,
cacheBuster: 2, // for busting gh actions cache if needed
Expand All @@ -160,6 +160,7 @@ module.exports = {
options: {
headers: {
"/*": isProduction ? [] : ["X-Robots-Tag: noindex"],
"/static/*.pdf": ["X-Robots-Tag: noindex"],
},
},
},
Expand Down
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:

Expand All @@ -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:

Expand Down Expand Up @@ -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, (
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion src/components/index-sub-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const IndexSubNav = () => (
<IndexSubLink url="https://support.enterprisedb.com/support/s/">
Knowledge Base
</IndexSubLink>
<IndexSubLink url="https://enterprisedb.com/contact">
<IndexSubLink url="https://www.enterprisedb.com/contact">
Contact Us
</IndexSubLink>
<IndexSubLink url="/community/contributing/">Have feedback?</IndexSubLink>
Expand Down
4 changes: 3 additions & 1 deletion src/components/side-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const SideNavigationFooter = () => (
<FooterItem url="https://support.enterprisedb.com/support/s/">
Knowledge Base
</FooterItem>
<FooterItem url="https://enterprisedb.com/contact">Contact Us</FooterItem>
<FooterItem url="https://www.enterprisedb.com/contact">
Contact Us
</FooterItem>
<FooterItem url="/community/contributing/">Have feedback?</FooterItem>
<DarkModeToggle className="mt-1" />
</ul>
Expand Down

0 comments on commit 34e4df6

Please sign in to comment.