ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 04-18-2016
Jia Lize
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Question Can SQL be used in array data?

There are some new fetures about array since v7.7:
1.Arrays (int, double, string and treenode) can be stored on nodes such as labels.
2.Arrays are now viewable/editable as tables.
3.Made the sql IN clause work if you compare it against a value that is an array.

Help:

How can I store an array on a node ?
how can I edit an array as table?
What\'s the exact meaning of "compare it against a value that is an array" about SQL in clause? Is there any example?

Thanks so much ~~
  #2  
Old 04-19-2016
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

These features were mostly added to accommodate process flow needs, so command-wise, right now setlabel() is the only command that will set a node's value to an array (we hope to extend that in the future).

The attached model has an example that uses arrays. It sets a label named "array" on the tokens on the left. You can click on the tokens, then in Quick Properties, right-click on a label and choose Explore as Table to edit the array values.

The attached model also uses the SQL IN clause, where tokens on the right try to get a token on the left that has a specific target value in its array.
Attached Files
File Type: fsm ExampleSQLInClause.fsm (18.1 KB, 552 views)
The Following 6 Users Say Thank You to Anthony Johnson For This Useful Post:
Steven Hamoen (04-22-2016)
  #3  
Old 04-19-2016
Jia Lize
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

That's Cool ! Thank you very much~
  #4  
Old 04-20-2016
Jia Lize
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

Can bundle data be stored in memory like array?
  #5  
Old 04-21-2016
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Bundle data is stored in memory. You can give a node bundle data and add, remove, and set values in the bundle. That's all in memory.

If you are talking about having a purely locally defined "bundle", i.e. a two-dimensional array local to a flexscript function, unfortunately flexscript doesn't support two-dimensional arrays at this point, although that is on our development radar.
The Following 4 Users Say Thank You to Anthony Johnson For This Useful Post:
Steven Hamoen (04-22-2016)
  #6  
Old 04-26-2016
Jia Lize
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Smile

Quote:
Originally Posted by Anthony Johnson View Post
Bundle data is stored in memory. You can give a node bundle data and add, remove, and set values in the bundle. That's all in memory.

If you are talking about having a purely locally defined "bundle", i.e. a two-dimensional array local to a flexscript function, unfortunately flexscript doesn't support two-dimensional arrays at this point, although that is on our development radar.
That's exactly what i'm talking about , Thanks very much.

Waiting for the new feture~~

Tags
array, sql, table


Thread Thread Starter Forum Replies Last Post
How to pick more than one value from an array? mearjun Q&A 1 07-20-2014 12:57 AM
Array of Itemtypes - few problems daniel dunst Q&A 1 06-05-2012 10:30 AM
Maximum Value inside an array Congshi Wang Q&A 4 03-02-2011 10:53 AM
array size juan alberto Q&A 0 12-21-2010 03:03 AM
Can't get value from global array Joe Allen Q&A 7 10-30-2008 09:06 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.