October 30, 2009 at 2:30 pm
Hello all,
I have an integer variable in my package called DaysToRun. I need to use this variable in a script component as a source to create the number of rows in the variable. Unfortunately I can only use the variable in the postexecute which is useless to me. How can I create a dataflow in the script component when I need the variable to determine how many rows to create?
Thanks,
Strick
October 30, 2009 at 11:28 pm
Strick,
I'm not clear on what you're trying to do here. Could you post some more information about what you're trying to accomplish?
hth,
Tim
Tim Mitchell
TimMitchell.net | @tmitch.net | Tyleris.com
ETL Best Practices
October 31, 2009 at 7:52 am
Hi thanks for your response,
Sure, basically I have a variable called DaysToRun which will be supplied externally. This variable will be responsible telling the script componend (as a source) the number of days to create which will be used in a subsequent task. So, what I'm looking to take the variable and loop the number of times of the variable while adding some date information to the OutputRows.
I have no issues with doing this. The problem I'm having is that the script component will only let you use variables in the PostExecute section which is after the OutPutrows process has run.
Thanks,
Strick
October 31, 2009 at 8:51 pm
What happens when you define the variable you want to use in the ReadOnlyVariables property? You should not have problems reading variables before output rows. Only writing to variables will probably impose the limitation to access only in PostExecute.
October 31, 2009 at 11:00 pm
Hi, unfortunately whether it's read or write won't matter. I'll still get the error stating this must be done in the PostExecute section.
Strick
November 1, 2009 at 12:23 am
stricknyn (10/31/2009)
Hi, unfortunately whether it's read or write won't matter. I'll still get the error stating this must be done in the PostExecute section.Strick
Do not set ReadOnlyVariables property. Then use the base class VariableDispenser member to LockForRead -> Get Value -> Unlock .
Let us know how it goes.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply