Why are these "undefined variables" after the sql?

It seems to me that the values of the 2nd query are not created. But the 2nd sql statement shows ok.

Why isn’t it defining?