![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Im having trouble de-activating a task (DTSStep_DTSDataPumpTask_1) if a certain datasource has no data in it. The error which i am getting is: Invalid Step Result Value. Could anyway help? Raj This is the script i am executing: Function Main() Dim oFSO, File, oStep, oPkg, oDataPump File = DTSGlobalVariables.Parent.Connections("D2RL Copy").DataSource Set oFSO = CreateObject("Scripting.FileSystemObject") Set oPkg = DTSGlobalVariables.Parent Set oStep = oPkg.Steps("DTSStep_DTSDataPumpTask_1") If oFSO.FileExists(File) Then msgbox "exists" If oFSO.GetFile(File).Size > 0 Then Main = DTSStepExecResult_Success Else msgbox "file is empty" ' Update the following task's precedence constraint ' - Execution status of inactive 'the precedence for both PBasis and Value is set to 0 msgbox(oStep.PrecedenceConstraints(1).PrecedenceBa sis) msgbox(oStep.PrecedenceConstraints(1).Value) oStep.PrecedenceConstraints(1).PrecedenceBasis = _ DTSStepPrecedenceBasis_ExecResult oStep.PrecedenceConstraints(1).Value = _ DTSStepExecStat_Inactive End If Else Main = DTSStepScriptResult_DontExecuteTask End If Set oFSO = Nothing End Function |
#3
| |||
| |||
|
|
Hi, Im having trouble de-activating a task (DTSStep_DTSDataPumpTask_1) if a certain datasource has no data in it. The error which i am getting is: Invalid Step Result Value. Could anyway help? Raj This is the script i am executing: Function Main() Dim oFSO, File, oStep, oPkg, oDataPump File = DTSGlobalVariables.Parent.Connections("D2RL Copy").DataSource Set oFSO = CreateObject("Scripting.FileSystemObject") Set oPkg = DTSGlobalVariables.Parent Set oStep = oPkg.Steps("DTSStep_DTSDataPumpTask_1") If oFSO.FileExists(File) Then msgbox "exists" If oFSO.GetFile(File).Size > 0 Then Main = DTSStepExecResult_Success Else msgbox "file is empty" ' Update the following task's precedence constraint ' - Execution status of inactive 'the precedence for both PBasis and Value is set to 0 msgbox(oStep.PrecedenceConstraints(1).PrecedenceBa sis) msgbox(oStep.PrecedenceConstraints(1).Value) oStep.PrecedenceConstraints(1).PrecedenceBasis = _ DTSStepPrecedenceBasis_ExecResult oStep.PrecedenceConstraints(1).Value = _ DTSStepExecStat_Inactive End If Else Main = DTSStepScriptResult_DontExecuteTask End If Set oFSO = Nothing End Function |
#4
| |||
| |||
|
|
"Raj" wrote: Hi, Im having trouble de-activating a task (DTSStep_DTSDataPumpTask_1) if a certain datasource has no data in it. The error which i am getting is: Invalid Step Result Value. Could anyway help? Raj This is the script i am executing: Function Main() Dim oFSO, File, oStep, oPkg, oDataPump File = DTSGlobalVariables.Parent.Connections("D2RL Copy").DataSource Set oFSO = CreateObject("Scripting.FileSystemObject") Set oPkg = DTSGlobalVariables.Parent Set oStep = oPkg.Steps("DTSStep_DTSDataPumpTask_1") If oFSO.FileExists(File) Then msgbox "exists" If oFSO.GetFile(File).Size > 0 Then Main = DTSStepExecResult_Success Else msgbox "file is empty" ' Update the following task's precedence constraint ' - Execution status of inactive 'the precedence for both PBasis and Value is set to 0 msgbox(oStep.PrecedenceConstraints(1).PrecedenceBa sis) msgbox(oStep.PrecedenceConstraints(1).Value) oStep.PrecedenceConstraints(1).PrecedenceBasis = _ DTSStepPrecedenceBasis_ExecResult oStep.PrecedenceConstraints(1).Value = _ DTSStepExecStat_Inactive End If Else Main = DTSStepScriptResult_DontExecuteTask End If Set oFSO = Nothing End Function If (parameter = desired_results) Then Main = DTSTaskExecResult_Success else Main = DTSTaskExecResult_Failure end if set your workfloe arrows to something on failure and on another for success |
![]() |
| Thread Tools | |
| Display Modes | |
| |