Google+

Wednesday, September 8, 2010

Merge Statement Example in Orcale



merge [ hints ] into table-name-1 | view-name-1 [ alias-1 ]
using table-name-2 | view-name-2 | subquery [ alias-2 ]
on ( condition )
[ merge-update-clause ] [ merge-insert-clause ] [ error-logging-clause ];

 

 create table table_dest (
  id number primary key,
  txt varchar2(20)
);

insert into table_dest values (1,'one');
insert into table_dest values (3,'three');
insert into table_dest values (5,'five');

commit;

create table table_source (
  id number primary key,
  txt varchar2(20)
);

Monday, September 6, 2010

Modifying a Sequence

Modifying a Sequence

• You must be the owner or have the ALTER privilege for the sequence.

• Only future sequence numbers are affected.

• The sequence must be dropped and re-created to restart the sequence at a different number.

• Some validation is performed.

 
 
Note:-Please comment and reply me.