ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Import of data in schedule of a source
Hello,
I want to import data directly from a Access database into a schedule in a source. But I don't know how to do it. Is dbimportnode the correct command? And how can I add the typical schedule attributes as for example itemtype or quantity to the schedule table? I'm able to import data from a database in a global table, but that doesn't help with a schedule. thanks in advance for all answers, Matthias |
#2
|
|||
|
|||
Hi Mattias,
I normally not use database connection, but I think you should do something like this: Code:
treenode schedule = getvarnode(current,"schedule"); dbimportnode(schedule,startrow,startcol,numrows,numcols) your Source. Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Matthias Hofmann (10-07-2008) |
#3
|
||||
|
||||
Hello Matthias,
I don't know how good you are with flexscript but actually the schedule of a source is nothing more than a table based on a variable node. Just as the global tables are base on a variable node. if you create a pointer to that particular node: treenode Schedule = getvarnode( current, "schedule"); you can use all the table commands, such as: settablesize, settablenum etc.. So if you want to set for instance the quantity on the first line you can write: int Quantity = 11; settablenum (Schedule , 1, 4, Quantity ); Of course the name should be changed with "settablestr" ofcourse! So now you could read in your db in a global table and then create the schedule based on that global table. Hope this was of any assistance. Steven |
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
Matthias Hofmann (10-07-2008) |
#4
|
|||
|
|||
Thanks for your answers. They were very helpful.
I tried now both methods and the method with the table commands works. The only thing I want to mention is that you have to assign the correct data type to each cell/node before you write data in that cell. I used the command nodeadddata for that. I didn't managed to get the data imported with dbimportnode, but I don't know why. Maybe I didn't tried hard enough. |
Thread | Thread Starter | Forum | Replies | Last Post |
Excel Data Import | Sung Kim | Q&A | 2 | 07-16-2010 10:41 AM |
how to import excel in source? | qin tian | Q&A | 6 | 01-11-2010 10:58 PM |
Problems with import of data from a database | Matthias Hofmann | Q&A | 1 | 09-26-2008 09:42 AM |
Help on flexsim data input into source and processer | TanSiying | Q&A | 4 | 10-30-2007 07:55 PM |
How to use the actual date/time data in Arrival Schedule Mode of Source | syseo | Q&A | 0 | 10-12-2007 08:22 PM |