insert

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
Post Reply
carlos12
Rank: Analista Pleno
Rank: Analista Pleno
Posts: 123
Joined: Wed, 24 Oct 2007 4:31 pm
Location: rio

I need to enter multiple values ??in a column type

Insert Into table (field) Values ??(here I have several numbers to insert)

What happens I put all like this

('numbers', 'numbers') and he returned Toot Many Large

How can I vessel this insert of various values ??in a column?
Dulima-SP
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 193
Joined: Thu, 24 Jan 2008 1:56 pm
Location: SP
Dulima

DBA Oracle Jr

Are you concatenated these values ?????


If you separate only by comma, it will give error!
carlos12
Rank: Analista Pleno
Rank: Analista Pleno
Posts: 123
Joined: Wed, 24 Oct 2007 4:31 pm
Location: rio

I would have to put them like this (123 || 124 || 567) Is that it?
carlos12
Rank: Analista Pleno
Rank: Analista Pleno
Posts: 123
Joined: Wed, 24 Oct 2007 4:31 pm
Location: rio

but then all the numbers were one side of the other and I need them to be one on each line
Dulima-SP
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 193
Joined: Thu, 24 Jan 2008 1:56 pm
Location: SP
Dulima

DBA Oracle Jr

I do not know ....

I do not know if it is possible ....
for what I understand you want to insert into a column several values ??.... Masi wants these Fields are in different columns ......

I find it impossible ....


What is the real purpose, maybe I can Help in another way !! 1
User avatar
TBou
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 136
Joined: Thu, 05 Aug 2004 9:33 am
Location: Campo Grande - MS
Thiago Bourscheidt
thiago.info@apoiorural.com.br
Analista de Sistemas

From what I am seeing you need to give several inserts one for each number that you want ...
For example you can insert all values ??in a vector hence to give a loop in the vector giving the insert in the table.
Now insert several records at one time I do not know.
unless these numbers you want to insert return from a SELECT
Ex:

Select all

 
INSERT INTO TABELA1 (CD_CODIGO) SELECT CD_NUMEROS FROM TABELA2 
In this case yes will insert the number of Records that return from SELECT.
galluzzo
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 5
Joined: Wed, 07 May 2008 4:30 pm
Location: Rio de Janeiro

There is the

Select all

INSERT INTO T1(a1,a2) SELECT a1, a2 FROM T2
command

and the select values ??must be required of the same type as the table you will enter. But this is the case you have this data on a table. What happened to me was having to insert 20000 records from a table in Excel.

Here is my solution:

I copied to a txt the values, I created a Java program to read the txt and the values ??of each line formed a simple insert , writing on another TXT. After this is just sending the generated script (the 20000 inserts), I used the toad to run the script, but you can use Sqlloader
http://www.orafaq.com/wiki/SQL*Loader_FAQ at that address explains how to use.
galluzzo
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 5
Joined: Wed, 07 May 2008 4:30 pm
Location: Rio de Janeiro

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests