![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Here's my objective in pseudo-code: if table.comment2 LIKE '@' and table.email ( IS NULL OR ='' ) then copy comment2 to email If I did this in VB script, I would invoke a recordset object and step through each row, comparing the two columns. I was hoping that DTS transforms would assume a row-by-row operation, but I suspect that isn't the case. Here's my ActiveX Script: ' Copy each source column to the destination column Function Main() Dim x, srcCmnt, dstEmail dstEmail = DTSDestination("email") srcCmnt = DTSSource("comment2") If IsNull (srcCmnt) Then Main = DTSTransformStat_OK Exit Function End If For x=1 to Len (srcCmnt) If Mid ( srcCmnt , x , 1 ) = "@" Then If ( IsNull (dstEmail) Or dstEmail="" ) Then DTSDestination("email") = DTSSource("comment2") End If End If Next Main = DTSTransformStat_OK End Function It doesn't do anything! Can someone point me in the right direction? Is there a DTS equivalent of the recordset object? I've heard something about a 'datapump'. I'd love some keywords with which to search the help, or some lines of code if I'm almost there. Thanks in advance! |
#3
| |||
| |||
|
|
Here's my objective in pseudo-code: if table.comment2 LIKE '@' and table.email ( IS NULL OR ='' ) then copy comment2 to email If I did this in VB script, I would invoke a recordset object and step through each row, comparing the two columns. I was hoping that DTS transforms would assume a row-by-row operation, but I suspect that isn't the case. Here's my ActiveX Script: ' Copy each source column to the destination column Function Main() Dim x, srcCmnt, dstEmail dstEmail = DTSDestination("email") srcCmnt = DTSSource("comment2") If IsNull (srcCmnt) Then Main = DTSTransformStat_OK Exit Function End If For x=1 to Len (srcCmnt) If Mid ( srcCmnt , x , 1 ) = "@" Then If ( IsNull (dstEmail) Or dstEmail="" ) Then DTSDestination("email") = DTSSource("comment2") End If End If Next Main = DTSTransformStat_OK End Function It doesn't do anything! Can someone point me in the right direction? Is there a DTS equivalent of the recordset object? I've heard something about a 'datapump'. I'd love some keywords with which to search the help, or some lines of code if I'm almost there. Thanks in advance! |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |