All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
用SQL实现分页的三种方法_[SQL,Server教程]
Asp.Net的控件如何与Server交互_.net资料_编程技术
C#实现Word中表格信息读取_[Asp.Net教程]
String.Empty、NULL、“”的不同之处_[Asp.Net教程]
delphi工程选项及桌面配置文件(.dof)
Delphi位图组件(TBitMap)使用实例
如何用VS2005制作Web安装程序_[Asp.Net教程]
用ASP.NET2.0如何随机读取Access记录?_[Asp.Net教程]
PHP教程实例:用PHP脚本生成word文档的程序_php资料_编程技术
ASP.NET技巧:根据身份证判断性别和生日_.net资料_编程技术
Reading number is top 10 pictures
西班牙山村小景5
Wild animals melee moment of life and death2
Send some Valentine's day cartoon
星星命名法则
Discharge accidentally Actresses by the breast4
A man's favorite things4
2013中国四川省高考作文
A cat have life principles
战场废物1
人美胸美腿更美1
Download software ranking
matrix3
实战黑客不求人
WebService在.NET中的实战应用教学视频 → 第1集
JSP+Ajax Web development typical examples
Sora aoi - one of more PK
The king of fighters 97(Mobile phone games-apk)
jdk1.5
Boxer vs Yellow2
Unix video tutorial15
SP3 for SQL2000
delv published in(发表于) 2013/12/30 4:42:49 Edit(编辑)
动态SQL四种类型的语句格式_mssql学习_编程技术

动态SQL四种类型的语句格式_mssql学习_编程技术

动态SQL四种类型的语句格式_mssql学习_编程技术-你的首页-uuhomepage.com
1.Dynamic SQL Format 1
EXECUTE IMMEDIATE SQLStatement {USING TransactionObject} ;
eg:
string Mysql
Mysql = "CREATE TABLE Employee "&
+"(emp_id integer not null,"&
+"dept_id integer not null, "&
+"emp_fname char(10) not null, "&
+"emp_lname char(20) not null)"
EXECUTE IMMEDIATE :Mysql ;
2.Dynamic SQL Format 2
PREPARE DynamicStagingArea FROM SQLStatement {USING TransactionObject} ;
EXECUTE DynamicStagingArea USING {ParameterList} ;
eg:
INT Emp_id_var = 56
PREPARE SQLSA
FROM "DELETE FROM employee WHERE emp_id=?" ;
EXECUTE SQLSA USING :Emp_id_var ;
3.Dynamic SQL Format 3
DECLARE Cursor | Procedure DYNAMIC CURSOR | PROCEDURE FOR DynamicStagingArea ;
PREPARE DynamicStagingArea FROM SQLStatement {USING TransactionObject} ;
OPEN DYNAMIC Cursor {USING ParameterList} ;
EXECUTE DYNAMIC Procedure {USING ParameterList} ;
FETCH Cursor | Procedure INTO HostVariableList ;
CLOSE Cursor | Procedure ;
eg:
integer Emp_id_var
DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA ;
PREPARE SQLSA FROM "SELECT emp_id FROM employee" ;
OPEN DYNAMIC my_cursor ;
FETCH my_cursor INTO :Emp_id_var ;
CLOSE my_cursor ;
4.Dynamic SQL Format 4
DECLARE Cursor | Procedure DYNAMIC CURSOR | PROCEDURE FOR DynamicStagingArea ;
PREPARE DynamicStagingArea FROM SQLStatement {USING TransactionObject} ;
DESCRIBE DynamicStagingArea INTO DynamicDescriptionArea ;
OPEN DYNAMIC Cursor | Procedure USING DESCRIPTOR DynamicDescriptionArea ;
EXECUTE DYNAMIC Cursor | Procedure USING DESCRIPTOR DynamicDescriptionArea ;
FETCH Cursor | Procedure USING DESCRIPTOR DynamicDescriptionArea ;
CLOSE Cursor | Procedure ;
eg:
string Stringvar, Sqlstatement
integer Intvar
Sqlstatement = "SELECT emp_id FROM employee"
PREPARE SQLSA FROM :Sqlstatement ;
DESCRIBE SQLSA INTO SQLDA ;
DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA ;
OPEN DYNAMIC my_cursor USING DESCRIPTOR SQLDA ;
FETCH my_cursor USING DESCRIPTOR SQLDA ;
// If the FETCH is successful, the output
// descriptor array will contain returned
// values from the first row of the result set.
// SQLDA.NumOutputs contains the number of
// output descriptors.
// The SQLDA.OutParmType array will contain
// NumOutput entries and each entry will contain
// an value of the enumerated data type ParmType
// (such as TypeInteger!, or TypeString!).
CHOOSE CASE SQLDA.OutParmType[1]
CASE TypeString!
Stringvar = GetDynamicString(SQLDA, 1)
CASE TypeInteger!
Intvar = GetDynamicNumber(SQLDA, 1)
END CHOOSE
CLOSE my_cursor ;




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.