Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error to copy content of XML file to Cursor
Message
From
08/02/2022 15:03:35
 
 
To
08/02/2022 04:30:20
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01683464
Message ID:
01683484
Views:
35
>Hello comunity,
>
>I try to passed the content of my XML file to cursor, but i have always this error that curiously appear only if i try to import 1 day from my XML fiel to my cursor crstmp ??

>I think the problem is because about the conversion from Character to VAL() : Replace crstmp.qtt With VAL(dossiers.qtt) !?, maybe?
>

Luis,

Try to replace
					Replace crstmp.qtt With VAL(dossiers.qtt)   && Error happen here 
with
					Replace crstmp.qtt With IIF(TYPE("dossiers.qtt") == "C", VAL(dossiers.qtt), dossiers.qtt)  
If there is a negative qtt value in the XML document, XMLTOCURSOR() creates a character column. Otherwise, it creates a numeric column.

An alternative would be, of course, to specify a schema or to indicate an existing cursor to receive the data. But this will probably solve your problem.
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform