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 17:44:51
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
To
08/02/2022 15:03:35
Antonio Lopes (Online)
BookMARC
Coimbra, Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01683464
Message ID:
01683488
Views:
23
>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.


Hi Antonio,

Your solution solve my problem, i always think that anything in XML file are character even if the TAG contains only numbers.

Many thanks,
Luis
Previous
Reply
Map
View

Click here to load this message in the networking platform