Dan Packer
Member
Is there any way to export a single dataset record, either using WRITE-XML or some other method?
The code below is a simplified example of what I'm trying to do: Export each tt1 and associated tt2 data into individual files, each file with a single tt record and its associated td records. The code below is exporting the entire dataset three times. Can someone point me in the right direction?
Much appreciated,
-Dan
The code below is a simplified example of what I'm trying to do: Export each tt1 and associated tt2 data into individual files, each file with a single tt record and its associated td records. The code below is exporting the entire dataset three times. Can someone point me in the right direction?
Much appreciated,
-Dan
Code:
define variable h as handle.
define variable vcFileName as character.
define temp-table tt no-undo
field t1 as char.
define temp-table td no-undo
field td1 as char
field td2 as char.
define dataset dsTest for tt, td
data-relation dsJoin for tt, td
relation-fields (t1, td1).
assign h = buffer tt:handle.
create tt.
assign t1 = "a".
create td.
assign td1 = "a"
td2 = "Test 1".
create tt.
assign t1 = "b".
create td.
assign td1 = "b"
td2 = "Test 2".
create td.
assign td1 = "b"
td2 = "Test 2b".
create tt.
assign t1 = "c".
create td.
assign td1 = "c"
td2 = "Test 3".
for each tt:
assign vcFileName = "/tmp/" + t1 + ".txt".
dataset dsTest:write-xml("file", vcFileName, true).
end.
Last edited by a moderator: