Solved

Data Type mismatch in Transformation

Posted on 2003-12-09
3
634 Views
Last Modified: 2007-12-19
Hey Folks,

I rather new at DTS packages, so here goes...

I have an XL spreadsheet that I am trying to load into MSSQL2000.

most of the transformations are straight column copy.

I have one transformation that does a lookup, named 'CycleNo'.  here is my SQL for the lookup

SELECT     Cycle
FROM         CC_EachCycleInfo
WHERE     (SAPCustNo = ?)
ORDER BY Cycle DESC

here is vbscript for the transform

Function Main()
  DTSDestination("CycleNo") =     DTSLookups("CycleNo").Execute( DTSSource("SAPCustNo"))
  Main = DTSTransformStat_OK
End Function

when I test the transformation I get a 'data type mismatch in criteria expression' error

data type for DTSSource("SAPCustNo") is Long (this is from the tooltip you get when hovering over the fieldname of the transformations tab in the transform data task properties window.)

data type for  DTSDestination("CycleNo") is BIGINT

if I hardcode DTSSource("SAPCustNo") like ...

DTSDestination("CycleNo") =     DTSLookups("CycleNo").Execute(10266)

then it works


I have another transformation that is displaying the same symptoms, but If I can get this working then I can probably get the other one working.

'====================================================================
PART II

on another note.  I am also using a few global variables, but when I specify the data types in the 'global variables' tab of the Edit DTS Package dialog my changes dont seem to get saved.  i.e. I have a GlobVar named SAPCustNo that is set to 'STRING'  when I change it to 'INTEGER', Save/Exit and Edit the package again, the data types for all my GlobVars are set to string again.  ARGHH!!

does anyone have any ideas on this?
0
Comment
Question by:DialM4Monkey
3 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 300 total points
ID: 9908430
long and bigint are different datatypes.  wrap your DTSDestination("CycleNo") with a clng function:


Function Main()
  DTSDestination("CycleNo") =     DTSLookups("CycleNo").Execute(clng( DTSSource("SAPCustNo")))
  Main = DTSTransformStat_OK
End Function


On your Global variable problem, right click anywhere on "white space" inside your package and choose "disconnected edit".  Search the dts properties for your global data types and change them there--you might have more luck.
Brett
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
need help in sql 4 63
SQL Query 34 79
datetime in sql 6 22
Updating a table from a temp table 4 23
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now