Page 1 of 1

Data input from MySQL database

Posted: Thu Sep 30, 2004 5:49 pm
by Pruyn
I'm having a small problem with the data retrieval from an MySQL database over an ODBC link.

When Vensim is compiling the Variable names, I get the following problem.

WARNING: There is no variable - Work Percentage Lookup[Yard1,Cabling,"
","
"] - in the current model.

Since not all my variables have the same amount of subscripts, MySQL reports a NULL in the empty spaces. My guess is that these are translated to " by Vensim.

The most obvious solution would be to put the subscripts also in the Varname column, but still I would like to keep these seperated. Hope someone can tell me another way around this problem

Jeroen

Posted: Thu Sep 30, 2004 6:08 pm
by Pruyn
I removed a (for now) empty column and the problem was fixed. Also for the variables with less subscripts. If it happens again I'll post it.

Jeroen

Posted: Fri Oct 01, 2004 1:22 pm
by bob@vensim.com
Just glancing at this it looks like MySQL is returning a carriage return on what should be an empty string. Why it would do something like that totally baffles me, but I have not worked with MySQL very much so anything is possible.

There may be a setting in the data definitions of MySQL setup that controls this. I will build in something to deflect this in future Vensim Revs, but there is no Vensim sided workaround I can think of right now.

Posted: Tue Oct 05, 2004 3:30 pm
by Pruyn
Found the problem.

I'm running MySQL under Windows. When I'm importing text-files, I need to ignore the line terminator, this is what bugged the vensim translation.

Thanks, Jeroen

Posted: Mon Oct 18, 2004 9:36 am
by Pruyn
I have a new problem with the MySQL database communication. For a small model it is possible to change database values during simulation, while running vensim as a game reading the data over an ODBC connection.

In my larger model this also works for the first time step, but afterwards this ability is somehow lost. I have also created a Venapp program which orders the use of a .vdi script before running the next step, but this also doesn't work.

Does anyone have any suggestions for a solution, or an idea where the problem might originate.

Posted: Mon Oct 18, 2004 2:03 pm
by bob@vensim.com
I can't think of any reason that simple size would be causing problems, so I think it must relate to some feature of the model and database that is causing the problem.

Does you simple model have the same subscript character as the more complex model? If not add in additional subscripts on the inputs/outputs and see if it still works.

Posted: Fri Oct 22, 2004 7:40 am
by Pruyn
Found the problem, had the same variables in two different tables. Vensim orders the input somewhat arbitrary, one variable as I described earlier, another only from the second table. This is actually how I found out.

Thanks.