Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem:datetime&logical data expression in XML
Message
De
24/01/2005 01:10:39
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00979190
Message ID:
00979931
Vues:
27
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>
	<tmp>
		<dt>2005-01-24T13:25</dt>
	</tmp>
	<tmp>
		<dt>2005-01-24T13:26</dt>
	</tmp>
	<tmp>
		<dt>2005-01-24T13:35</dt>
	</tmp>
	<tmp>
		<dt>2005-03-05T00:00</dt>
	</tmp>
	<tmp>
		<dt>2005-02-03T00:00</dt>
	</tmp>
	<tmp>
		<dt>2005-01-25T00:00</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.
Steven
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform