Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


ProcessInput() method


ProcessInput() method

Author
Message
venus.pvr
venus.pvr
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 558
Hi,

I have a requirement to see if any rows are present in the input. If they exist, I just have to set a uservariable to true and exit.
Even if there are input rows, when I run the below I see 2 msg boxes, one with value true and other with false. And finally my uservariable is set as false. Why does it get called twice? How can I fix this?

Dim bool As Boolean
Public Overrides Sub Input0_ProcessInput(ByVal buffer As Input0Buffer)
bool = buffer.NextRow
MsgBox("Case1:" & bool)
End Sub

Public Overrides Sub PostExecute()
MyBase.PostExecute()
Me.Variables.case1 = bool
End Sub

Thanks and Regards,
Praveena
venus.pvr
venus.pvr
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 558
Please let me know if you need more information or if my question wasn't clear. Anyone pls reply.
Can anyone please try and let me know if you have the same problem.
herladygeekedness
herladygeekedness
Old Hand
Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)

Group: General Forum Members
Points: 318 Visits: 813
venus.pvr (10/3/2012)
Hi,

I have a requirement to see if any rows are present in the input. If they exist, I just have to set a uservariable to true and exit.
Even if there are input rows, when I run the below I see 2 msg boxes, one with value true and other with false. And finally my uservariable is set as false. Why does it get called twice? How can I fix this?

Dim bool As Boolean
Public Overrides Sub Input0_ProcessInput(ByVal buffer As Input0Buffer)
bool = buffer.NextRow
MsgBox("Case1:" & bool)
End Sub

Public Overrides Sub PostExecute()
MyBase.PostExecute()
Me.Variables.case1 = bool
End Sub

Thanks and Regards,
Praveena


If this is script component used as a tranformation, Input0_ProcessInput will be called for each row, this could explain it running twice.

Not sure how you will get it to fire for no rows? You might be better served with a row count component.
venus.pvr
venus.pvr
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 558
thank you very much for the response. I found the below post which gives details of how ssis sends data in multiple buffers. ProcessInput method is called once for each buffer.
http://stackoverflow.com/questions/435487/ssis-processinput-in-pipelinecomponent-gets-called-more-than-once

getting the rowcount seems to be a more valid souution.

thanks again
herladygeekedness
herladygeekedness
Old Hand
Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)

Group: General Forum Members
Points: 318 Visits: 813
I know what that link said, but I can absolutely confirm that when I use script component as a transform that it is called Per Input Row, not per buffer.
venus.pvr
venus.pvr
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 558
herladygeekedness (10/9/2012)
I know what that link said, but I can absolutely confirm that when I use script component as a transform that it is called Per Input Row, not per buffer.

Are you sure it is not ProcessInputRow() that is called per row? I was using the ProcessInput() method.
herladygeekedness
herladygeekedness
Old Hand
Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)

Group: General Forum Members
Points: 318 Visits: 813
whew, ok, yes, Thank You, and pardon my adding confusion!

I have used ProcessInputROW plenty of times, that's what is stuck in my head.

Sorry !
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search