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

Home -> Community -> Usenet -> c.d.o.server -> Re: BIT_COMPLEMENT function giving errors..

Re: BIT_COMPLEMENT function giving errors..

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: Wed, 04 Jul 2007 06:54:29 -0700
Message-ID: <1183557269.882623.71310@r34g2000hsd.googlegroups.com>


On Jul 4, 7:12 am, Shishir <shishir..._at_gmail.com> wrote:
> hi friends,
>
> I am trying to migrate a t-sql code to pl/sql code using oracle
> migration workbench..
> i have modfied the code to include xml handling functions in pl/sql .
> On compiling i am getting the following errors. 'IsVisible' is a
> column in the LIBRARYTree and it is of type bit holiding only 0 0r
> 1..The errors are :
>
> Line # = 18 Column # = 4 Error Text = PL/SQL: SQL Statement ignored
> Line # = 19 Column # = 31 Error Text = PLS-00306: wrong number or
> types of arguments in call to 'BIT_COMPLEMENT'
> Line # = 19 Column # = 23 Error Text = PL/SQL: ORA-00904:
> "UTL_RAW"."BIT_COMPLEMENT": invalid identifier
>
> CREATE OR REPLACE PROCEDURE usp_LIBRARYHideUnhideTreeNodes
> (
> -- Add the parameters for the stored procedure here
> v_paramMyXml IN CLOB DEFAULT NULL
>
> )
> AS
> BEGIN
>
> --add the passed xml string to the table with the xmltype column
> INSERT INTO XMLTEST values
> (XMLTYPE(v_paramMyXml));
>
> UPDATE LIBRARYTree
> SET IsVisible = UTL_RAW.BIT_COMPLEMENT(IsVisible)
> WHERE NodeId IN ( select extractValue(data_xml,'HiddenNodes/Node/
> id' ) as nodefinder
> from XMLTEST);
>
> END;
>
> Any help in this regard will be appreciated??
>
> Thanks in advance.
>
> Shishir.

I do not work with XML and I have rarely used utl_raw but ehe utl_raw.bit_complement procedure requires a raw datatype variable be pased in and based on the error message Oracle is not seeing Isvisible as a raw datatype. You might be able to cast is to raw via utl_raw.cast_to_raw, but like I said XML is not my thing.

If you were not using XML I would suggest looking at the bitand function which works on numbers.

HTH -- Mark D Powell -- Received on Wed Jul 04 2007 - 08:54:29 CDT

Original text of this message

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