Question

I am new to openedge and i am trying to export initially a table to xml file. My final aim is to export three tables to xml file.

I have tried to export in a simple delimited and is working. I have tried

  • For txt

        OUTPUT TO c:\temp\file.txt.
          FOR EACH cGrSIRVATNBR:
            EXPORT DELIMITER ";" cGrSIRVATNBR.
          END.
        OUTPUT CLOSE.   
    
  • For xml

       cGrSIRVATNBR:WRITE-XML("FILE","c:\temp\tt.xml", TRUE).
    

For xml i thing is only supported from 102b. That's why i am taking error (Unable to understand after -- cGrSIRVATNBR:) when using WRITE-XML.

I will appreciate any help.

Was it helpful?

Solution

This works fine for me:

define temp-table ttCust no-undo like customer.

for each customer no-lock where custNum = 1:
  create ttCust.
  buffer-copy customer to ttCust.
end.

temp-table ttCust:write-xml( "file", "cust.xml", true ).

You cannot directly write a db table to XML. You have to copy the records that you want into a temp-table first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top