我正在编写一个脚本来提取/更新MsSQL服务器,我可以让我的一个存储过程调用工作但不是我在updateDB函数中的第二个.这是我的代码脚本运行正常没有错误代码
import pyodbc
import json
import argparse
import cgi, cgitb
#GLOBALS
BUILDCODE = " "
deptCODE = 0
bldgCODE = " "
def getCodes(conn, building, department):
#just for testing
departmentt = 'COMPUTER SCIENCE'
buildingt = 'PEARCE HALL'
#geting the building code from db
cursorBuild = conn.cursor()
cursorBuild.execute("select * from dbo.building where name = '%s'" % buildingt)
bldgRow = cursorBuild.fetchall()
cursorBuild.close()
bldgCode = bldgRow.pop(0)
global bldgCODE
bldgCODE = bldgCode.code
#getting the dept code
cursorDept = conn.cursor()
cursorDept.execute("execute dbo.GetCode_ByDepartment @department = '%s'" …Run Code Online (Sandbox Code Playgroud)