List of variables in SSIS 2005

  • Hello,

     

    I work on SSIS 2005I and I would like to know how given SSIS the order of passage of a variable.

    Indeed, for example, I replace the parameters of the following request:

     

    SELECT MAR_VAL_CRI FROM INT_MAR_EXP_PAR

    WHERE MAR_COD_FLX = 'PNL'

    AND MAR_COD_TAB = 'SAS_TRC_REF_RSC'

    AND MAR_LAB_CRI = 'CODE SERVICE1'

    AND MAR_COD_TYP = 'I'

     

    by points of interrgations (?) => So that it takes into account variables

     

    SELECT MAR_VAL_CRI FROM INT_MAR_EXP_PAR

    WHERE MAR_COD_FLX = '?'

    AND MAR_COD_TAB = '?'

    AND MAR_LAB_CRI = '?'

    AND MAR_COD_TYP = '?'

     

    However when I affect each parameter (Parametre0=Variable0;Parametre1=Variable1; Parametre2=Variable2; Parametre3=Variable3 with my variables, SSIS does not follow the order of affection, but an order which is clean for him.

     

    When there is only one variable, SSIS goes very well, on the other hand from 2, it goes less better and 3 he goes any more. I think that it must inevitably exist a solution to use several variables and thus to leave the choice to the user (with a table which will contain the list of choice.

     

    Thank you in advance

  • Hi,

    I assume that you are using an Execute SQL Task and an OLEDB Connection Manager. In the SQL statement that you have given above the ? placeholders should not be included within quotes. The SQL should actually look lie this:

    SELECT MAR_VAL_CRI FROM INT_MAR_EXP_PAR

    WHERE MAR_COD_FLX = ?

    AND MAR_COD_TAB = ?

    AND MAR_LAB_CRI = ?

    AND MAR_COD_TYP = ?

    And also, when you assign variables to parameters you should name the parameters as 0, 1, 2, ... and so on, and in the SQL statment the first ? would be referred to by 0, the second ? with 1 and so on.

    Please let me know if I have conceived your problem correctly, and if you were able to solve it.

    Regards,

    Gogula

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

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