2008年03月14日 星期五 16:00
adodbapiÅöµ½µÄÎÊÌâ CREATE TABLE [dbo].[test] ( [id] [int] IDENTITY (1, 1) NOT NULL , [name] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL , [flag] [int] NOT NULL ) ON [PRIMARY] insert into test(name) values ('asdfaf') insert into test(name) values ('³ÁÓàÂäÑÏ') ´æ´¢¹ý³Ì CREATE procedure xp_testnextset as select top 1 * from test where flag=1 --update test set flag=0 select top 2 * from test GO ÔÚpythonÖе÷Óùý³ÌÈçÏ import adodbapi db=adodbapi.connect("Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=pubs;Data Source=127.0.0.1;") crsr = db.cursor() crsr.callproc('xp_testnextset') crsr.fetchall() crsr.nextset() crsr.fetchall() ÔËÐнá¹ûÄÜÕý³£ÏÔʾÁ½¸ö½á¹û¼¯µÄÊý¾Ý Èô½«´æ´¢¹ý³ÌÖеÄupdateÒ»¾äÈ¥µô×¢ÊÍ£¬ÔòÔÚcrsr.nextset()ºóµÄcrsr.fetchall()Ò»¾äÒì³£³ö´í£¬ËÄÜ°ïÖú·ÖÎöһϠ-------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20080314/562dce09/attachment.htm
Zeuux © 2024
京ICP备05028076号