There is an invalid number of result bindings returned for the ResultSetType

SSIS SQL Task:  Single Row Result Set
Code was updated to test for data in target:  If Exists Do Merge  ELSE Do Insert
Previously was just a merge that Output $Action to @ChangeSum and then @ChangeSum queried for updates and inserts
That all worked but after injecting new code I receive the error There is an invalid number of result bindings returned for the ResultSetType that I don't know what it means or how to troubleshoot.
Inject New Code:
IF OBJECT_ID('tempdb..##TblTemp', 'U') IS NOT NULL
DROP TABLE ##TblTemp
Declare @sql nvarchar(max);
set @sql = @TestForData
exec (@sql);
IF EXISTS  (select top 1 * from ##TblTemp)
       Begin
--Beginning of existing code
           begin transaction;
            begin try
            declare @MergeQuery varchar(max)
            set @MergeQuery = convert(varchar(max), @MergeQuery1) +  convert(varchar(max), @MergeQuery2)
            + ' ' + convert(varchar(max), @MergeQuery3)
            + ' ' + convert(varchar(max), @MergeQuery4)
            + ' ' + convert(varchar(max), @MergeQuery5);
            exec(@MergeQuery);
            end try
            begin catch
                declare
                @Message VARCHAR(4000)
                ,@Severity INT
                ,@State  INT;
                select
                @Message = ERROR_MESSAGE()
                ,@Severity = ERROR_SEVERITY()
                ,@State = ERROR_STATE();
                if @@TRANCOUNT > 0
                rollback transaction;
                raiserror(@Message, @Severity, @State);
            end catch;
            if @@trancount > 0
            begin
                commit transaction;
            end
--End of existing code
      End
else
       Begin
    declare @InsertQuery nvarchar(max)
    set @InsertQuery = convert(varchar(max),@InsertQuery1)
    exec (@InsertQuery);
      end
Drop Table ##TblTemp
=================================
SSIS Variable @InsertQuery1:
This variable is executed in SQL Task and the last 3 lines I expect a single row of Insert & Update counts to be returned.
   declare @ChangeSum table(change varchar(25));
   declare @Inserted int = 0;
   declare @Updated int = 0;
While 1 = 1  
    Begin  
        INSERT INTO [R_Paid].[BusCodeF454x93]
        OUTPUT Inserted.Sta3n INTO @ChangeSum
        SELECT TOP 1000 s.*
        FROM [R_Stage].[BusCodeF454x93] s
        WHERE NOT EXISTS
          SELECT 1
            FROM [R_Paid].[BusCodeF454x93]
            WHERE STA3N=S.STA3N and [BusCodeF454x93IEN] = s.[BusCodeF454x93IEN]
       IF @@ROWCOUNT  = 0 BREAK       
END
   set @Inserted = (select count(*) from @ChangeSum );
   set @Updated = 0;
 select @Inserted as Inserted, @Updated as Updated;

"SELECT " + (DT_WSTR,50)@[User::TargetExists] + " = CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END
FROM " + (DT_WSTR, 100) @[User::DataDestinationTable]
must do the trick
The T-SQL merge allows both inserts and updates:
MERGE Target AS T
USING Source AS S
ON (T.EmployeeID = S.EmployeeID)
WHEN NOT MATCHED BY TARGET AND S.EmployeeName LIKE 'S%'
THEN INSERT(EmployeeID, EmployeeName) VALUES(S.EmployeeID, S.EmployeeName)
WHEN MATCHED
THEN UPDATE SET T.EmployeeName = S.EmployeeName
WHEN NOT MATCHED BY SOURCE AND T.EmployeeName LIKE 'S%'
THEN DELETE
OUTPUT $action, inserted.*, deleted.*;
ROLLBACK TRAN;
GO
Arthur My Blog

Similar Messages

  • There is an invalid number of arguments found in the function '@PARENTVAL

    Hi
    In a prior version of Hyperion, we had a business rule which pushed values down to to a child member
    +Fix ( EE105, , @Children("FX entry"), &District, @UDA("Cost centre - primary", "DuplicateMbr"),C3090,[Opex_WriteScenario], [Opex_WriteVersion],&CurYear: &YearPlus6)+
    Month = @PARENTVAL("Cost Centre");
    Endfix;
    We are moving across to Calc Manager in version 11.1.2.1 and the problem is that I now get the following error message:
    An error occurred in: Calc Opex CC
    There is an invalid number of arguments found in the function '@PARENTVAL(Cost Centre)'. .
    Your assistance is appreciated.
    Cheers

    Check if you can validate this script again Essbase, I am sure you will be able to.
    If I remember correctly there were few functions missing in calc manager which were fixed in the patches released.
    Try it on the latest patch:
    Patch 14265667: Patch Set Update: 11.1.2.1.104 for Oracle Hyperion Calculation Manager
    Cheers..!!!
    Rahul S.

  • Installed an SSD in place of hard drive, DU reports that there is an invalid number of allocation blocks.

    I recently installed a Mercury Extreme Pro SSD in my laptop in place of the hard drive. I used Carbon Copy Cloner to make the SSD a bootable disk and transfer all my files. Today (about a month later) while checking the old HD (now in an external case), I decided to run "Verify Disk" on the new SSD. When I run it on the disk volume, Disk Utility reports that there is an invalid number of allocation blocks - much to my surprise. When I run it on the drive itself there are no errors.
    The new disk works fine as the startup drive. What's the meaning of the error and how do I fix it?

    No, on both counts. FW800 will not support the speed of SSDs. It barely supports the speed of very fast hard drives. But it beats USB 2.0.

  • PhotoShop CS5 Extended serial number - NOT accepted - is there a quick fix? Many thanks and hugs for the winning answer :-)

    guys, i need you help - CLEARLY - so I bought PhotoShop CS5 Extended two years ago - but never real used it - today I requested the serial number - which was sent asap - BUT the system doesn't accept it, says it invalid - question - am I doing doing something wrong or is there a quick fix? Many thanks and hugs for the winning answer :-) Somayeh!

    Unfortunately, only Adobe customer service can assist you with your issue. These are user forums; you are not addressing Adobe here.
    Click on the link below, and after that click on "Still need Help? Contact us."
    Then on the next page, click Chat
    There is also a phone option.
    http://helpx.adobe.com/contact.html?step=PHXS_downloading-installing-setting-up_licensing- activation

  • Encountering Error in webadi : "&Value is invalid. Enter a valid value for the Mapping column &Column"

    We are having a custom WebADI, containing a field (Employee Name) which is a LOV.
    The LOV has ID : Person ID, Meaning : Employee name, Description : Position Name.
    There are multiple records with same Employee name but different Person ID.
    If I select an Employee in the LOV which has multiple records (through different IDs), I am getting an error in WebADI:
    "Enter a valid EMPLOYEE_NAME.
    XX is invalid. Enter a valid value for the Mapping column EMPLOYEE_NAME"
    The Query for the LOV is correct and is returning correct records.
    Any pointers on this issue highly appreciated.

    Hi,
    The problem could be with HR security profile attached to the responsibility from where you are launching the spreadsheet. Check it once.
    Thanks.

  • How can i make a free facetime video call? There's always appearing that my provider might charge for the call?

    How can i make a free facetime video call? There's always appearing that my provider might charge for the call?

    If you make a call then tap the Facetime button to connect Facetime, the duration of call up to Facetime connection will be charged under your regular airtime.  However, duration during facetime conversation will not consume airtime.
    But if you tap the Facetime button on the Contact Page, then the whole duration will not consume airtime.
    For Facetime to work, both parties must be connected to wifi.

  • Windows 8.1 PC, using reader, when searching a folder containing approx 100 doc's. If i search for a word, no results are returned. only the doc names can be found but nothing from within the doc. This is a new problem and was not the case before.

    Windows 8.1 PC, using reader, when searching a folder containing approx 100 doc's. If i search for a word, no results are returned. only the doc names can be found but nothing from within the doc.
    This is a new problem and was not the case before.

    Works perfectly fine for me with the latest Reader version (11.0.09).
    You write that it worked "before"; before what?  An update?  Update from what version to what version?

  • Installing Photoshop CS4 from original Disk onto my new Macbook Pro.  Serial number accepted but now asks for the serial number of a previous version e.g. CS3 which I no longer keep.  How do I resolve ?

    Installing Photoshop CS4 from original Disk onto my new Macbook Pro.  Serial number accepted but now asks for the serial number of a previous version e.g. CS3 which I no longer keep.  How do I resolve ?

    Tina Hadley did you migrate/transfer your applications over to your new Macintosh?  If so this could cause problems with your serial number being recognized.  Please run the available uninstallers located in Applications/Utilities/Adobe Installers folder.  Once this is done you will also want to run the CC Cleaner Tool.  Details on the use of the CC Cleaner Tool can be found at Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6 - http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html.

  • The result is empty for the XPath expression

    Hi friends
    Please, could anyone help-me with this issue? My BPEL process was working yesterday and stoped today...
    I think I´m facing a namespace problem.
    If I start my process using BPEL Console, filling the "HTML form" option, all works ok.
    If my process is started by a call from another bpel process, my XPath query gives me an error, but the 2 received messages are "almost" egual:
    Using BPEL Console:
    <RejectionMessage>
    <part name="message" >
    <RejectedMessage ns1:BatchId="" ns1:PrimaryKey="" ns1:RejectionId="invalid_msg_processName_token1_token2_token3" ns1:BatchInfo="" >
    <MessageHeader/>
    <MessagePayload/>
    <RejectionReason/>
    </RejectedMessage>
    </part>
    </RejectionMessage>
    Started by another BPEL Process:
    <RejectionMessage>
    <part name="message" >
    <RejectedMessage RejectionId="INVALID_MSG_BatchTest_Read_20060418_101233_0463" BatchId="" BatchInfo="" PrimaryKey="" >
    <MessageHeader/>
    <MessagePayload> AgICAgICAgICAgICAgICAgIE1aIEpBSVJPUyAg MDYwMzA4MTAwMQ0K </MessagePayload>
    <RejectionReason> ORABPEL-11008</RejectionReason>
    </RejectedMessage>
    </part>
    </RejectionMessage>
    XPath Query:
    bpws:getVariableData('RejectionMessage','message','/ns2:RejectedMessage/@ns2:RejectionId')
    In the first case, it works.
    In the second case, it raises a "The result is empty for the XPath expression" error.
    As you can see, this process is used as a "Rejection Handler" process: It implements the interface defined in RejectionMessage.wsdl
    Could you help me?
    Thanks in advance

    Hi All
    I find a workaround to the problem. I´m almost sure it is a bug in BPEL.
    As you can see on my previous post, the diferences between the two messages is that the attributes have qualified names on one message and unqualified names on the other: ns1:BatchId, ns1:PrimaryKey...
    The schema definition for this message (JCAErrorHandling.xsd) define that attribute names MUST be qualified (attributeFormDefault="qualified"). The problem is that the File Adapter sends the message with unqualified attribute names!!
    So I edited JCAErrorHandling.xsd (<ORACLE_HOME>\integration\orabpel\system\xmllib\jca) file, changing it to attributeFormDefault="unqualified".
    The correct solution is to fix File Adapter to send the message with qualified names, so I´m opening a Service Request at Oracle Metalink.
    Thanks.

  • "No results were returned by the query" exception

    Hi,
    im using postgreSql (7.2) as a backend and JDBC3 (from http://jdbc.postgresql.org/).
    im getting the exception, "No results were returned by the query" whenever i try to do an insert. the weird thing is that insert works and i can see a record in the database, but i still get this exception and i can't do anything.
    Java: 1.4.0
    thanks a lot

    you should use executeUpdate for queries that do not return result sets. that would include insert, update and delete.
    i didn't know that, that would cause a problem with postgreSql jdbc. im use to of Oracle and i never got these problems with Oracle
    this is not a problem with postgres it is a problem with your lack of understanding the API and the Oracle driver if it let's you do this is wrong.
    the API clearly states that is you try and execute a SQL statement that does not produce a ResultSet with executeQuery then a SQLException should be thrown.
    so again the postgres driver is correct you and the oracle driver are wrong.

  • HT201318 Hello. I have just built a website using iWeb but cannot upload it. I curently have the 25gb account. There doesn't appear to be any facility here for the net. ASm I correct in thinking I need an upgrade, or am I doing something wrong?  Thanks

    Hello. I have just built a website using iWeb but cannot upload it. I curently have the 25gb account. There doesn't appear to be any facility here for the net. Am I correct in thinking I need an upgrade, or am I doing something wrong?  Thanks

    iCloud does not provide website hosting. You will need to find another website hosting service - there are many to choose from - and upload your site there. How you do this depends on what version of iWeb you have.
    In order to upload your existing site in iWeb '09 and above:
    Click on the name of the site in the sidebar: the publishing settings pane will open. Set 'Publish to' to 'FTP'. Enter the name of the site and a contact address (if desired).
    In the 'FTP Server Settings' section you will need to know the server address (your hosting service can tell you that), and your username and password for that service. Your site will be published in a folder with its name at root level of the server, with an index.html file at root level (which will overwrite any index.html file which may be there already). The 'Directory/Path' field may need to include a path such as '/webspace/' or 'ht_docs/' - this is dependent on your hosting service and they should tell you this. If you want to publish within a folder you can add that to the path.
    You can then click the 'Test connection' button so that iWeb can check that it can get access to your server space. You should enter the URL of the site in the 'URL' field so that rss feeds and internal links have the correct address.
    To publish using an earlier version of iWeb:
    From the File menu choose 'Publish to a folder'. You should create a folder somewhere convenient specifically for this and choose it when publishing to a folder: this folder should not contain anything else.
    You now need an FTP program (FTP is the 'protocol' used for uploading) to upload the contents of the folder to your server.Cyberduck is free (donation requested): Transmit is $34 but I think better. You will need the server address (your hosting service can tell you that), and your username and password for that service. You can drag the contents of your folder to your webspace, or create a folder there and drag the contents to that if you prefer.
    Some facilities that iWeb provided when hosted on MobileMe will not work on other servers: comments on weblogs and photos, password-protecting your site (some hosts may provide this), searching in the weblog, and a hits counter (again, some hosts can provide code for this). Slideshows in iWeb will work on other hosts than MobileMe (they use different code when FTPing which doesn't depend on scripts hosted on MobileMe as the MobileMe version does); however there is an issue with the 'buttons' which control the slideshow which are images hosted on me.com - these depend on images which used to be hosted on MobileMe. The poster 'Old Toad' on the Apple Forums has provided a workaround, described at http://oldtoadstutorials.net/No.26.html.

  • Assigning JMS message in BPEL: The result is empty for the XPath expression

    Hi,
    My project, an Oracle BPEL 11g project, is reading an XML payload from a JMS queue. I would like to transform the message and assign the elements of the messages to other variables. But when I am doing that in the "assign" step, it raises an error: Error in evaluate <from> expression at line "63". The result is empty for the XPath expression : "/ns2:publishProject/payload/Message".
    Even though I can see the message payload in the Audit with all the values.
    To me it looks like a name space issue, but I could not find out how to correct it. Any hint will be a big help. Please let me know if you want to check the .xsd for the message.

    I publish a JMS message to a topic in one BPEL process and have another BPEL process read from the topic and start the flow. The problem I have is that the first process is writing fine to the topic, but the second process seems to be reading twice. I am seeing two instances of the second process in em.
    Can anyone help? I am using JDev 11.1.1.1.0
    Thanks

  • FMor Bapi to get the number of transactions in SM35 for the session name

    Hello All,
    Can you anybody give me a function module or bapi to get the number of transactions in SM35 for the session name.
    Can anybody help me out in this issue.
    Thanks

    Hello Maroz,
    Thanks for the help.But can you provide me a FM or BAPI.
    Thanks

  • Why is there additional USD 1 in addition to USD.99 for the purchase of Whatsapp on iPhone

    Why is there additional USD 1 in addition to USD.99 for the purchase of Whatsapp on iPhone? It says USD.99 from iTunes..

    Th $1 was a preauthorization to insure that the card was valid. It will be refunded in a few days.

  • Is there any BADI or any other alternate in ECC for the Field exits

    Hi guys,
    Is there any BADI or any other alternate in ECC for the Field exits:
    FIELD_EXIT_BP_VERS_Z
    FIELD_EXIT_BP_VERSION

    Hi,
    If you are aware that these are the field exit funciton modules that get created when you create a field exit for the corresponding data element.
    Hence there will not be any replacement for this FM, But you need to find where the data element is triggering(the tcode) and check in debugging if there is any BADI/Enhancement Point.
    Hence check for which data element the FM belong to using the program RSMODPRF and check if they are globally activated, then they trigger on all the screen/transactions..(Tedious to replace with BADi/Enhancemnet points everywherre)
    If the field exit is activated for screens, check to which transaction the screens belong to and then check for enhancement point or badi that trigers on the screen..
    Hope this helps
    Regards
    Shiva

Maybe you are looking for

  • The basic command "caps on" is not working in dictation.

    I love dictation in the new Mac OS X; I even prefer it over Dragon Dictation because it's so convenient and I don't have to grab a headset to begin using it. I do a lot of professional writing for my job–and frequently need to type phrases that are t

  • Backup Doesn't Have User Accounts

    I have messed up a few things on my wife's iBook (uh-oh). Fortunately, I made a complete backup with Superduper before doing anything. The backup is bootable, but the backup does not recognize any user (not even root). So, after restoring from the ba

  • HT3986 Just to be sure... "WindowsXP-to-Vista-to-7"

    The article state that I can use an "upgrade" disc, but will it work if the only "full retail" license of Windows I have is Windows XP pre-servicepacks? To be clear, I have a Windows XP disc (pre-servicepacks), a Windows Vista upgrade disc, and a Win

  • Macintosh HD icon changed

    Hi,  really hope somebody can help me here because i have been searching the web for the last three hours without any luck and its starting to drive me mad!  So heres the problem, Today whilst working on my imac i noticed that my Macintosh HD icon ha

  • CA-100 USB CHARGER

    Nokia CA-100 usb charger will not work on my laptop (charges for a few second but then stops) but works fine on my desktop. Any of you guys got any ideas?