Select Query--> Bind Package to bind a package for a static query. This option becomes available after you type an SQL statement.
This operation enables distributed SQL to run at any DB2 database. A package must be bound at the database server that contains the active SQL statement as a static query.
The Bind Static Package contains fields for the Collection ID, Package name, Owner ID, Delimiters, Isolation Levels, and input variables, if any.
For bound packages, host variables are used in place of each substitution variable in the SQL statement because a substitution variable cannot always be directly replaced by a host variable. Substitution variables provide direct text substitution in the query statement before the query is executed at the database server. Host variables are sent as part of the query to the database server. Refer to the documentation for your database server for rules on where and how host variables can be used in queries.
The SQL is bound at the server under the specified collection ID and package name. A consistency token and section number are assigned during the bind. The following message displays following the bind:
The query will now be run via static SQL. You must save this query in order to continue running it via SQL in the future.
Static queries are run directly from the server and system resources are not consumed as when you run a query on an ad hoc basis.