将专用寄存器CURRENTEXPLAINSNAPSHOT 设置为YES以捕获动态 SQL 语句的快照。
Set the special register CURRENT EXPLAIN SNAPSHOT to YES to capture the snapshot for dynamic SQL statements.
现在让我们来看一下如何执行在编写应用程序时还不确定并且具有参数标记(即占位符)的SQL 语句 ——即真正的动态 SQL 语句。
Now let's see how to execute an SQL statement which is unknown at the time the application is written and has parameter markers or placeholders; that is, a truly dynamic SQL statement.
SQL 语句分布图显示数据库的动态和静态 SQL 语句的分布情况。
SQL statement distribution shows the distribution of dynamic and static SQL statements for a database.
在触发器、动态合成语句、标量、表、行函数和方法中不能调用具有访问级别MODIFIESSQLDATA的联邦过程。
Federated procedures with access level MODIFIES SQL DATA cannot be invoked inside triggers, dynamic compound statements, scalar, table, row functions, and methods.
可以使用SQL命令EXECUTE来执行这个动态预备语句。
This dynamically prepared statement can be executed using the SQL command execute.
当应用程序从头开始构建整个SQL 语句时,通常会用到变动列表动态 SQL。
Varying-list dynamic SQL is typically used when an application builds the entire SQL statement from scratch.
但是许多打包的应用程序使用具有参数标记的动态sql语句,因此,这些参数标记的值是未知的。
However, many packaged applications use dynamic SQL statements with parameter markers and therefore the values of these parameter markers are not known.
这个程序执行一条动态生成的DB2SQL 语句,从数据库中获取CURRENTDATE。
This program executes a dynamically prepared DB2 SQL statement to retrieve CURRENT DATE from the database.
包缓存——为存储静态和动态sql语句而分配的内存。
Package Cache - Memory allocated to store both static and dynamic SQL statements.
所有数据,包括动态sql语句、用户输入数据、用户输出数据以及SQLCA中的字符字段,都是基于该代码页进行解释的。
All data, including dynamic SQL statements, user input data, user output data, and character fields in the SQLCA, is interpreted based on this code page.
最后,在改进的示例中,您可以看到该sql语句和输出没有包括动态列选项。
Finally, in the improved example, you can see that the SQL statement and output do not include a dynamic column selection.
对于每个被执行的动态sql语句,请检查高速缓存是否足够大且高速缓存的命中率是否较高。
Check that the cache size is sufficiently large and that the cache hit ratio is high for each of the dynamic SQL statements being executed.
这个独特的特性使得在设计时能够动态执行sql语句并允许回滚。
This unique feature makes it possible for dynamic execution of SQL statements at design time with rollback capabilities.
从性能的角度来看,动态sql语句只需要准备一次就可以执行多次,可以重用相同的数据库访问计划。
From the performance perspective, dynamic SQL statement can be prepared once and executed multiple times, reusing the same database access plan.
如果访问级别是MODIFIESSQLDATA,那么它在触发器、动态合成语句、sql体函数中或在创建保存点时会阻塞,并返回原因码为22的错误SQL 30090。
IF it has MODIFIES SQL DATA, it is blocked in triggers, dynamic compound statements, SQL-bodied functions, or when a save point has been created, and error SQL30090 with reason code 22 is returned.
使用FLUSHPACKAGE命令来删除包缓存器中当前所有缓存的动态sql语句,并强制隐式地编译下一请求。
Use the FLUSH package command to remove all cached dynamic SQL statements currently in the package cache and force the next request to be implicitly compiled.
这时使用默认的NULLID包集来执行动态sql语句。
The default NULLID package set is used to execute dynamic SQL statements.
特殊寄存器CURRENTSCHEMA包含默认的限定符,用于对特定DB 2连接中发出的动态sql语句所引用的未限定对象进行限定。
The CURRENT SCHEMA special register contains the default qualifier to be used for unqualified objects referenced for dynamic SQL statements issued from within a specific DB2 connection.
每个jdbc调用在性质上是动态的,要求在运行时分析和优化sql语句。
Each JDBC call is dynamic in nature and requires the SQL statement to be parsed and optimized at run time.
对于DB 29和动态sql,也可以通过一个全局或语句级别的优化配置来指定REOPT ALWAYS。
With DB2 9 and dynamic SQL, REOPT ALWAYS can also be specified through a global - or statement-level optimization profile.
包缓存器设置数据库全局内存的总量以用于缓存程序包的静态和动态sql语句。
The package cache sets the amount of database global memory to be used for caching a package's static and dynamic SQL statements.
对于动态sql语句,授权针对每个语句进行。
For dynamic SQL statements, authorization takes place on a per statement basis.
根据绑定选项和sql语句是静态还是动态,存储过程引用到的各对象可能需要更多的特权。
Additional privileges may be required on individual objects being referenced by the stored procedure, depending on the bind options and whether the SQL statement is static or dynamic.
动态sql语句自动使用这些更新的统计数据。
Dynamic SQL statements automatically use these updated statistics.
反之就是动态sql语句,其语法直到运行时才知道。
This is in contrast to a dynamic SQL statement, whose syntax is not known until run-time.
为动态sql语句设置重新优化(REOPT)级别。
Setting re-optimization (REOPT) level for dynamic SQL statements.
它还将该缺省值提供给用于动态sql语句的CURRENTFEDERATEDASYNCHRONY专用寄存器。
It also provides the default value to the CURRENT FEDERATED ASYNCHRONY special register for dynamic SQL statements.
首先,需要构造一个具有5个参数标记的动态sql语句。
First, we will compose a dynamic SQL statement with five parameter markers.
生成动态sql语句。
在这种情况下,在运行时解析子句,根据Opensql语句的静态部分和动态部分构造数据库调用。
In this case, the clause is parsed at runtime, and the call against the database is built up from the static and dynamic parts of the Open SQL statements.
应用推荐