OpenEdge 102a将表导出到xml文件

时间:2014-02-17 14:04:24

标签: progress-4gl openedge

我是openge的新手,我试图将表初始导出到xml文件。 我的最终目标是将三个表导出到xml文件。

我试图以简单的分隔方式导出并正在工作。 我试过了

  • 对于txt

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

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

对于xml我只支持102b。这就是我在使用Unable to understand after -- cGrSIRVATNBR:时出错(WRITE-XML)的原因。

我将不胜感激。

1 个答案:

答案 0 :(得分:3)

这对我来说很好用:

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 ).

您无法直接将db表写入XML。您必须先将所需的记录复制到临时表中。