New Sample - Data Export in DQL, ExecDQL and with DataExport() explained!
New Sample - Data Export in DQL, ExecDQL and with DataExport() explained!
In this sample we showcase two techniques:
1. ExecDQL
2. DataExport()
We have also included a "Traditional DFW DQL export example so you can compare.
define "retval" text .As we see, it is just a normal DQL that list all the data in our Addressbook table.
retval := ConsoleCopy(concat("Export started: ", current time),1) .
retval := SetLabelText("Status1",concat("Export started: ", current time)) .
for Addressbook ;
list records
Company ;
Name ;
Address ;
Town ;
Postcode ;
Country ;
Phone ;
Email ;
Web ;
Contact .
end
retval := ConsoleCopy(concat("Export end: ", current time),4) .
retval := SetLabelText("Status11",concat("Export ended: ", current time)) .
.
retval := WriteToFile("Company~Name~Address~Town~Postcode~Country~Phone~Email~Web~Contact",data-entry field1,5) .It would be tempting to add it to the end of the previous DQL and we would be all done, but that won't work. DataEase keep the file open and locked exclusive till it has finished with it and that is when the DQL is completely finished, so if we want to manipulate it we have to do that after the first DQL is finished.define "retval" text .This nifty little file manipulation function enables us to insert the header at the top of the file ;-) It has switches for inserting, overwriting, deleting, appending with and without line feed...
retval := WriteToFile("Company~Name~Address~Town~Postcode~Country~Phone~Email~Web~Contact",data-entry field1,5) .
define "retval" text .
retval := MemoExecDQL(Any ExecDQLStore with DQL Number = 3 DQL,"","","","",data-entry field1) .
retval := MemoExecDQL(Any ExecDQLStore with DQL Number = 5 DQL,data-entry field1,"","","","") .