As Mackavi mentioned in an older post,
there is help and example (for part of this) in the OpusScript help file. Do a search there for: getnumberofrecords --- and you will find this below and more:
Quote:
Database Functions - Introduction
Below is a simple OpusScript example showing how you can use the OpusScript Database functions in a Script Object or Script Action. The example shows in which order you should use the Database functions.
The full script is:
var db = new Database("DSN=Products;")
var RecSet = db.ExecuteSQL("SELECT Price, Qty FROM Customer_Order WHERE OrderID=1;")
var total = 0
// Setup loop for all the records found
for (var i=1; i<= RecSet.GetNumberOfRecords(); i++)
{
total += RecSet.Price * RecSet.Qty
RecSet.NextRecord() // Move to the next record
}
Explaining the Example: [continues in the Help File]
Here is a suggestion for adapting the above to your scenario.var onerecord = "" ;
var mylisting = "";
//Use a LOOP as above
//Now to achieve what you want (All Fields) replace that one line of code above (total += etc etc)
onerecord = field1 +"\t" +field2 +"\t" +field3 +"\t" +field4 ;
mylisting += onerecord +"\n" ; //appends records and a newline (as written, will leave an extra "\n" at the end)
That should get you on-track. You can find previous discussions in forum: loop records