<?xml version="1.0"?>
<ttCustomer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ttCustRow> <CustNum>1</CustNum> <Country>USA</Country> <Name>Lift Tours</Name> <Address>276 North Drive</Address> <Address2/> <City>Burlington</City> <State>MA</State> <PostalCode>01730</PostalCode> <Contact>Gloria Shepley</Contact> <Phone>(617) 450-0086</Phone> <SalesRep>HXM</SalesRep> <CreditLimit>66700.0</CreditLimit> <Balance>903.64</Balance> <Terms>Net30</Terms> <Discount>35</Discount> <Comments>This customer is on credit hold.</Comments> <Fax/> <EmailAddress/> </ttCustRow> . . . </ttCustomer> |
/* pi-tfx-ttSetup-4.i */
/* Definition of a static temp-table. */ DEFINE TEMP-TABLE ttCustomer NO-UNDO FIELD CustNum LIKE Customer.CustNum FIELD Country LIKE Customer.Country FIELD Name LIKE Customer.Name FIELD Address LIKE Customer.Address FIELD Address2 LIKE Customer.Address2 FIELD City LIKE Customer.City FIELD State LIKE Customer.State FIELD PostalCode LIKE Customer.PostalCode FIELD Contact LIKE Customer.Contact FIELD Phone LIKE Customer.Phone FIELD SalesRep LIKE Customer.SalesRep FIELD CreditLimit LIKE Customer.CreditLimit FIELD Balance LIKE Customer.Balance FIELD Terms LIKE Customer.Terms FIELD Discount LIKE Customer.Discount FIELD Comments LIKE Customer.Comments FIELD Fax LIKE Customer.Fax FIELD EmailAddress LIKE Customer.EmailAddress INDEX CountryPost Country PostalCode INDEX Comments IS WORD-INDEX Comments INDEX CustNum IS UNIQUE PRIMARY CustNum INDEX NAME Name INDEX SalesRep SalesRep. |
/* pi-tfx-read-4.p */
/* Populates an empty static temp-table with records from an XML file. */ {pi-tfx-parameterVarDefs.i} {pi-tfx-ttSetup-4.i} DEFINE VARIABLE lReturn AS LOGICAL NO-UNDO. ASSIGN cSourceType = "FILE" cFile = "ttCustomer.xml" cReadMode = "EMPTY" cSchemaLocation = ? lOverrideDefaultMapping = ? cFieldTypeMapping = ? cVerifySchemaMode = ?. lReturn = TEMP-TABLE ttCustomer:READ-XML(cSourceType, cFile, cReadMode, cSchemaLocation, lOverrideDefaultMapping, cFieldTypeMapping, cVerifySchemaMode). IF lReturn THEN FOR EACH ttCustomer NO-LOCK: DISPLAY CustNum Name FORMAT "X(30)". END. |