Thursday, December 21, 2017

ORACLE - How get sessionid variable

Oracle sessionid identify user session - every user has own sessionid.
procedure delete_piece
is
  sID number;
begin
  sID := UserEnv( 'SESSIONID' );

  delete from piece
  where 
  sessionid = sID or 
  to_char( dat_net, 'YYYYMMDD' ) <> to_char( sysdate, 'YYYYMMDD' );

  commit;
end;

No comments:

Post a Comment