doubt a insert

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Fri, 28 Mar 2008 11:11 am

guys I need insert multiple values in one column type insert into table (field) values (here I have several numbers to enter) then what happens I put all that (' numbers ', ' numbers ') and he returned toot many large how can I make this insert multiple values in a column?
carlos12
Location: rio

Poston Fri, 28 Mar 2008 11:14 am

você this Concatenated this Values??


If you separate comma only, will give same error!!!
Dulima-SP
Location: SP

Dulima

DBA Oracle Jr

Poston Fri, 28 Mar 2008 11:17 am

I'd have to put them (123 ||124 ||567) is that?
carlos12
Location: rio

Poston Fri, 28 Mar 2008 11:19 am

but then all the numbers were next to each other and I need them to be one in each row
carlos12
Location: rio

Poston Fri, 28 Mar 2008 11:54 am

I don't know ... I don't know if it is possible .... from what I understand you want to insert into a column multiple values .... masi wants these fields stay in different columns. ...

I think impossible.--What is the real purpose, maybe can help you otherwise!1
Dulima-SP
Location: SP

Dulima

DBA Oracle Jr

Poston Sat, 29 Mar 2008 10:54 am

from what I can see that you need to take several inserts one for each number you want ... for example you can insert all the values in a vector to vector loop in dai giving the insert in the table.
now insert several records at once I am unaware of.
unless these numbers that you want to insert return of a select EX:
Code: Select all
INSERT INTO TABELA1 (CD_CODIGO) SELECT CD_NUMEROS FROM TABELA2
in this case Yes will insert into Table1 the number of records to return from select statements.
TBou
Location: Campo Grande - MS

Thiago Bourscheidt
thiago.info@apoiorural.com.br
Analista de Sistemas

Poston Wed, 07 May 2008 5:32 pm

There is the command INSERT INTO T1 (a1, a2) SELECT a1, a2 FROM T2 as SELECT values must be of the same type of table that you will enter. But this is the case you have these data in a table. What happened to me was having to enter 20000 records from a table in excel.

Here's my solution: I copied to a txt values, created a program in JAVA to read the txt and the values of each row formed a simple INSERT, writing in another txt. After that just send run the generated script (20000 INSERTS), I used TOAD to run the script, but you can use SQLLOADER-http://www.orafaq.com/wiki/SQL * Loader_FAQ-this address explains how to use.
galluzzo
Location: Rio de Janeiro

Poston Wed, 07 May 2008 5:46 pm

galluzzo
Location: Rio de Janeiro


  • See also
    Replies
    Views
    Last Post


    Return to SQL

    Who is online

    Users browsing this forum: No registered users and 4 guests