dbTalk Databases Forums  

Type Mismatch: DTSLookups?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Type Mismatch: DTSLookups? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dave
 
Posts: n/a

Default Type Mismatch: DTSLookups? - 04-10-2005 , 08:21 PM






I have Transform Data Task that I want to Lookup some company values from
another database based on a code from the source and insert them into the
destination

Under the Transform, Workflow Properties, Options, Use ActiveX script
checkbox I have my code to call the Lookup below, but I keep getting the type
mismatch error. I even commented out everything and tried to set the
destination to a dummy string but still get type mismatch.

Is this the correct place to put the ActiveX Script during the transform? I
would really like a good step-by-step guide of how to do this. Thanks, Dave.

Function Main()
dim varArray
varArray = DTSLookups("GetCompanyValues").Execute(DTSSource(" CoId").Value)
DTSDestination("Ticker") = varArray(0)
DTSDestination("Region") = varArray(1)
Main = DTSStepScriptResult_ExecuteTask
End Function


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Type Mismatch: DTSLookups? - 04-11-2005 , 12:45 AM






This Active X Script happens before the task so you can do some poking
around and not during the transform. It also happens only once. At
this stage the source and destination columns are not known I don't
think.

You should put this code in an Active Script transform.



"Dave" <Dave (AT) discussions (DOT) microsoft.com> wrote


Quote:
I have Transform Data Task that I want to Lookup some company values from
another database based on a code from the source and insert them into the
destination

Under the Transform, Workflow Properties, Options, Use ActiveX script
checkbox I have my code to call the Lookup below, but I keep getting the type
mismatch error. I even commented out everything and tried to set the
destination to a dummy string but still get type mismatch.

Is this the correct place to put the ActiveX Script during the transform? I
would really like a good step-by-step guide of how to do this. Thanks, Dave.

Function Main()
dim varArray
varArray = DTSLookups("GetCompanyValues").Execute(DTSSource(" CoId").Value)
DTSDestination("Ticker") = varArray(0)
DTSDestination("Region") = varArray(1)
Main = DTSStepScriptResult_ExecuteTask
End Function


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.