Database import

Use this forum to post Vensim related questions.
Post Reply
mruud
Member
Posts: 23
Joined: Fri Mar 28, 2003 7:19 am

Database import

Post 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?
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post 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.
mruud
Member
Posts: 23
Joined: Fri Mar 28, 2003 7:19 am

writing to database

Post 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??
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post 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.
mruud
Member
Posts: 23
Joined: Fri Mar 28, 2003 7:19 am

Post 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!
Post Reply