What does your teiid insert look like? Is it returning a non zero update count?
Also in the above it seems like the select statement has no effect.
The select statement purpose is to query three values and save into 3 vairalbes I declare.
The syntax is wrong?
The select does not modify any variables. You may have seen that MetaMatrix/Teiid used the SELECT INTO clause to target loading into a table, whereas the sql spec uses INTO to load into variables. Ideally we should support that syntax as well, but for now the workaround is to use a temp table:
INSERT INTO #TEMP SELECT ...
Then later you can use a scalar subquery to get a value:
... = (SELECT COL FROM #TEMP)
Thank you very much.