Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split one value in Source in multiple records in destination

Status
Not open for further replies.

williamwhite

Programmer
Nov 3, 2003
13
NL
Hello,

As a Newbee I have the following question.

I have a record list like:

wwit
ppiet
rron

Through the DTS I want to come to the following situation with jscript:

wwit 1 name
wwit 2 string1
wwit 3 prompt
ppiet 1 name
ppiet 2 string1
ppiet 3 prompt
rron 1 name
rron 2 string1
rron 3 prompt

I tried the following script:

//**********************************************************************
// Java Transformation Script
//************************************************************************

// Copy each source column to the destination column
function Main()
{
DTSDestination("name") = DTSSource("NAME");
DTSDestination("record_number") = 1;
DTSDestination("namesprgn") = "name";
(DTSTransformStat_SkipFetch);

DTSDestination("name") = DTSSource("NAME");
DTSDestination("record_number") = 2;
DTSDestination("namesprgn") = "prompt";
(DTSTransformStat_SkipFetch);

DTSDestination("name") = DTSSource("NAME");
DTSDestination("record_number") = 3;
DTSDestination("namesprgn") = "string1";
return(DTSTransformStat_OK);



}

The result is:

wwit 3 prompt
ppiet 3 prompt
rron 3 prompt.

Whatever i try I get or only the first line or just the third line.

I must possible is simply but i cannot get it right

gr Willie de Wit


 
I would almost say that it looks like the transform is not being performed until the "return" is executed. At that point it will do the transform with the last values set in your code. Although, looking at your code it is a confusing to me why "3" and "prompt" are paired in your output.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top