0

I am trying to using a python script using the "Execute Task" tool in ssis.However, i am not sure if i will be able to use one of the runtime variable inside the python script. Eg:

#inputval.py

inputval = dts.value("test").toString()
print(inputval)

Is there any chance ? . Thanks in advance for the help.

1 Answer 1

1

Yes you can reference the value but not in that manner.

Python won't have access to the Variables collection so you'll have to use a different method for communication. The Execute Package Task supports either a Variable for Standard Input or for Arguments. Either one should work

Within your python script, you'll need to work with the sys.argv collection (code approximate based on 2.7 recollections with 3.0 print flair)

for inputval in sys.argv:
    print (inputval)

or skipping the first element, we'd have something like

# we can skip the first element since that is name of script
for inputval in sys.argv[1:]
    print (inputval)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.