Lookup works, ActiveX VBScript fails

  • When I execute the transform step I get this...

    Error: ActiveX Scripting Transform 'sr_user_cvt' does not allow a script to change source columns.

    My lookup, as follows, gives exactly the results I would expect when I manually enter the 2 parameters.

    SELECT USER_ID_LOG.user_id

    FROM   USER_ID_LOG

    INNER JOIN

       USER_CVT ON USER_ID_LOG.user_id = USER_CVT.user_id

    INNER JOIN

       v_Cust_Order_tmp_orphans ON USER_CVT.principal =    v_Cust_Order_tmp_orphans.princ AND

       USER_CVT.source_id = v_Cust_Order_tmp_orphans.co_sls_rep_id

    WHERE    

    (v_Cust_Order_tmp_orphans.co_sls_rep_id = ?) AND (v_Cust_Order_tmp_orphans.princ = ?)

    My ActiveX VBScript, as follows, fails

    Function Main()

     dim MYuser_id

     DTSSource("cust_disc_code") = DTSDestination("cust_disc_code")

     DTSSource("co_sls_rep_id") = DTSDestination("co_sls_rep_id")

     DTSSource("co_territory") = DTSDestination("co_territory")

     DTSSource("coln_commodity_code") = DTSDestination("coln_commodity_code")

     DTSSource("coln_product_code") = DTSDestination("coln_product_code")

     DTSSource("coln_part_id") = DTSDestination("coln_part_id")

     DTSSource("princ") = DTSDestination("princ")

     DTSSource("com_amt_co") = DTSDestination("com_amt_co")

     DTSSource("co_cust_id") = DTSDestination("co_cust_id")

     DTSSource("coln_qty") = DTSDestination("coln_qty")

     DTSSource("coln_amount") = DTSDestination("coln_amount")

     DTSSource("co_line") = DTSDestination("co_line")

     DTSSource("co_id") = DTSDestination("co_id")

     DTSSource("co_order_date") = DTSDestination("co_order_date")

     

     MYuser_id = DTSLookups("sr_cvt").Execute(DTSSource("co_sls_rep_id","princ"))

     DTSDestination("user_id") = MYuser_id(0)

     Main = DTSTransformStat_OK

    End Function

    I can't find any docs on specifying 2 parameters into a lookup, so I had to guess.  It parses out fine.  Any ideas would be most appreciated.

  • This was removed by the editor as SPAM

  • As your select statement has only one column you cannot rereference it inside the script as MYuser_id(0) as it is not an array. Use MYuser_id instead.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply