我有一個簡單的 SQL 文件,我想在 SnapLogic 中使用 Python Script Snap 讀取和執行該文件。我創建了一個表達式庫文件來引用 Redshift 帳戶,并將其作為參數包含在管道中。我從另一篇文章中獲得了以下代碼。有沒有辦法引用管道參數連接到Redshift數據庫,讀取上傳的SQL文件并執行命令?fd = open('shared/PythonExecuteTest.sql', 'r')sqlFile = fd.read()fd.close()sqlCommands = sqlFile.split(';')for command in sqlCommands: try: c.execute(command) except OperationalError, msg: print "Command skipped: ", msg
添加回答
舉報
0/150
提交
取消