Insert multiple batch data.

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
Post Reply
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

I have an interesting situation here, I have several data that will need to be inserted into sequence in several tables. Until then it's easy, but instead of giving several inserts I thought of inserting everything from one time, to exemplify in mysql I can do like this:

Select all

 
insert into teste1(campo, campo2) values(5, 6), (4, 2) 
How would this situation be in Oracle? Giving multiple insert's one for each line would not be slow?
gokden
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 264
Joined: Sun, 19 Aug 2007 8:18 pm
Location: Ribeirão Preto - SP
Lucas de Souza

OCA Developer
Analista de sistemas

tp, you have how you create a table based on the information of another ..
this way

Select all

 Create table teste as select * from teste2
and if the values ??that you want to register are already in another table can insert thus

Select all

insert into table1  
select nome 
     , sobrenome 
     , telefone  
  from table2
These are the ways to facilitate an insert qui I know ..
more if your case does not forr this
I do not know ...

More I think it will take a little bit yes .. = D
Once I did a script Qui inserted almost 150 lines in a table ..
and it took a pouco, but I did not axei another choice
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Brother,

Give a search here in the Forum by: Bulk Collect and Forall .
You can move large numbers of records.
Maybe help tb.
Whatever, send it there.
pyro
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 323
Joined: Thu, 21 Sep 2006 10:21 am
Location: Barala - TT

I will give a researched by these terms.

What I believe is a problem is that they will be between 2 different banks so you can not use any more direct method like this:

Select all

 
insert into tabela select * from tabela2 
vlw.
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Unless you have dblink between the Brother banks.

Hence you could give a SELECT on a BD, inserting into another BD table.

But, this you could be analyzing along with the company's DBA, which will know how to explain it better.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 4 guests