Convert a Google BigQuery schema to Oracle
Paste the CREATE TABLE statements from Google BigQuery and ERD Designer draws them as a diagram. Change the diagram's target database to Oracle and every column's datatype is converted. You review each change before it is applied, then generate the Oracle script.
What changes in the sample
Converted to Oracle 23ai, these columns of the sample above change type. Everything else keeps its type; names, keys, nullability and lists of allowed values are left as they are.
| Column | Google BigQuery | Oracle | Note |
|---|---|---|---|
customers.customer_id | INT64 | NUMBER | |
customers.email | STRING(255) | VARCHAR2(255) | |
customers.full_name | STRING(120) | VARCHAR2(120) | |
customers.notes | STRING | CLOB | |
customers.is_active | BOOL | BOOLEAN | |
customers.created_at | TIMESTAMP | TIMESTAMP | default: CURRENT_TIMESTAMP() → CURRENT_TIMESTAMP |
orders.order_id | INT64 | NUMBER | |
orders.customer_id | INT64 | NUMBER | |
orders.public_id | STRING(36) | VARCHAR2(36) | default: GENERATE_UUID() removed |
orders.status | STRING(10) | VARCHAR2(10) | |
orders.total | NUMERIC(12, 2) | NUMBER(12, 2) | |
orders.placed_at | DATETIME | TIMESTAMP | |
orders.receipt_pdf | BYTES | BLOB |
What you are asked
Where Oracle offers more than one fair answer, ERD Designer asks before it converts — once per kind of column, not once per column. For this page each question was answered with its first option:
True / false columns — answered BOOLEAN
BOOLEAN— native on Oracle 23ai and laterNUMBER(1)— 0/1 — the pre-23ai convention, held to those two values by a CHECKCHAR(1) Y/N— 'Y'/'N', held to those two values by a CHECKCHAR(1) T/F— 'T'/'F', held to those two values by a CHECKVARCHAR2(3)— 'Yes'/'No', held to those two values by a CHECKVARCHAR2(5)— 'True'/'False', held to those two values by a CHECK
What it tells you
Where a conversion loses something, ERD Designer says so rather than picking for you. These are the messages for the sample:
- orders.public_id: default GENERATE_UUID() does not apply to VARCHAR2 — removed; generate new keys with a sequence or identity.
- customers.email: Oracle stores an empty string as NULL, so this required column refuses an empty value. Store a placeholder, or allow NULL and treat it as empty.
- customers.full_name: Oracle stores an empty string as NULL, so this required column refuses an empty value. Store a placeholder, or allow NULL and treat it as empty.
- orders.public_id: Oracle stores an empty string as NULL, so this required column refuses an empty value. Store a placeholder, or allow NULL and treat it as empty.
- orders.status: Oracle stores an empty string as NULL, so this required column refuses an empty value. Store a placeholder, or allow NULL and treat it as empty.
- Oracle stores an empty string as NULL — an empty value in customers.notes reads back as NULL.
The Oracle script
This is what ERD Designer generates for the sample, for Oracle 23ai. Our test suite applies this conversion to a real Oracle server and then reads the database back to confirm it matches the diagram exactly.
-- Create table customers
CREATE TABLE "customers" (
"customer_id" NUMBER NOT NULL,
"email" VARCHAR2(255 CHAR) NOT NULL,
"full_name" VARCHAR2(120 CHAR) NOT NULL,
"notes" CLOB,
"is_active" BOOLEAN DEFAULT 'true' NOT NULL,
"created_at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
CONSTRAINT "customers_PK" PRIMARY KEY ("customer_id")
);
-- Create table orders
CREATE TABLE "orders" (
"order_id" NUMBER NOT NULL,
"customer_id" NUMBER NOT NULL,
"public_id" VARCHAR2(36 CHAR) NOT NULL,
"status" VARCHAR2(10 CHAR) DEFAULT 'new' NOT NULL,
"total" NUMBER(12,2) NOT NULL,
"placed_at" TIMESTAMP NOT NULL,
"receipt_pdf" BLOB,
CONSTRAINT "orders_PK" PRIMARY KEY ("order_id")
);
-- Add foreign key orders (customer_id) → customers (customer_id)
ALTER TABLE "orders" ADD CONSTRAINT "orders_FK1" FOREIGN KEY ("customer_id") REFERENCES "customers" ("customer_id");
How to convert your own schema
- Paste your Google BigQuery script above and press Open in ERD Designer. The diagram opens laid out and ready to edit.
- Click the diagram's name in the toolbar to open its properties, choose Oracle under Target Database / Version, and press Apply Changes.
- If Oracle offers more than one way to store a kind of column, choose one and press Continue.
- Read the list of retyped columns and any warnings, then press Apply Conversion. Save the diagram to keep it.
- Press Generate DDL (the database icon) to copy or download the Oracle script — or apply it to a database on your own network with the ERD Designer Agent.
What it reads, and what it does not
- It reads
CREATE TABLE,ALTER TABLE … ADD CONSTRAINTandCREATE INDEX: tables, columns, keys, foreign keys, unique constraints, check lists and indexes. Anything else in the script is skipped and listed. - It converts the schema, never the data: no rows are read, moved or changed.
- It does not convert views, stored procedures, functions, triggers or packages.
Which plan you need
Pasting a script and working with it as a diagram is free on the Basic plan, with no card. Converting a diagram to another database is part of the Pro and Advanced plans, which also generate its script and can apply it through the Agent.
Other conversions
- Google BigQuery to PostgreSQL
- Google BigQuery to SQL Server
- Google BigQuery to MySQL
- Google BigQuery to MariaDB
- Google BigQuery to SQLite
- Google BigQuery to Amazon Redshift
- Google BigQuery to Snowflake
- PostgreSQL to Oracle
- SQL Server to Oracle
- MySQL to Oracle
- MariaDB to Oracle
- SQLite to Oracle
- Amazon Redshift to Oracle
- Snowflake to Oracle
Questions? Write to support@erddesigner.com. · ERD Designer · Terms · Privacy