Insert into multiple tables.

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

Poston Fri, 29 Dec 2006 9:51 am

People need to do an insert into multiple tables, rode the same as follows:
Code: Select all
insert into pessoa pe, login_web lw, e_mail em
(pe.pes_codigo, pe.pes_cpf_cgc, lw.pes_codigo, lw.acesso, lw.senha, em.pes_codigo, em.ema_email, pe.pes_ativo. pe.cod_pessoa_jur)
values(999, 999999999, 999, teste, teste, 999, teste@teste.com, t, 9)
when I try to run the following error occurs: unable to locate the keyword values.

I'vê looked but found nothing to help me.
pyro
Location: Barala - TT

Poston Fri, 29 Dec 2006 12:01 pm

First: * This is only allowed in ORACLE 9i banks up. (8 does not work).
* The email there have to be enclosed in single quotation marks * the syntax all wrong. See below:
Code: Select all
INSERT ALL
      INTO revenue_jan (person, revenue)
      VALUES (person, rev_jan)
      INTO revenue_feb (person, revenue)
      VALUES (person, rev_feb)
      INTO revenue_mar (person, revenue)
      VALUES (person, rev_mar)
      INTO revenue_apr (person, revenue)
      VALUES (person, rev_apr)
      INTO revenue_mai (person, revenue)
      VALUES (person, rev_mai)
      INTO revenue_jun (person, revenue)
      VALUES (person, rev_jun)
      INTO revenue_jul (person, revenue)
      VALUES (person, rev_jul)
      INTO revenue_aug (person, revenue)
      VALUES (person, rev_aug)
      INTO revenue_sep (person, revenue)
      VALUES (person, rev_sep)
      INTO revenue_oct (person, revenue)
      VALUES (person, rev_oct)
      INTO revenue_nov (person, revenue)
      VALUES (person, rev_nov)
      INTO revenue_dez (person, revenue)
      VALUES (person, rev_dez)
SELECT person,
       rev_jan,
       rev_feb,
       rev_mar,
       rev_apr,
       rev_mai,
       rev_jun,
       rev_jul,
       rev_aug,
       rev_sep,
       rev_oct,
       rev_nov,
       rev_dez
FROM revext;
see this [url = : http//www . com/services/. akadia ora_multitable_insert . html] LINK [/url] has several examples.
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered


  • See also
    Replies
    Views
    Last Post


Return to SQL

Who is online

Users browsing this forum: Google [Bot] and 5 guests