question

Joerg Vogel avatar image
0 Likes"
Joerg Vogel asked Joerg Vogel commented

push an item to and pull it from a list, what is my mistake?

I am trying to push an item to a list and later I am pulling the item with a WHERE clause? I make something totally wrong, because I can't get it working. It is just a small example. The item gets to the list in the onEntry trigger of the queue and is pulled in the onExit trigger of the processor.

  1. WHERE id == tonum(item)

The id contains the same item converted to a number in the onEntry Trigger.

Is there an easier approach, because the reference is already on the list? It is the value column.

FlexSim 17.2.2
listsqlpull itemwhere
· 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.

Mischa Spelt avatar image
2 Likes"
Mischa Spelt answered Joerg Vogel commented

@Cameron Pluim is close: item does not exist within the scope at which the query is evaluated, but you are already passing it in as puller in the fourth argument to List.pull so no need to do string conversions.

Inside the query, you can access the item as puller and something like

  1. WHERE id == tonum(puller)

should work (untested though).

· 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.

Cameron Pluim avatar image
1 Like"
Cameron Pluim answered Joerg Vogel commented

@Jörg Vogel

The following code should work:

  1. "WHERE id = " + numtostring(tonum(item))

I think the issue is that "item" is unknown within the scope of list.pull so you need to change it to a number before putting it in the string. But that is just my guess.

· 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.