Requesting persistent binding for cursor output variables only

If you use -b but omit -p when precompiling the preceding example, the generated code binds the host output variables of the fetch statement only once—the first time that the statement executes. (More precisely, the host variables get bound only if they are not bound already.) The bindings persist for all subsequent executions of the statement, until the program closes curs1. They persist because you used the -b option. Because you omitted the -p option, bindings for host input variables do not persist.

If your program closes curs1 and then reopens it, all bindings for host variables related to curs1 are canceled. Any host input variables and host output variables are re-bound when the cursor is reopened. They persist until your program closes the cursor again.