Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> multiple insert with distinct in select
Hi,
i have a problem that i can't solve.
Here my sql-script:
PROMPT
PROMPT Grafik einer Gruppe zuordnen
PROMPT
PROMPT Bitte geben Sie einen Grafiknamen an.
ACCEPT TAGNAME CHAR PROMPT 'GRAFIKNAME : '
PROMPT
PROMPT Bitte geben Sie die Gruppe an (OPERATOR / SUPERVISOR / ENGINEER).
ACCEPT GRPNAME CHAR PROMPT 'GRUPPE : '
insert into USERTABLE
(USERNAME, PASSWORD, ACCESSAUTHORITY, ACCESSKEYREQUIRED,
ENVNAME,RECORDTYPE, TYPENAME, ACCESSKEYREQD)
select distinct USERNAME, PASSWORD, ACCESSAUTHORITY, ACCESSKEYREQUIRED,
'VSB', 'g', '&TAGNAME', ACCESSKEYREQD from USERTABLE M1where M1.ACCESSAUTHORITY = '&GRPNAME' AND M1.ENVNAME = 'VSB';
The select without insort into will show the correct count of rows. The select without distinct keyword will insert for each Tableentry a new entry.
But the script is shown above only will show the result of the select. No new row will be inserted in the table.
Where is my mistake?
If you have any idea, please send me an e-mail to Wolfgang.Dedden_at_t-online.de
In hope for results
Wolfgang
Received on Thu Nov 12 1998 - 16:45:18 CST