Need to convert MSSQL to MYSQL
Posted by:
Vivek Up
Date: July 23, 2015 04:18AM
Hi,
I want to convert MSSQL (FOR XML Path) command in MYSQL format.
Please help to resolve this issue.
declare @ScreenModel_XML xml;
select @ScreenModel_XML =
(
select (select
(select AutomationObjectID as 'AutomationId',
[object].ScreenModel_ID 'ScreenId',
ObjectID 'ControlId',
ObjectName 'ControlName',
LogicalName 'LogicalName',
ClassName 'ClassName',
ControlType,
Framework,
InnerText,
InnerHtml,
OuterHtml,
ObjectVisible,
Custom,
IsFrame,
CSSSelector,
FrameID,
PageID,
ObjectHierarchy,IFrameIndex,ControlIdentifier,DelayCondition
from AutomationObject [object]
join ScreenModel ScreenModel on ScreenModel.ScreenModel_ID = [object].ScreenModel_ID
where [object].ScreenModel_ID=2-- @ScreenModel_ID
FOR XML AUTO, ELEMENTS, type) for xml path('ScreenModel')) as xmldata)
select @ScreenModel_XML
In MSSQL I am having the OUTput in below format...
AutomationId ScreenId ControlId ControlName LogicalName ClassName ControlType Framework InnerText InnerHtml OuterHtml ObjectVisible Custom IsFrame CSSSelector FrameID PageID ObjectHierarchy IFrameIndex ControlIdentifier DelayCondition
4 2 3 Button Login Button false
XML Format:
<ScreenModel>
<object><AutomationId>4</AutomationId><ScreenId>2</ScreenId><ControlId>3</ControlId><ControlName>Button</ControlName><LogicalName>Login</LogicalName><ClassName /><ControlType>Button</ControlType><Framework /><InnerText /><InnerHtml /><OuterHtml /><ObjectVisible /><Custom /><IsFrame>false</IsFrame><CSSSelector /><FrameID /><PageID /><ObjectHierarchy /><IFrameIndex /><ControlIdentifier /><DelayCondition /></object>
</ScreenModel>
I need the above XML format in MYSQL
Thanks
Vivek Upadhyay