DB2 for Z/os Statement prepare

醉酒当歌 提交于 2020-03-15 09:29:48

The PREPARE statement creates an executable SQL statement from a string form of the statement. The character-string form is called a statement string. The executable form is called a prepared statement.

Invocation

This statement can only be embedded in an application program. It is an executable statement that cannot be dynamically prepared. It must not be specified in Java.

Authorization

The authorization rules are those defined for the dynamic preparation of the SQL statement specified by the PREPARE statement. For example, see Queries for the authorization rules that apply when a SELECT statement is prepared.

The statement that is prepared using only the EXPLAIN privilege cannot be executed, and only the descriptive information can be obtained for that statement.

Syntax

Read syntax diagram
>>-PREPARE--statement-name-------------------------------------->

>--+----------------------------------------------+------------->
   '-INTO--descriptor-name--+-------------------+-'   
                            |        .-NAMES--. |     
                            '-USING--+-LABELS-+-'     
                                     +-ANY----+       
                                     '-BOTH---'       

>--+-+------------------------------------+--FROM--host-variable-+-><
   | |                                (1) |                      |   
   | '-ATTRIBUTES--attr-host-variable-----'                      |   
   |                         (2)                                 |   
   '-FROM--string-expression-------------------------------------'  

https://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/sqlref/src/tpc/db2z_sql_prepare.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!