Monday, March 12, 2012

Oracle To SQL

I have an oracle procedure that needs to be converted to ms-sql.

lXMLContext := DBMS_XMLQuery.newContext("select * from table");
-- Setup parameters on how XML is to be constructed.
DBMS_XMLQuery.useNullAttributeIndicator(lXMLContex t,FALSE);
DBMS_XMLQuery.setRaiseNoRowsException(lXMLContext, FALSE);
DBMS_XMLQuery.setRaiseException(lXMLContext,TRUE);
DBMS_XMLQuery.propagateOriginalException(lXMLConte xt,TRUE);
DBMS_XMLQuery.setRowTag(lXMLContext,lWS.wsXMLRecor d.wsViewName);
DBMS_XMLQuery.setDateFormat(lXMLContext,lDateMask) ;

Any one can help in constructing a similar pattern in ms-SQL or atleast tell me what is all these doing?

I am coding this using extended stored procedure in c#.

Thanks,
Venkat.Go thru the below link and see if u get any help...

http://www.experts-exchange.com/Databases/Oracle/Q_21185214.html

Here what i could understand is..

It created the object 'lXMLContext' & set the parameters for this object for creating XML... U just need to concentrate on the last 2 only here I think so 'setRowTag' & 'setDateFormat'... the first 2 is set as 'FALSE' so u need not have to bother... the 3rd & 4th I feel its some sort of exception feature in ORACLE... to intimate the user that an error has occured while creating the XML...

:D Sorry if u could already understand this much and was asking asking for anything more....

lXMLContext := DBMS_XMLQuery.newContext("select * from table");

-- Setup parameters on how XML is to be constructed.

DBMS_XMLQuery.useNullAttributeIndicator(lXMLContex t,FALSE);
DBMS_XMLQuery.setRaiseNoRowsException(lXMLContext, FALSE);
DBMS_XMLQuery.setRaiseException(lXMLContext,TRUE);
DBMS_XMLQuery.propagateOriginalException(lXMLConte xt,TRUE);
DBMS_XMLQuery.setRowTag(lXMLContext,lWS.wsXMLRecor d.wsViewName);
DBMS_XMLQuery.setDateFormat(lXMLContext,lDateMask) ;

No comments:

Post a Comment