Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CursortoXml

Status
Not open for further replies.

FoxWing

Programmer
Dec 20, 2004
44
GB
Hi,

As i'm developing my COM Server, i have a function that needs to return a result in XML format. I don't need the physical XML file anyway.

But, I have no knowledge of accomplished this. All i got was i managed to output the result to an XML phisical file.

My codes :

SELECT us_userid dob as DataOfBirth FROM us_user INTO cursor tmpUs_user

CURSORTOXML("uv_Val", "c:\uv_val.xml", 1, 512, 0, "1")

RETURN ??? <-----how to return from here ?


Please help.
 
To get your XML into a variable, use something like the following...
Code:
Local lcReturn

SELECT us_userid dob as DataOfBirth FROM us_user INTO cursor tmpUs_user

CURSORTOXML("tmpUs_user","lcReturn",1,48,5,"","","")

Return lcReturn
However, if you still need the physical file and want to return your resulting XML as a string as well, consider using FILETOSTR()...

Code:
Local lcXMLFileName
lcXMLFileName = "c:\uv_val.xml"
SELECT us_userid dob as DataOfBirth FROM us_user INTO cursor tmpUs_user

CURSORTOXML("uv_Val", lcXMLFileName, 1, 512, 0, "1")

RETURN FILETOSTR(lcXMLFileName)

boyd.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top