这是 Python 用来连接 Sybase 数据库的模块。
示例代码:
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')