Eric
Eric

Reputation: 65

Import Excel Data without Inserting Into Table

I am having some difficulty locating how to import data into Oracle SQL Developer without inserting the data into a table.

It seems all functions that I come across require users to insert into tables.

Does anyone know if there is a way to go about doing this? I do not have the access to create temp tables nor insert into existing tables.

Thanks!

Upvotes: 0

Views: 1209

Answers (1)

MT0
MT0

Reputation: 168671

Use a sub-query factoring (WITH) clause:

WITH your_excel_data ( value ) AS (
  SELECT 1 FROM DUAL UNION ALL
  SELECT 2 FROM DUAL UNION ALL
  -- ...
  SELECT 9 FROM DUAL
)
SELECT *
FROM   a_table
WHERE  a_value IN ( SELECT value FROM your_excel_data );

You can even generate the SQL statement within the sub-query factoring clause from your excel table:

="SELECT "&A1&" FROM DUAL UNION ALL"

Just adapt that so it points a the correct column and then copy and paste.

Upvotes: 4

Related Questions