07-21-2008 02:22 AM
Solved! Go to Solution.
07-21-2008 03:50 AM - edited 07-21-2008 03:51 AM
07-21-2008 04:05 AM
Hello again,
If it can help, I found a pdf document http://www.ni.com/pdf/manuals/320960a.pdf describing the DBActivateMap (page 35 / 99).
But unfortunately, my skills in computer and my english level are too low ...
Does somebody can tell me why this command gets slower when the table gets bigger (is it normal ?) ?
Thanks again for your help,
Ptit Bleu.
07-21-2008 06:19 AM - edited 07-21-2008 06:19 AM
07-21-2008 08:10 AM
07-21-2008 09:33 AM
Hello again,
The table Table1 has 30 colums (as double or as float and one as strings to store the date+time of the acquisition).
The script adds 1 row per acquisition (ideally 1 acquisition every 2 seconds during 1 minute then it stops during 5 minutes, 24/24).
It means that the number of rows increases quite rapidly but I think it is not so big.
I can understand that DBActivateMap is necessary each time but I don't understand why its execution time is getting bigger as the size of the table increases.
Here is a part of the script. I'm not sure it will help you to help me, but who knows ...
The command whose execution time is getting bigger is the first line :
statementHandle = DBActivateMap (mapHandle, "Table1");
Thanks again for your advices,
Ptit Bleu.
------------------------------------------------------------------------------------------------------------------------
// Activate the link with the variables (my translation of the comments of the developer)
statementHandle = DBActivateMap (mapHandle, "Table1");
if (statementHandle < 0 )
{
sprintf ( errMessage, " Error Activating Database");
return 1;
}
// Create the record
resCode = DBCreateRecord (statementHandle);
if (resCode != DB_SUCCESS)
{
sprintf ( errMessage, " Error Creating Record Datadase");
return 1;
}
// Insert the data into the database
resCode = DBPutRecord (statementHandle);
if (resCode != DB_SUCCESS)
{
sprintf ( errMessage, " Error Putting Record Datadase");
return 1;
}
// Deactivate the links with variables
resCode = DBDeactivateMap(mapHandle);
---------------------------------------------------------------------------------------------
07-23-2008 02:34 AM
Hello,
I don't think it's a problem with LabWindows/CVI, the database provider may be slower with a bigger database. I'm looking for informations about that and I'll keep you in touch if I find something.
Have a nice day,
07-25-2008 01:53 AM
11-04-2008 10:13 AM
Hello,
Just a small message to ask M. Muller if he found a solution to my problem (I still have it ...).
Thanks in advance,
Best regards,
Ptit Bleu.
11-05-2008 04:44 AM
Hi,
I don't understand something, your CVI just creat a new row in the database?
DBActivateMap do a automatic "select" on the database, if you dont't use DBMapColumnTo* before, this request create SQL request that select ALL THE DATABASE, it's can be very slow if you have a lot of entries.
If you create a row, you don't need to have a previous rows, use resCode = DBImmediateSQL (mapHandle, “INSERT INTO Table1 VALUES (var1,var2,var3,var4)");
Best regards,
Aurélien J.
National Instruments France