@@header

/*
*
*  Author     : Vishal Gupta
*  Purpose    : Display Client Process Details
*  Parameters : 1 - Client Process Number
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  -----------------------------------------
*  14-May-13  Vishal Gupta  Created
*/


VARIABLE INST_ID NUMBER;
VARIABLE SID NUMBER;
VARIABLE PROCESS VARCHAR2(20);

BEGIN
    :INST_ID := 0;
    :SID := 0;
    :PROCESS := '';
    -- Ignore JDBC Thin Client process number
    IF '&&1' <> '1234' THEN
       :PROCESS := '&&1';
    END IF;   
END;
/


UNDEFINE SID
UNDEFIN  INST_ID

COLUMN col1 new_value SID      NOPRINT
column col2 new_value INST_ID  NOPRINT

set term off
SELECT S.SID     COL1
     , S.INST_ID COL2
  FROM GV$SESSION S
 WHERE  s.process = :PROCESS
;
set term on

@@sid_details &&SID &&INST_ID

