My apologies, but your system is saying that I am posting forbidden content and I have no idea what that is, so I am attaching as an image and we can update the replies with the actual text.
I simply have no idea what could possibly be wrong.
Procedure statements can only be used where a procedure is expected - BNF for SQL Grammar - Teiid 8.13 - Project Documentation Editor
So to implement full flow control you will need a virtual procedure.
A view doesn't have a proper notion of parameters and only allows for simpler constructs, like common table expressions, case expression, etc.
Retrieving data ...