Convert Excel to Oracle
Drop your Excel file to get a Oracle script with CREATE TABLE and INSERT statements. Each column gets a type, and every fix is listed with its row and column.
4 rows converted, 10 fixes, none rejected
| Row | ||||||
|---|---|---|---|---|---|---|
| 5 | 00127 | Peña Muñoz | 01234 | 03/02/2024 | sí | 1.234,50 |
| 6 | 00128 | José Ángel | 09870 | 15/02/2024 | no | N/A |
| 7 | 00129 | Zoë Ortíz | 44100 | 29/02/2024 | sí | -12,00 |
| 8 | 00130 | Ñuño Castañeda | 06700 | 11/03/2024 | no | 980,75 |
-- Written by IntoSQL for Oracle.
SET DEFINE OFF
CREATE TABLE clientes_2024 (
no_cliente VARCHAR2(8 CHAR) NOT NULL,
nombre VARCHAR2(16 CHAR) NOT NULL,
c_p VARCHAR2(8 CHAR) NOT NULL,
alta DATE NOT NULL,
activo NUMBER(1) NOT NULL,
saldo NUMBER(6,2)
);
COMMENT ON COLUMN clientes_2024.no_cliente IS 'Nº Cliente';
COMMENT ON COLUMN clientes_2024.c_p IS 'C.P.';
INSERT ALL
INTO clientes_2024 (no_cliente, nombre, c_p, alta, activo, saldo) VALUES ('00127', 'Peña Muñoz', '01234', DATE '2024-02-03', 1, 1234.50)
INTO clientes_2024 (no_cliente, nombre, c_p, alta, activo, saldo) VALUES ('00128', 'José Ángel', '09870', DATE '2024-02-15', 0, NULL)
INTO clientes_2024 (no_cliente, nombre, c_p, alta, activo, saldo) VALUES ('00129', 'Zoë Ortíz', '44100', DATE '2024-02-29', 1, -12.00)
INTO clientes_2024 (no_cliente, nombre, c_p, alta, activo, saldo) VALUES ('00130', 'Ñuño Castañeda', '06700', DATE '2024-03-11', 0, 980.75)
SELECT 1 FROM DUAL;
COMMIT;
Fixes
- The header is on row 4; the rows above it were left out.
- Row 9 ("TOTAL") is a total, so it was left out.
- Column "Nº Cliente" is named no_cliente so Oracle reads it without quotes.
- Column "C.P." is named c_p so Oracle reads it without quotes.
- Leading zeros kept in "Nº Cliente": 00127 stays 00127, stored as text.
- Leading zeros kept in "C.P.": 01234 stays 01234, stored as text.
- 15/02/2024 proves the dates in "Alta" are day-first, so 03/02/2024 is read as 2024‑02‑03.
- "Activo" holds yes and no words (sí, no), stored as boolean.
- Numbers in "Saldo" use a decimal comma: 1.234,50 is read as 1234.50.
- N/A in "Saldo" read as empty (1 of 4 values).
Your file is converted on this computer and never uploaded.
Other samples:
From Excel to Oracle, column by column
The sample above, clientes_2024.xlsx, as IntoSQL writes it for Oracle: what each column holds in the file, the type it gets and how its first value lands in the script.
| In the file | First value | Column | Oracle type | In the script |
|---|---|---|---|---|
| Nº Cliente | 00127 | no_cliente | VARCHAR2(8 CHAR) | '00127' |
| Nombre | Peña Muñoz | nombre | VARCHAR2(16 CHAR) | 'Peña Muñoz' |
| C.P. | 01234 | c_p | VARCHAR2(8 CHAR) | '01234' |
| Alta | 03/02/2024 | alta | DATE | DATE '2024-02-03' |
| Activo | sí | activo | NUMBER(1) | 1 |
| Saldo | 1.234,50 | saldo | NUMBER(6,2) | 1234.50 |
Load the script into Oracle
The download is a plain .sql file. Run it with Oracle's own tools.
From a terminal
sqlplus user@//localhost/mydb @clientes_2024.oracle.sqlThe script turns off substitution variables (SET DEFINE OFF), so an ampersand in your data stays an ampersand.
From a database tool
In SQL Developer, open the script and choose Run Script (F5).
What to know about Excel files and Oracle
What IntoSQL reads in Excel files
- The header row is found even when titles or notes sit above it, and a totals row at the end is left out.
- Dates stored as Excel serial numbers become real dates, in both the 1900 and the 1904 date systems.
- Codes with leading zeros, like 00127, stay text. When a workbook has several sheets, you pick the sheet.
What to know about Oracle
- Yes and no values become NUMBER(1), holding 1 or 0, which every Oracle version accepts.
- Text is VARCHAR2 with a length in characters; over 4000 bytes it becomes CLOB. Oracle stores empty text as NULL.
- Rows are inserted with INSERT ALL, and long values are split so SQL*Plus accepts them.
How each kind of value is stored in Oracle
| Value | Oracle |
|---|---|
| Yes and no | NUMBER(1) |
| Whole numbers | NUMBER(10) |
| Large whole numbers | NUMBER(19) |
| Decimals | NUMBER(p,s) |
| Floating-point numbers | BINARY_DOUBLE |
| Dates | DATE |
| Times of day | INTERVAL DAY(0) TO SECOND |
| Dates with a time | TIMESTAMP |
| Dates with a time and offset | TIMESTAMP WITH TIME ZONE |
| Text | VARCHAR2(n CHAR)CLOB |
Questions about Excel to Oracle
Not answered here? Write to us from the contact page and a person replies. Contact page
How do I convert Excel to Oracle?
Drop your file on the converter at the top of this page. It finds the header, reads every value and writes the Oracle script, listing each fix it made. Download the script and run it with SQL*Plus.
Which sheet of the workbook is converted?
The first visible sheet. When a workbook has more than one, a Sheet option appears, so you can pick another.
Which Oracle types does it use?
Yes and no values become NUMBER(1), whole numbers NUMBER(10), decimals NUMBER(p,s), dates DATE, dates with a time TIMESTAMP and text VARCHAR2(n CHAR). Sizes come from the longest value in each column.
Does it keep leading zeros in Oracle?
Yes. A code such as 00127 stays text, so Oracle stores it as VARCHAR2(8 CHAR) and the script writes it as '00127'.
Can it load the data into Oracle without a script?
No. Download the script and run it with SQL*Plus. Loading without a script works for PostgreSQL, MySQL, MariaDB and SQLite, from the desktop app or the command line.
How big can the Excel file be?
In the browser, a workbook is read whole, so the limit is the memory the browser gives this page. The desktop app and the command line take workbooks of any size; on an Apple M4 laptop the command line converts a 117 MB workbook of a million rows in about a second.