Table -> Generate Statement -> MERGE
"MCALLISTER, MICHAEL CTR AETC AETC/A3IS" <[email protected]> Fri, 21 Dec 2012 14:40:50 -0600
| Newsgroups | gmane.comp.db.oracle.toad.free |
|---|---|
| Message-ID | <4DA48F51EE503444872CA8706603DE501FB52F5472@52VEJX-MV14-01.area52.afnoapps.usaf.mil> |
I'd like to suggest that along with being able to generate a basic insert, update and select statement for a table, it would be nice if TOAD could generate a basic merge statement as well. You could leave the USING portion of the merge statement blank, but still generate the update and insert clauses for me with all the columns of the table. As an example, consider the following table:-
CREATE TABLE EXAMPLE_TBL
(
COL1 VARCHAR2 (50),
COL2 VARCHAR2 (50)
);
Generate for me the following merge statement:-
MERGE INTO example_tbl d
USING (/* insert your merge source here */) s
ON (/* insert your merge condition here */)
WHEN MATCHED
THEN
UPDATE SET d.col1 = s.col1, d.col2 = s.col1
WHEN NOT MATCHED
THEN
INSERT (d.col1, d.col2)
VALUES (s.col1, s.col2);
Regards,
Mike McAllister
Principal Systems Engineer
Decypher
DSN: 487-3751
Commercial: (210) 652-3751
Cell: (512) 423-7447
Email: [email protected]
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/toad/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/toad/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/