CREATE OR REPLACE PROCEDURE GET_CALL(tran_id IN STRING,
callno IN NUMBER,
startarg IN NUMBER := 1,
argcnt IN NUMBER,
argsize IN NUMBER,
tran_db IN STRING := '') IS
v_types DBMS_DEFER_QUERY.TYPE_ARY;
v_vals DBMS_DEFER_QUERY.VAL_ARY;
indx NUMBER;
v_type_desc VARCHAR2(50);
BEGIN
DBMS_DEFER_QUERY.GET_CALL_ARGS(callno =>; callno,
startarg =>; startarg,
argcnt =>; argcnt,
argsize =>; argsize,
tran_db =>; tran_db,
tran_id =>; tran_id,
date_fmt =>; 'YYYY-MM-DD HH24:MI:SS',
types =>; v_types,
vals =>; v_vals);
FOR indx IN 1 .. argcnt LOOP
IF v_types(indx) = 1 THEN
v_type_desc := 'VARCHAR2';
END IF;
IF v_types(indx) = 2 THEN
v_type_desc := 'NUMBER';
END IF;
IF v_types(indx) = 12 THEN
v_type_desc := 'DATE';
END IF;
IF v_types(indx) = 23 THEN
v_type_desc := 'RAW';
END IF;
IF v_types(indx) = 96 THEN
v_type_desc := 'CHAR';
END IF;
IF v_types(indx) = 11 THEN
v_type_desc := 'ROWID';
END IF;
dbms_output.put_line('Arg ' || indx || ': Datatype ' ||
v_type_desc || '; Value: ' ||
v_vals(indx));
END LOOP;
END GET_CALL;