How to access the token label in the SQL query.
for example, comaparing the table value with the token.label
How to access the token label in the SQL query.
for example, comaparing the table value with the token.label
Hi @Tamilselvan, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.
If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.
What's the context of the SQL - a table query, or list pull?
In a table query you can either concatenate the value into the string or pass in parameters for the token. Normally you'll be using a field name in the table to match values:
Table result=Table.query("SELECT * FROM MyTable WHERE $1.myLabel=<TableField>",token);
where you'd replace <TableField> with the name of column you want to match.
In a list pull query you just need to refer to the token as puller:
WHERE puller.myLabel=<ListField>
again replacing <ListField> with the name of a field you've added to the list.
All of this is documented on this site and in the online documentation. Please go through all the tutorials.
I am trying to Filter Some (x) value in my global table using the sql query, but that (x) is in my token label, that specific value has to filtered in global table.
For Example
Let's Consider i have Value : Station_1 in my token label(token.Value), i need to access the token label in Sql query and filter the Station_1. I should not query with the specific keyword, it should take the value from label dynamically.
Please don't use Value as the label name - it's used elsewhere in FlexSim and additionally in the context of a label can seem meaningless (exception being monetary value).
If you want a subset of a global table containing rows where some column contains a value matching that of a token label, then I've already answered that above. If the fieldname is dynamic too then just concatenate that into the sql string in place of the <Fieldname> text, rather than typing a fixed field. If that fieldname has spaces then be sure to put [ ] around it.
Test this in a tiny example with a script in the script console or a custom code in a process flow and if it doesn't work for you post the example and we'll find out why.
14 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved