Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nfJson Update - new nfOpenJson function

Status
Not open for further replies.

mplaza

Programmer
Nov 23, 2009
135
VE
Just posted a major Update of nfJson on the new VFPX github site ( )

If you use nfJson please download the latest version.

I'm also glad to announce that I've included a BETA PREVIEW of nfOpenJson, a function similar to the new "openJson" function in Sqlserver 2016, wich allows you to convert Json to cursor. Please check nfOpenJsonTest and for clear explanation.

Now you can do:

text to mssample2 noshow
[
{
"Order": {
"Number":"SO43659",
"Date":"2011-05-31T00:00:00"
},
"AccountNumber":"AW29825",
"Item": {
"Price":2024.9940,
"Quantity":1
}
},
{
"Order": {
"Number":"SO43661",
"Date":"2011-06-01T00:00:00"
},
"AccountNumber":"AW73565",
"Item": {
"Price":2024.9940,
"Quantity":3
}
}
]
ENDTEXT


nfOpenJson( m.mssample2,'$.array',';
- Number v(200) $.Order.Number ;
- Date t $.Order.Date ;
- Customer v(200) $.AccountNumber ;
- itemPrice n(6,2) $.Item.Price ;
- itemQuantity i $.Item.Quantity ;
- Order JSON')

browse

and get:

openjsonTest_bdu6hn.jpg


Marco Plaza

Marco Plaza
@vfp2nofox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top