COLUMN APPLY_NAME FORMAT A30
COLUMN STATE FORMAT A20
COLUMN TRANSACTION_ID FORMAT A20
COLUMN COMMITSCN FORMAT 999999999999999
COLUMN TOTAL_MSG_APPLIED FORMAT 999999999999


SELECT
   APPLY_NAME,
   STATE,
   --COMMITSCN,
   XIDUSN ||'.'|| XIDSLT ||'.'|| XIDSQN TRANSACTION_ID,
   TOTAL_MESSAGES_APPLIED TOTAL_MSG_APPLIED,
   APPLY_TIME,
   APPLIED_MESSAGE_CREATE_TIME,
   trunc(ELAPSED_APPLY_TIME/100/60/60) ELAP_APP_H,sid
FROM
   V$STREAMS_APPLY_SERVER
   WHERE APPLY_NAME LIKE '%'||UPPER('&1')||'%'
ORDER BY
   APPLY_NAME;
