>I would like to get some feedback on this idea, to see if it is worthy as an ER for VFP8.
>
>With VFP7SP1, we can use XMLTOCURSOR to append a record to an existing table. What do people think about enhancing this to allow an existing record to be overwritten? For example:
>
>For an append from an XML string to a table the syntax is:
>XMLTOCURSOR(lcXMLString,"mytable",8192)
>
>Proposed syntax for a replace from an XML string into a table:
>XMLTOCURSOR(lcXMLString,"mytable",lnSomeFlag,lcPrimaryKeyField)
>Where:
>lnSomeFlag is an integer flag that can be added to the existing flags
>lcPrimaryKeyFeild is a string which indicates which field is the primary key in both the XML string and the table. For instance if I specified "ID", then XMLToCURSOR would look at the value of ID in the XML string, move to that ID in the table, then do a replace. If the XML string contained n records, n replaced would be done in the table.
>
>Reasons for request:
>To do this current I have to do the following steps
>1. Convert XML to cursor
>2. Scatter the cursor fields to variables (except the primary key)
>3. Move to the record in the table that should be overwritten
>4. Gather all the fields (except the primary key) into the record
>5. Do a tableupdate
>
>So adding this feature to XMLTOCURSOR would make our code simpler and would make working with XML data almost trivial. In a perfect would it would be cool to have INSERT, APPEND, SQL-SELECT be able to work with XML data directly, but I think the above would make life easier.
>
>Thoughts?
Hi Evan,
take a look at the XmlUpdateGram topic on the fox wiki; there's a routine there for actually using xmlupdategram in VFP, which sounds like what you want.
Hank
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only