Page 1 of 1
Database import
Posted: Tue Jan 08, 2008 10:39 pm
by mruud
I'm trying to retrieving data from a database. Some of my data tables are
constructed with a column for date+time (datetime format) and a number of columns with data values. Are there any way to import data to vensim from this sort of table and using the date-time column as time in Vensim?
Posted: Wed Jan 09, 2008 3:08 am
by bob@vensim.com
currently there is no way - I would recommend doing a merge to some sort of numeric time access and use that to query against.
writing to database
Posted: Thu Jan 10, 2008 1:14 pm
by mruud
I have some problems with the syntax for saving data to a database. T
I have the variables inflow_a, inflow_b, inflow_c in the model.
The values should be saved to a table hbv with the filelds day, in_a, in_b, in_c.
What would the syntax look like??
Posted: Fri Jan 11, 2008 12:14 pm
by bob@vensim.com
Look at the example for output using Insert and Delete in Chapter 14 of the DSS reference supplement. If you have inflow_a then you would use
:VAR inflow_a
to specify this. If inflow_a, inflow_b and inflow_c are all fields in a record with a single time field then I think you will need to output to 3 temporary tables and do a join. I will have to take another look at this to see if there is an easier way.
Posted: Fri Jan 11, 2008 1:16 pm
by mruud
Yes I have read and tryed the ex in chap 14, so my problem is to save more than one value at one time to the same table and row. Fine if you have a look on it. Thank you!