Loads the DuckDB excel extension and creates a table from an Excel file
using the read_xlsx() table function. The destination is fully qualified
as <database>.<schema>.<table>. Only the options you supply are forwarded
to read_xlsx() (e.g., sheet, header, all_varchar, ignore_errors,
range, stop_at_empty, empty_as_varchar).
See 'duckdb extension read_excel for more information
read_excel(
.con,
to_database_name,
to_schema_name,
to_table_name,
file_path,
header,
sheet,
all_varchar,
ignore_errors,
range,
stop_at_empty,
empty_as_varchar,
write_type
)Invisibly returns NULL.
Side effect: creates <database>.<schema>.<table> with the Excel data.
A valid DBI connection (DuckDB / MotherDuck).
Target database name (new or existing)
Target schema name (new or existing)
Target table name to create (new or existing)
Path to the Excel file (.xlsx)
Logical; if TRUE, first row is header
Character; sheet name to read (defaults to first sheet)
Logical; coerce all columns to VARCHAR
Logical; continue on cell/row errors
Character; Excel range like "A1" or "A1:C100"
Logical; stop at first completely empty row
Logical; treat empty columns as VARCHAR
Logical, will drop previous table and replace with new table
Other db-read:
read_csv()