Sybase module for Python
這是 Python 用來連接 Sybase 數(shù)據(jù)庫(kù)的模塊。
示例代碼:
import sys, string, Sybase
db = Sybase.connect('SYBASE', 'sa', '', 'sybsystemprocs')
c = db.cursor()
if len(sys.argv) > 1:
c.execute('select c.text from syscomments c, sysobjects o'
' where o.name = @name and o.type = "P" and c.id = o.id'
' order by c.colid', {'@name': sys.argv[1]})
print string.join([row[0] for row in c.fetchall()], '')
else:
c.execute('select name from sysobjects where type = "P" order by name')
print string.join([row[0] for row in c.fetchall()], '\n')
評(píng)論
圖片
表情
