FOR XML results in StoredProc
FOR XML results in StoredProc
Using the MSStoredProc component I find that if I call a stored procedure which returns a FOR XML AUTO result, the xml type returned is in native binary format (not MS-BINXML) and I can see the blob data (MSStoredProc.fields.fields[0]) containing the xml type. What I really need is (obviously) just the xml as a (wide)string. I cannot find any examples or anything showing how to do this. Anyone have any suggestions or examples or know what the binary format is?
Thanks, Al.
Thanks, Al.
Thanks Dimon, but makes no difference. I'm clearly not seeing the wood for the trees. this is my simplified code;
with FMSStoredProc do begin
StoredProcName := 'dbo.fnGetButton';
Prepare;
Params.ParambyName('but_id').AsInteger := 1; //name
Execute;
//fmsstoredproc.fields.fields[0] is now a Tblobfield containing native xml
//but cannot get it into a tmsxmlfield.
tried streaming out the blobfield into a tmsxmlfield but get exception. in fact, if I create a tmsxmlfield object and then try to savetofile the empty object I also get an exception, not what I expect.
Any tips?
with FMSStoredProc do begin
StoredProcName := 'dbo.fnGetButton';
Prepare;
Params.ParambyName('but_id').AsInteger := 1; //name
Execute;
//fmsstoredproc.fields.fields[0] is now a Tblobfield containing native xml
//but cannot get it into a tmsxmlfield.
tried streaming out the blobfield into a tmsxmlfield but get exception. in fact, if I create a tmsxmlfield object and then try to savetofile the empty object I also get an exception, not what I expect.
Any tips?
I could not reproduce the problem.
Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script for creating database objects.
Also supply me the following information:
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE;
- the exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.
Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script for creating database objects.
Also supply me the following information:
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE;
- the exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.