Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: ** converting and displaying raw data

Re: ** converting and displaying raw data

From: Yavor Ivanov <Yavor_Ivanov_at_stemo.bg>
Date: Wed, 19 Oct 2005 09:21:22 +0300
Message-ID: <op.syvqlwxatjan04@theshire>

	You can spy on the java-based OEM console.
	It is quite hard work to get the results, you have to get _every_  
argument of _every_ call. Here's how OEM does it: declare

   atype integer;

   csform number;
   arg_no number;
   callno number;

   tid varchar2(22);
   outval varchar2(2000);
begin
   arg_no := 31;
   callno := '0';
   tid    := '9.13.61761';
   atype  := dbms_defer_query.get_arg_type(callno, arg_no, tid);
   csform := dbms_defer_query.get_arg_form(callno, arg_no, tid);
   if atype = 2 then
     outval := to_char(dbms_defer_query.get_number_arg(callno, arg_no,  
tid));

   elsif atype = 96 and csform = 1 then
     outval := dbms_defer_query.get_char_arg(callno, arg_no, tid);    elsif atype = 96 and csform = 2 then
     outval := translate(dbms_defer_query.get_nchar_arg(callno, arg_no, tid) using CHAR_CS);

   elsif atype = 1 and csform = 1 then
     outval := dbms_defer_query.get_varchar2_arg(callno, arg_no, tid);    elsif atype = 1 and csform = 2 then
     outval := translate(dbms_defer_query.get_nvarchar2_arg(callno, arg_no, tid) using CHAR_CS);

   elsif atype = 12 then
     outval := to_char(dbms_defer_query.get_date_arg(callno, arg_no, tid), 'DD-MON-YYYY HH24:MI:SS');
   elsif atype = 23 then
     outval := rawtohex(dbms_defer_query.get_raw_arg(callno, arg_no, tid));    elsif atype = 11 then
     outval := dbms_defer_query.get_rowid_arg(callno, arg_no, tid);    else

     outval := '-Binary 	Value-';
     -- RAISE NO_DATA_FOUND;

   end if;
   ? := outval;
end;

        Before this some querying is done to see what columns stays behind every arg_no. First it gets the table involved in this specific callno for this transaction:
SELECT argcount, schemaname, packagename, procname FROM defcall WHERE callno = '0' and deferred_tran_id = '8.9.47423';

        And this gives you which column hides behind every arg_no (POS): SELECT cname, ctype FROM dba_repcolumn WHERE sname = 'PROD' AND oname = 'PORCONTACTS' AND type IN

        ('TABLE', 'SNAPSHOT') AND ID IS NOT NULL ORDER BY POS;         I hope this helps you in your case.

	Rgds,
	Yavor

On Tue, 18 Oct 2005 20:33:58 +0300, A Joshi <ajoshi977_at_yahoo.com> wrote:

> Hi,
> I am looking for a way to convert and display data with datatype raw.
> I do find a rawtohex function but that is not very helpful. Specifically
> I am looking for a way to print the first argument for Advanaced
> replication entries got using DBMS_DEFER_QUERY. This is of type raw and
> has the columns updated. Thanks
>
>
> ---------------------------------
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Oct 19 2005 - 01:23:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US