cross data analysis in graph screen from database without timing


osmansirmali

Recommended Posts

Its a little unclear exactly what you are doing in your file, but I think I know what you are trying to do. The easiest way to import a bunch of data from a database is actually to use a rather undocumented function called QuerytoClass(). Its been in DAQFactory for quite awhile and used by quite a few apps, so is well tested, and very fast in comparison to the old Query() function. QuerytoClass() will do a query and put the entire result set into a class with one call. A class is another undocumented feature I'm afraid, but for your purpose you can think of it as a structure. Basically you do something like this:

private handle = db.Open("SEMlog")

global datain = db.QueryToClass(handle,"select zaman, ("+yeksen+") from Table_1 where zaman between ("+start_date+")and("+end_date+")")

db.Close(handle)

you might want a try/catch block too, but I'll ignore that for now. The QueryToClass function will make datain into an instance of a class that contains a member variable for each field in the query (i.e. "zaman" and whatever "yeksen" lists. It also creates two additional member variables called FieldNames, which is an array of strings listing each of the fields, and RecordCount which is the number of records returned. RecordCount is a bit redundant, because you could just do NumRows(datain.Zaman) to get the same thing.

To access each field, just list the variable name (datain), a period, and the field name:

datain.Zaman

If these are globals you could then plot them as such.

I would expect that these two things (QueryToClass and classes) will be documented in an upcoming release.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.