Trying to write this SQL statement

Trying to write this SQL statement

patrickABAWF
Collaborator Collaborator
5 Views
4 Replies
Message 1 of 5

Trying to write this SQL statement

patrickABAWF
Collaborator
Collaborator

[ FlexSim 21.2.4 ]

I'm trying to write this SQL Statement but there is a problem with the line before last:

Table result = Table.query("SELECT * FROM FRList1 \
WHERE [ChoiceC2] > 0 \
AND [Content] > 0 \
AND [Content] < 10 \
AND 'token.item.Purity' = [Purity] \
ORDER BY ChoiceC2 ASC");

token.item.Purity is a string label and [Purity] is a string column in my table.

But I never get a match because of that line although there are matches that I can see.

Is my synthax correct?

Thanks a lot,

0 Likes
Accepted solutions (1)
6 Views
4 Replies
Replies (4)
Message 2 of 5

Matthew_Gillespie
Autodesk
Autodesk
@Patrick Cloutier It doesn't know what token is.


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 5

patrickABAWF
Collaborator
Collaborator
How do I write it then?
0 Likes
Message 4 of 5

patrickABAWF
Collaborator
Collaborator
I've spent hours in the manual and on w3schools and I can't figure it out...
0 Likes
Message 5 of 5

patrickABAWF
Collaborator
Collaborator
Accepted solution

I found it !!!

Table result = Table.query("SELECT * FROM FRList1 \
WHERE [ChoiceC2] > 0 \
AND [Content] > 0 \
AND [Content] < 10 \
AND [Purity] = $1 \
ORDER BY ChoiceC2 ASC", token.item.Purity);