SSIS: How to use one Variable as Input and Output Parameter in an Execute SQL Task

Hello,
i need your help,I'm working on this issue since yesterday and have no idea how to deal with it.
As I already said in the tilte i want to start a stored procedure via a Execute SQL Task which has around 15 prameters. 10 of these should be used as input AND output value.
As an example:
i have three  Variable:
var1    int        2
var2    int     100
var3    int     200
the stroed procedure:
   sp_test
      @var1 int
      @var2 int output
      @var3 int output
   AS
   BEGIN
        SET @var2 = @var2 * @var1
        SET @var3 = @var3 + @var1
   END
So in the Execute SQL Task i call the Stored Procedure as follwos:
    Exec sp_test  @var1 = ?, @var2 = ? output, @var3 = ? output
(I use an OLE DB Connection)
The parameter mapping is as follows:
User::Var1        input                   numeric              0                 -1
User::Var2        input/output         numeric              1                 -1
User::Var3        input/output         numeric              2                 -1
Now my problem. If i set  Var2 and Var3 as Input parameter the values are still the same after running the package. If i set them to a output value the are both Null because the procedure doesnt get any values.
I already tried to list them a second time - like
    User::Var2        input                  numeric              1                 -1
    User::Var2        output                 numeric              1                 -1
or i use a new variable
    User::Var2                  input                  numeric              1                 -1
    User::Var2Return        output                 numeric              1                 -1
but i alwas get the error
"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
Has anybody an idea how I can solve this problem?
Thanks a lot.
Kind Regards,
Alice

Hi Alain,
thx for your answer.
I have around 15 procedures called one after the other to calculated and modify my values. Each procedure is responsible for an other but overlapping set of variables. So i thought it would be a good idea to call them one after the other with the needed variables via a execute sql task.
So if i use a result set, how i get my stored procedure to return 10 values? I would have to use a Function instead of a procedure, wouldn't i?
As if i have 15 procedures this would be a lot of work.
But thanks a lot for the idea. I think an other idea would be to create one function which calls all stored procedures and returns all the calculated values as a result set, wouldn't it?.
Kind Regards.
Alice

Similar Messages

  • How to use a parameter in an Execute SQL Tasks in SSDT executed against Netezza

    Good Evening,
    How can I pass a parameter in an Execute SQL Tasks in SSDT executed against Netezza?  Below are my settings and error message.
    [Execute SQL Task] Error: Executing the query ""TRUNCATE TABLE" ?"_POC..JOHN_TEST"" failed with the following error: "Syntax error or access violation". Possible failure reasons: Problems with the query, "ResultSet"
    property not set correctly, parameters not set correctly, or connection not established correctly.
    Thank you in advance for your assistance.
    Brett

    Hi Baloun,
    Based on my further research, just as you said, we cannot directly use table name as a variable.
    To fix this issue, we can change the SQL command in the SQLStatement property as below:
    declare @sql varchar(100)
    set @sql = 'TRUNCATE TABLE ' + ? +'_POC..JOHN_TEST'
    exec(@sql)
    go
    The Parameter Mapping pane use the former settings in your picture.
    Reference:
    http://www.bidn.com/blogs/kylewalker/ssis/2063/parameters-don-t-always-work-in-your-execute-sql-task
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How do I return two values from a stored procedure into an "Execute SQL Task" within SQL Server 2008 R2

    Hi,
    How do I return two values from a
    stored procedure into an "Execute SQL Task" please? Each of these two values need to be populated into an SSIS variable for later processing, e.g. StartDate and EndDate.
    Thinking about stored procedure output parameters for example. Is there anything special I need to bear in mind to ensure that the SSIS variables are populated with the updated stored procedure output parameter values?
    Something like ?
    CREATE PROCEDURE [etl].[ConvertPeriodToStartAndEndDate]
    @intPeriod INT,
    @strPeriod_Length NVARCHAR(1),
    @dtStart NVARCHAR(8) OUTPUT,
    @dtEnd NVARCHAR(8) OUTPUT
    AS
    then within the SSIS component; -
    Kind Regards,
    Kieran. 
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Below execute statement should work along the parameter mapping which you have provided. Also try specifying the parameter size property as default.
    Exec [etl].[ConvertPeriodToStartAndEndDate] ?,?,? output, ? output
    Add a script task to check ssis variables values using,
    Msgbox(Dts.Variables("User::strExtractStartDate").Value)
    Do not forget to add the property "readOnlyVariables" as strExtractStartDate variable to check for only one variable.
    Regards, RSingh

  • How to use one variable as a default value for another variable?

    Hi Experts,
    Is it possible to use one variable as a default value for another variable?
    For example:
    Variable 1 = current calendar year month
    Variable 2 = mandatory input ready variable for calendar year month
    I want to use variable 1 as default value for variable 2, but also have the ability to change the month if required.
    Thanks!
    Kathryn

    u can use replacement path variable
    in that case u can replace the values of 1 variable with the another variable...
    but  u cannot do this setting
    u cannot make variable 2 as mandatory
    u cannot enter value for variable 2
    because by default it will take the value of variable 1
    u have to make follow settings
    variable 2
    name , technical name
    processing by = replacement path
    infoobject = ocalmonth
    next tab
    replaced by another variable
    variable name
    offset start , offset lenght
    save and hit okey

  • How to Create a Rich Dynamic Input and Output PDF to insert and get data into, from Database (MSSQL)

    HI ,
    I want to use Adobe LiveCycle Designer and Adobe LiveCycle Workbench features to create a Dynamic PDF form which can allow me to store data into database(MSSQL Server) and Can also provide me the Output PDF form with all the information which has been been filled in by the User in input form. Both Input and Output forms must be Dynamic. I am stuck in this process and Need Experts Advice on the Complete optimal process flow of the Adobe.
    Regards
    Ritesh Grover

    HI
    Go to the lay out of your screen and doublr click on the table control fields, you can get the Properties/Attribute of the screen or table control Fields
    Assing a Group GRP1 for all the fields i n the table control.
    in PBO
    if ok_code = 'INPUT'.
    LOOP AT SCREEN.
    IF screen-grp1 = 'GRP1'.
    screen-input = 1.
    modify screen.
    endif.
    ENDLOOP.
    elseif ok_code = 'OUTPUT'.
    LOOP AT SCREEN.
    if screen-grp1 = 'GRP1'.
    screen-input = 0.
    modify screen.
    endif.
    endloop.
    endif.
    Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Aug 8, 2009 5:27 AM

  • Passing the same input parameter twise in execute sql task

    Hi All, I want to insert some values to 3 different tables in sql server. Execute sql task is used to populate three tables. Here is the sql statement.
    DECLARE @Dt AS DATE
    SET @Dt = ?
    INSERT INTO TABLE1 SELECT ?, COL2, COL3 FROM TABLE_A
    INSERT INTO TABLE2 SELECT ?, COL2, COL3 FROM TABLE_B
    Input parameter is mapped as follows :
    Variable name : User::EffectiveDate
    Direction : Input Data Type :
    Date Parameter name :0
    Parameter size :-1
    User::EffectiveDate is datetime variable.
    When the package is executed, it throws an error.
    [Execute SQL Task] Error: Executing the query " " failed with the following error: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". Possible failure reasons: Problems
    with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. I am not sure what I am doing wrong here. If anyone could point me to the right direction, I really appreciate.
    Thanks
    shamen

    To expand on the other answers.
    Your SQL command
    DECLARE @Dt AS DATE
    SET @Dt = ?
    INSERT INTO TABLE1 SELECT ?, COL2, COL3 FROM TABLE_A
    INSERT INTO TABLE2 SELECT ?, COL2, COL3 FROM TABLE_B
    It using 3 input variables.  I assume you didn't pass 3 variables and you want @DT to be column 1 in each.  In that case you would use:
    DECLARE @Dt AS DATE
    SET @Dt = ?
    INSERT INTO TABLE1 SELECT @Dt, COL2, COL3 FROM TABLE_A
    INSERT INTO TABLE2 SELECT @Dt, COL2, COL3 FROM TABLE_B

  • How can I get my audio input and output devices back? I have no sound and cannot see any of the devices in Audio MIDI Setup..??

    Hi, I tried to set up a new output audio device on my mac that would have multiple outputs (iBox Twist speaker and my internal speaker) but when I went to click onto one of the iBox Twist (there were 2 options available: iBox Twist and iBox Twist Stereo), Audio MIDI Setup crashed and when I finally got that back open, I found that there were no audio input or output devices to be found. My sound is working, as when I turn on my iMac, the starting sound still plays, however the volume control in the menu bar is no longer a black colour, but grey and when I try to change the sound on my keyboard it does not change. This already happened to me once, and after 3 hours I managed to fix it very simply (switching off Mac, unplugging power cord, leaving for 15 seconds, plug power cord back in and switch Mac back on, holding Alt, Cmd, P and R keys until you hear the Starting Up sound twice) however this same technique that fixed it once before is not working this time and I am still stuck without sound. I have tried Repair Permissions, rebooting in Safe Mode, Hardware Test and checking for Software Updates. Has anyone else had this problem and managed to fix it?
    Thanks in advance for any help anyone can give me!

    In case anyone has had the same problem as me, I have just managed to fix this by doing the following:
    Switch off Mac
    Switch back on in Safe Mode (Hit power button, then hold Shift key until a loading bar appears at the bottom of the screen).
    Switch off Mac again
    Remove power cord and wait 15 seconds
    Plug power cord back in and hold down the keys alt, cmd, p, r all at the same time until you hear Starting chime for a second time and hopefully your audio will back.

  • Custom action with XML type input and output parameter.

    Hi,
    I want to develop custom action with xml type input and/or output parameter.
    Is there sample code for java side. How is the definition of input and/or output parameter and set/get methods?
    does it need special .jar file to develop custom action like this?
    Thanks.

    Cemil - yes, you can use XML data types.  Use the class
    com.sap.lhcommon.xml.XMLDataType
    for your parameter type.  Here is a snippet from a custom action we use to log XML (instead of just returning the #text node like the default logger does):
    public class XMLLogger extends ActionReflectionBase
        private String source;
        private String eventType;
        private String textMessage;
        private XMLDataType xmlMessage;
        public XMLLogger()
            log = new Logger("UserLog");
            source = DEFAULT_SOURCE;
            eventType = TYPE_INFO;
            textMessage = "";
            xmlMessage = new XMLDataType();
        public XMLDataType getXmlMessage()
            return xmlMessage;
        public void setXmlMessage(XMLDataType xmlMessage)
            this.xmlMessage = xmlMessage;
        public void Invoke(Transaction transaction, ILog ilog)
            StringBuffer sb = new StringBuffer();
            sb.append('[');
            sb.append(source);
            sb.append("] ");
            sb.append(textMessage);
            sb.append(XMLUtils.convertXmlToString(xmlMessage));
    XMLUtils is a helper class we wrote - it's just a bunch of standard Java XML boilerplate code.  The important part you need to know is XMLDataType.getDocument() will return an org.w3c.dom.Document.
    I hope that was enough information to help.
    -tim

  • Input and output parameter for subpanels

    Hi,
    i'm creating a measurement configuration tool within LabVIEW and i want
    to use subpanels for the several inputs/outputs (analog, digital...).
    The configuration data is hold within a data storage (variant) and
    contains all needed configuration parameters. Now i placed a subpanel
    control and needed stuff inside the block diagram of the wizard and i'm
    able to run it. Changes i made in that subpanels are lost currently
    because i'm not able to retrieve the output (connector) of the selected
    subpanel.
    Is there a way to exchange data over the connectors of the vi or do i
    have to use global variables in such a case? I hope i can avoid this.
    Thanks
    Henrik

    See the example in this recent posting. To get data from a subpanel, use Get Control Value or Get Control Value [Variant].

  • How to use one variable for 2 datatype inside class

    Dear all
    i have create 2 class GDI and OGL need use use in M_VIEW as per condition
    in the class M_VIEW (example below)
    #define M_FLAG 1
    class GDI {public: int z;};
    class OGL{public: double z;};
    // in class M_VIEWi need to use GDI or OGL as per user condition
    class M_VIEW{
    public:
    #if (M_FLAG == 1)
    GID UseThis;
    #else
    OGL UseThis;
    #endif
    this is work but it always it take OGL. of if i change condition it take GDI only. but i need to use it runtime as per user choice.
    how to switch GDI to OGL, and OGL to GDI on runtime ;
    is that possible to change M_FLAG  value on run time or is there any other way to achieve it.
    i have try with polymorphism also. switch is ok but all function does not work with dll. when call function on mouse move or some other event it take base class virtual function. it doesn't goes to derived class function. don't know why?
    base class function like this and does not have any variable. all function are virtual.
    virtual void MoveLine(POINT pt1, POINT pt2){};
    virtual void DrawLine(POINT pt1, POINT pt2){};
    please help.
    Thanks in Advance.

    Well, #define, and #if are compile time only constructs.  Technically they are processed before you program is compiled (that is why they are called preprocessor directives).  If you need to support both flavors at runtime you will need a different
    approach.
    Inheritance/polymorphism could be a good approach here, but I don't really understand what you are trying to do well enough to say for sure.  Based on guesses about what you want, here are some thoughts.
    class GDI {public: int z;};
    class OGL{public: double z;};
    class M_VIEW_BASE {
    virtual void MoveLine(POINT pt1, POINT pt2) = 0;
    virtual void DrawLine(POINT pt1, POINT pt2) = 0;
    class M_VIEW_GDI {
    GDI UseThis;
    void MoveLine(POINT pt1, POINT pt2) override {}
    void DrawLine(POINT pt1, POINT pt2) override {}
    class M_VIEW_OGL {
    OGL UseThis;
    void MoveLine(POINT pt1, POINT pt2) override {}
    void DrawLine(POINT pt1, POINT pt2) override {}
    std::unique_ptr<M_VIEW_BASE> drawBase;
    enum DrawMode { DrawGdi, DrawOgl };
    extern "C" __declspec(dllexport) void Init(DrawMode whichMode) {
    if (drawMode == DragGdi) {
    drawBase.reset(new M_VIEW_GDI);
    } else if (drawMode == DrawOgl) {
    drawBase.reset(new M_VIEW_OGL);
    } else {
    throw std::runtime_exception("whoops");
    extern "C" __declspec(dllexport) void MoveLine(POINT pt1, POINT pt2) {
    drawBase->MoveLine(pt1, pt2);
    extern "C" __declspec(dllexport) void DrawLine(POINT pt1, POINT pt2) {
    drawBase->DrawLine(pt1, pt2);

  • How to use one NIC for everything and the other to allow ssh from

    Hello,
    I have two internet connexion at home:
    - a cable connection (CABLEBOX) that i use for all of my devices as it's the fastest. All my computers are connected to it using ethernet or wifi.
    - an adsl connection (ADSLBOX) that is connect to the second network card of one of my computers (MEDIABOX) only and that i want to use only to ssh that same device from the outside
    I want that specific computer to use its:
    - NIC1 to connect to the LAN and to the internet. Routing is enabled on CABLEBOX.
    - NIC2 to connect to that device from the outside using ssh. ssh-D should also work through NIC2 as i need to be able to use that computer as a proxy on some occasions. Routing is enabled on ADSLBOX and it's set to port forward the port 22 to MEDIABOX.
    Once this will be working i'd like to also route ftp connections to specific ips by NIC2.
    No firewall is set on MEDIABOX yet, i'll do it later on.
    I know basics on how to set routing rules, how to assign a specific LAN to a network card but i have a hard time on deciding which rules i should set...
    Can someone guide me?
    Thanks in advance
    Last edited by parpagnas (2013-12-03 18:31:31)

    A possible solution might be this.
    On ADSLBOX and CABLEBOX configure different subnets for the LAN, e.g.
    ADSLBOX:    192.168.1.0/24
    CABLEBOX: 192.168.2.0/24
    The MEDIABOX gets these static IPs:
    ADSL-LAN: 192.168.1.2
    CABLE-LAN: 192.168.2.2
    On the MEDIABOX, configure the two network interfaces using two routing tables.
    The ADSL-LAN routing table
    ip route add 192.168.1.0/24 dev eth0 src 192.168.1.2 table 1
    ip route add default via 192.168.1.1 table 1
    The CABLE-LAN routing table
    ip route add 192.168.2.0/24 dev eth1 src 192.168.2.2 table 2
    ip route add default via 192.168.2.1 table 2
    The main routing table
    ip route add 192.168.1.0/24 dev eth0 src 192.168.1.2
    ip route add 192.168.2.0/24 dev eth1 src 192.168.2.2
    # use the CABLE-LAN gateway as default, so general internet traffic from MEDIABOX runs over CABLEBOX
    ip route add default via 192.168.2.1
    define the lookup rules
    ip rule add from 192.168.1.2 table 1
    ip rule add from 192.168.2.2 table 2
    To test the setup:
    ip route show
    ip route show table 1
    ip route show table 2
    I don't know how to persist something like this in ArchLinux using netctl. Might require to write a special systemd unit for it. Above is a working example from a RedHat box at my company.
    Last edited by teekay (2013-12-04 07:42:22)

  • Please Help - How to pass Table objects as input and output parameters using VC++

    Please help me by giving a sample code to call the procedure
    GetClassInstanceProperties from a VC++ application using
    Oracle Objects for OLE
    CREATE OR REPLACE TYPE TY_INST_ID_PROP_PAIR AS OBJECT
    (INST_ID CHAR(38), PROP_ID CHAR(38), VALUE XMLTYPE);
    CREATE OR REPLACE PACKAGE DBMS_PROPERTYSTORE
    AUTHID CURRENT_USER
    AS
         --Used to return the ids from the functions
         TYPE tt_UUIDs IS TABLE OF char(38) index by binary_integer;
         TYPE tt_inst_id_prop_pairs is table of ty_inst_id_prop_pair index by binary_integer;
         PROCEDURE GetClassInstanceProperties(ClassId IN char, Prop_Ids in TT_UUIDs,
    Inst_Id_Prop_Pairs out TT_Inst_Id_Prop_Pair);
    END DBMS_PROPERTYSTORE;
    CREATE OR REPLACE PACKAGE BODY DBMS_PROPERTYSTORE AS
         PROCEDURE GetClassInstanceProperties
              ClassId IN char,
              Prop_Ids in TT_UUIDs,
              Inst_Id_Prop_Pairs out TT_INST_ID_PROP_PAIR
         AS
         BEGIN
              --Return the instanceid,propertyid and values for a certain class
              --only return those properties that in the user supplied Prop_ids table
              FOR I in Prop_Ids.FIRST..Prop_Ids.LAST loop
                   select TY_Inst_Id_Prop_Pair(i.Inst_Id,p.Prop_Id,p.Value) into Inst_Id_Prop_Pairs(I)
                        from TBL_Instance i, table(Prop_Pairs) p
                        where I.Cls_Id.Cls_Id=ClassID
                        and p.Prop_Id = Prop_Ids(I);
              END LOOP;
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   raise_application_error(-20100, 'No data found');
              WHEN OTHERS THEN
                   raise_application_error(-20200, SQLERRM);
         END GetClassInstanceProperties;
    END DBMS_PROPERTYSTORE;

    HI
    Go to the lay out of your screen and doublr click on the table control fields, you can get the Properties/Attribute of the screen or table control Fields
    Assing a Group GRP1 for all the fields i n the table control.
    in PBO
    if ok_code = 'INPUT'.
    LOOP AT SCREEN.
    IF screen-grp1 = 'GRP1'.
    screen-input = 1.
    modify screen.
    endif.
    ENDLOOP.
    elseif ok_code = 'OUTPUT'.
    LOOP AT SCREEN.
    if screen-grp1 = 'GRP1'.
    screen-input = 0.
    modify screen.
    endif.
    endloop.
    endif.
    Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Aug 8, 2009 5:27 AM

  • Using SXMB_MONI to view input and output messages

    Within XI can I view both the input message and the output message ?
    I have an IDOC Order being transformed into XML format.  Using SXMB_MONI I can see the transaction and the input IDOC Order but cannot see the resulting output XML Order.  Is it possible to do or is there some other transaction?

    Hi,
    Check in SXMB_MONI for xml message it is appearing the pipeline steps , if not do the below setting to appearing piepline steps in moni.
    Tcode : SXMB_ADM
    Execute integration engine and configuration
    click on specific configuration
    go to change mode
    Category : RUNTIME
    Parameter :  LOGGING
    Current value : 1
    then save..test the scenario once again.
    now go to moni double click the message check the xml message has left hand side pipeline steps are appearing..
      Expand Inbound mesage -> Expand the Payloads -> Double maindocument you will find the input payload
      Expadn Technical routing -> Expand the Payloads -> Double maindocument you will find the output payload
      then you will find the output xml payload.
    Regards,
    Venu.

  • How to pass a parameter into execute sql task and later use it into dataflow task?

    i am in a situation, where i have a logging table in which i have a primary key called ETL_log_ID which is an identity column and acts as a foreign key for various fact table and dimension tables which are populated using SSIS packages. Now i wanna use the
    ETL_log_ID as a parameter in the execute sql task which populates the log table and pass the same value in the data flow task which populates the facts and dimension. Can you let me know how to pass the parameter in a step by step procedure.
    Thanks,
    Nikhil
      

    Nikhil,
    You can check the following :
    http://www.programmersedge.com/post/2013/03/05/ssis-execute-sql-task-mapping-parameters-and-result-sets.aspx
    http://stackoverflow.com/questions/7610491/how-to-pass-variable-as-a-parameter-in-execute-sql-task-ssis
    Regarding the usage in Dataflow task, Can you elaborate on that a little?
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Selecting separate input and output devices!

    hi, i have logic pro 8 and cant find out how to select separate devises for input and output!
    for my output (and input when recording drums) i use a alesis multimix 16 (16 track firewire desc) but for recording guitars and bass and poss vocals i would like to use my line 6 x3 live as my input devise but still using the alesis for monitoring.
    is this possible? cant figure how to do it.
    any help is great help! cheers, Dan

    In Logic 9 you can easily select different input and output devices in the Preferences Devices area. In Logic 8 you must create an aggregate device -
    http://support.apple.com/kb/HT1215
    JG

Maybe you are looking for

  • Assigning global variable to a bapi

    hi all, I have created 3 context node.. account1 with attribute bank-key account2 with attribute bank-country account3 with attribute accno. These 3 nodes are binded to 3 input fields, now on the click of the action m reading these 3 values individua

  • Why does the display on my 27" iMac keep going black?

    This seems to be happening very often now. It started with just every once in a while. I will be using my iMac and the display goes black. It does NOT go to sleep. Just the display goes black. I do video and audio editing on my iMac and if I am liste

  • Find exact RFC Destination for Multiple backend Systems In SAP Gateway

    Hi Gateway developers, I have requirement,if gateway hub system has multiple backend systems( for example two backend systems: ECC and SRM ) then  how  hub system can get the suitable backend alias for exact entity collection.. Here i have developed

  • Podcast won't import from Garageband

    Hi all Help appreciated with this. I do a two hour music podcast (www.whatyouwantradio.com also available at http://soundcloud.com/whatyouwant-radio) which is created in Garageband and then exported to iWeb for uploading to my website. I've been runn

  • Declare procedure to use in process flow

    Hi I am using a function which return ture or false, i have written a while loop condition if ture then execute else exit. the while loop condition is calling that function but when ruung owb throws error that function is not declared ORA-06550: line