Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

OUTPUT clause in INSERT/UPDATE/DELETE statements

$
0
0

Hello,

 

In HANA there something like OUTPUT clause in INSERT/UPDATE/DELETE statements similar of SQL SERVER?

 

Example into SQL SERVER:

 

create table t ( i int not null );
create table t_audit ( old_i int not null, new_i int null );
insert into t (i) values( 1 );
insert into t (i) values( 2 );

update t
   set i  = i + 1
output deleted.i, inserted.i into t_audit
 where i = 1;

delete from t
output deleted.i, NULL into t_audit
 where i = 2;

select * from t;
select * from t_audit;

drop table t, t_audit;

 

Thanks.



Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>