# 1521 - Oracle

## General

When using Python libraries, such as `cx_Oracle` and `SQLAlchemy`, the `;` at the end of a statement can cause an error.

```sql
sqlCopy codeSELECT * FROM sys.flags;
// (cx_Oracle.DatabaseError) ORA-00911: invalid character
```

## Usage

* **Oracle databases require a `FROM` clause with any `SELECT` statement**. They include a dummy table (`dual`) to use when static values or function data needs to be obtained.
* **Oracle databases create a schema for each user**, and each schema carries its own set of permissions.
* Most of the system tables include a `$` sign in their name.

{% tabs %}
{% tab title="Version" %}

```sql
SELECT * FROM v$version;
```

{% endtab %}

{% tab title="Current User" %}

```sql
SELECT user FROM dual;
```

{% endtab %}

{% tab title="Databases" %}

```sql
SELECT owner FROM all_tables GROUP BY owner;
```

{% endtab %}

{% tab title="Tables" %}

```sql
SELECT table_name FROM all_tables WHERE owner = 'SYS' ORDER BY table_name;
```

{% endtab %}

{% tab title="Columns" %}
{% code overflow="wrap" %}

```sql
SELECT column_name, data_type FROM all_tab_columns WHERE table_name = '<tableName>';
```

{% endcode %}
{% endtab %}
{% endtabs %}
