1

我想要一种非常简单的方法来查看任何正在进行的诱惑中的内容?

4

2 回答 2

2

例如,您还可以生成 XML

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

或(可能不那么容易)输出为分号分隔的文件

OUTPUT TO c:\temp\file.txt.
FOR EACH ttTmp:
  EXPORT DELIMITER ";" ttTmp.
END.
OUTPUT CLOSE.
于 2013-05-29T13:24:31.007 回答
1

我刚刚找到了一种使用 Json(从 10.2B 开始)将临时表转储到文件的简单方法。WRITE-JSON 是诀窍!

DEFINE TEMP-TABLE ttTmp                                             
  FIELD FieldA          AS CHAR                                         
  FIELD FieldB          AS CHAR.                                        

CREATE ttTmp.                                                           
ASSIGN ttTmp.FieldA = "A"                                               
      ttTmp.FieldB = "B".                                               

DEFINE VARIABLE tthTmp AS HANDLE  NO-UNDO. /* Handle to temptable */    
DEFINE VARIABLE lReturnValue AS LOGICAL NO-UNDO.                        
tthTmp = TEMP-TABLE ttTmp:HANDLE.                                       


lReturnValue = tthTmp:WRITE-JSON("FILE", "c:\temp\tthTmp.txt", TRUE, ?).

/* Output File tthTmp.txt                                               
{"ttTmp": [                                                             
  {                                                                     
    "FieldA": "A",                                                      
    "FieldB": "B"                                                       
  }                                                                     
]}                                                                      
 Output File tthTmp.txt */                                              
于 2013-05-29T12:57:49.280 回答