Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem:datetime&logical data expression in XML
Message
 
 
To
24/01/2005 01:10:39
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00979190
Message ID:
00979961
Views:
29
This message has been marked as a message which has helped to the initial question of the thread.
Steve,

The dates in XML are missing seconds part which makes it invalid. Make sure that SET SECONDS is ON before running CURSORTOXML(). It is a bug that CURSORTOXML() is affected by SET SECONDS.

>Hi Sergey,
> Thanks, to pre-convert "true"/"flase" with strtran() really is a skillful idea.
>However,as per your hint,i did further try with datetime parameters again,still failed.
>is it possibly caused by different SQL environment? mine is SQL2k+SP3.
>Testing codes in SQL Query Analyzer:
>
>declare @xl varchar(8000)
>select @xl=
>'<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
><VFPData>
>	<tmp>
>		<dt>2005-01-24T13:25</dt>
>	</tmp>
></VFPData>
>'
>--Note that the XML script was generated with cursortoxml() in VFP9.
>exec ReadXML @xl
>
>SP - ReadXML:
>
>CREATE PROCEDURE  ReadXML
>(
>@xml  Varchar(8000)
>)
>as
>declare @xdoc int
>exec sp_xml_preparedocument @xdoc output, @xml
>select t.* from openxml (@xdoc, '/VFPData/tmp', 2)   with ( dt datetime)  as t
>exec sp_xml_removedocument @xdoc
>GO
>
>Error message raised in SQL Query Analyzer:
>
>Server: Msg 241, Level 16, State 1, Procedure ReadXML, Line 8
>Syntax error converting datetime from character string.
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform