这是Python用来连接Sybase数据库的模块。
示例代码:
importsys,string,Sybasedb=Sybase.connect('SYBASE','sa','','sybsystemprocs')c=db.cursor()iflen(sys.argv)>1:c.execute('selectc.textfromsyscommentsc,sysobjectso''whereo.name=@nameando.type="P"andc.id=o.id''orderbyc.colid',{'@name':sys.argv[1]})printstring.join([row[0]forrowinc.fetchall()],'')else:c.execute('selectnamefromsysobjectswheretype="P"orderbyname')printstring.join([row[0]forrowinc.fetchall()],'\n')
评论