Option one is the correct way to query an experiment table:
/*1)*/ Table Query = Table.query("SELECT * FROM Experiment.SC");
It is very common that the table name needs brackets:
Table Query = Table.query("SELECT * FROM Experiment.[SC]");It is usually unnecessary to pass the table as a parameter, as FlexSim supports nested queries:
SELECT ... FROM (SELECT a, b, c FROM Experiment.SC WHERE ...)
If you really need to query a custom data structure (which could include a table), you can use placeholders and $iter():
Table fromTable = Table("GlobalTable1");
Table result = Table.query("SELECT $2 AS Col1, $3 AS Col2 FROM $1"
, fromTable.numRows /*pass in the number of rows in your table*/
, fromTable[$iter(1)][1] /*use $iter(1) to access the nth row*/
, fromTable[$iter(1)][2]
);
result.cloneTo(Table("GlobalTable2"));
.
Jordan Johnson
Principal Software Engineer
>