Well, I guess the trick you need to know is the existence of "global SQL session/cursor".
It is represented by that "SQL" in examples. Once you assign anything to it, all Sql cursor will by default be assigned to this session. Of course, this works well only as long as your app uses just single database (but that is 90% cases).
Moreover, you also use this "SQL" as cursor to execute commands (but caution is needed there).