question

Vinay S avatar image
0 Likes"
Vinay S asked Jeanette F commented

Using Flexscript inside {} in SQL query in Table query

Using Flexscript inside { } in Table query is showing error.

The code:

Table.query("SELECT * FROM [Final plan] WHERE [BF01 Press] = { Table("Final plan")[1][BF01 Press] } ORDER BY SortL").cloneTo(Table("P"+m));


Error message: syntax error, unexpected identifier, expecting ')'


Someone suggest how to use it with example.

I know that we can use $1 instead, but I was trying this. Pls, support.

FlexSim 23.0.1
flexscript sql
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Jason Lightfoot edited

You have to escape the quotation marks around the table name, so they don't interrupt the query string. Quotation marks are also needed around the column name.

  1. Table.query("SELECT * FROM [Final Plan] WHERE [BF01 Press] = { Table(\"Final Plan\")[1][\"BF01 Press\"] } ORDER BY SortL").cloneTo(Table("P"+m));
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.