H
H
hasanshaih2020-04-19 15:54:35
Oracle
hasanshaih, 2020-04-19 15:54:35

How to enter several values ​​​​at once in a table?

There are 500 lines of hash sum files. How can they be brought to the oracle database with one select? Or how can they be imported into a table?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
idShura, 2020-04-21
@hasanshaih

one select

Can be done with Oracle INSERT ALL statement
INSERT ALL
    INTO table_name(col1) VALUES(val1)
    INTO table_name(col1) VALUES(val4)
    INTO table_name(col1) VALUES(val7)
SELECT * FROM dual;

A
alexalexes, 2020-04-19
@alexalexes

The most clumsy way to prepare a data file.
1. Open the file in Notepad++.
2. Ctrl+H (Replace).
3. Set the search mode to "Regular Expressions".
4. Find:
^
5. Replace (substitute your own table name):
insert into table\(name\) values ​​\('
6. Click "Replace All".
7. Find:
\r
8. Replace:
'\);
9. Click "Replace All".
As a result, you get 500 rows of inserts. Perform them in one transaction in any way possible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question