Command the execute sql query and does not clean up data in Table

Hi Team
I have an SP, which writes source and target data to Temp Tables and runs except query to get mismatch details
I am using Exec command to execute source query that writes data to Temp Table, once I execute query using Exec, data is written and immediately #temp table is cleaned, now I cannot use #temp table for comparition.
Is there any way to execute sql query in SP without using EXEC and will hold the data in temp table.

You need to create temp table before EXEC statement and rewrite your dynamic query also as below
declare @source_Sql nvarchar(1000)
,@target_Sql nvarchar(1000)
create table #TempTable1 (name nvarchar(10))
create table #TempTable2 (name nvarchar(10))
set @source_Sql = 'INSERT INTO #TempTable1 SELECT [Name] from Employee'
set @target_Sql = 'INSERT INTO #TempTable2 SELECT [Name] from Employee2'
EXEC (@source_Sql)   
EXEC (@target_Sql)             
select * from #TempTable1 
 Except 
select * from #TempTable2

Similar Messages

  • ORA-29540: class oracle/xml/sql/query/OracleXMLStaticQuery does not exist

    I am getting below error when trying to generate xml. Browsing on google did not help me. I would appreciate if someone can provide the solution.
    SQL> select dbms_xmlquery.getxml('select * from dual', 2) from dual;
    ERROR:
    ORA-29540: class oracle/xml/sql/query/OracleXMLStaticQuery does not exist
    ORA-06512: at "SYS.DBMS_XMLQUERY", line 19
    ORA-06512: at "SYS.DBMS_XMLQUERY", line 271
    ORA-06512: at line 1

    Then it is probably not the case that you are affected by the issue described in Metalink document 185857.1, but if I were you I would check it anyway, since it might be the problem.

  • TS3274 Hi I am using iPad 2, when I tap app icon on the screen it shakes and does not open the app please advice what need to be done

    Hi I am using iPad 2, when I tap app icon on the screen it shakes and does not open the app please advice what need to be done

    - First try clciking the Home button one and try again.
    - Next reset the iPod. Nothing is lost
    Reset iPad: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Then restore from backup
    - Restore to factory defaults/new iPod

  • TS3274 When I try to start Settings, or Safari, the programmes close immediately and does not allow me to ghange anything or get connected in the internet

    When I try to start Settings, or Safari, the programmes close immediately and does not allow me to ghange anything or get connected in the internet. How can i set back factory settings? can somebody help me?

    Hello nikos260,
    It sounds like Safari and Settings will immediately close when you try to open them.  I recommend following steps in the following tutorial to address an issue like this (you can skip step 2 "Recharge iPad" because it's not related to this issue):
    Frozen or unresponsive iPad
    https://www.apple.com/support/ipad/assistant/ipad/
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • I downloaded the app hbo go and does not have volume

    Downloaded the app hbo go and does not have volume.  Is that normal?

    Open the file in QuickTime Player and then open the Movie Inspector window.
    What does it say about your file?

  • Creative Cloud Photoshop won't intall. Even after following support instructions the wheel keeps spinning and does not install. HELP

    Even after following support instructions the wheel keeps spinning and does not install. HELP

    Hi help-please,
    Please try downloading and installing Photoshop CC from the direct download links available at: http://prodesigntools.com/adobe-cc-2014-direct-download-links.html
    Make sure you follow the important steps mentioned on the page before initiating the download.
    Use your Adobe ID to license the software
    If the install fails then you can find details on how to locate and interpret your installation log files at Troubleshoot install issues with log files | CC - http://helpx.adobe.com/creative-cloud/kb/troubleshoot-install-logs-cc.html
    Regards,
    Rave

  • HT1349 Problem: my iPhone 4S (1yr old) has started buzzing for no apparent reason. I cannot stop it or turn the thing off. The screen is black and does not respond to touch. Any suggestions?

    Problem: my iPhone 4S (1yr old) has started buzzing for no apparent reason. I cannot stop it or turn the thing off. The screen is black and does not respond to touch. Any suggestions?

    Thanks, AM_Kidd, I had tried that before but I tried again and this time it WORKED!!!!
    The buzzing stopped and I have the home screen up again.
    Phew! It may be that it had been on charge for the last 30 mins.
    Whatever. Again, many thanks.

  • When I try to delete my site, I enter my information to confirm my identity. The confirm widow freezes, and does not go to the next step. What can I do, please?

    When I try to delete my site, I enter my information to confirm my identity. The confirm widow freezes, and does not go to the next step. What can I do, please?

    Hi,
    Did you try any other browser? is it hosted on Business catalyst? If yes and if you are using custom domain, then login to admin panel using system domain (mysite.businesscatalyst.com) and then try to delete. 
    Let us know if that works

  • When i click on the application it blinks and does not opens

    when i click on the application it blinks and does not opens

    Try downloading any small- sized free app and then try again.

  • Creative cloud installed on the desktop, but when I start the window is white and does not work

    can someone help me?

    Thank god be with
    2014-08-25 15:14 GMT-03:00 Sheena Kaul <[email protected]>:
        Creative cloud installed on the desktop, but when I start the window
    is white and does not work  created by Sheena Kaul
    <https://forums.adobe.com/people/Sheena+Kaul> in Adobe Creative Cloud - View
    the full discussion <https://forums.adobe.com/message/6672088#6672088>

  • Changed my ID but the Iphone 4 continue with the old ID name and does not syncronize. How can I change it in my Iphone so I can continue to use all my data stored like contacts and notes?

    Changed my ID but the Iphone 4 continue with the old ID name and does not syncronize. How can I change it in my Iphone so I can continue to use all my data stored like contacts and notes?

    Do you mean through iCloud?  You need to go to settings > iCloud and "delete account" and then sign in with the newly named account.  You'll want to do similar for facetime, messages, and store.

  • The Bookmarks toolbar is empty, doesn't allow me to add any bookmarks. I have tried all the options indicated in the support website, but none work. The toolbar remains empty and does not even allow me to drag something down to it from the location bar.

    Please see the question above, as that is the problem I am having. I don't understand why the Bookmarks tab does not show any of the bookmarks which I have tagged. They can only be chosen from the drop down menu. I tried dragging the page to the bookmark toolbar from the location bar but that does not work. Is it a glitch in the system?

    If the menu bar is hidden then press the F10 key or hold down the Alt key to make the menu bar appear.
    Make sure that toolbars like the "Navigation Toolbar" and the "Bookmarks Toolbar" are visible: "View > Toolbars"
    *Open the Customize window via "View > Toolbars > Customize"
    *Check that the "Bookmarks Toolbar items" is on the Bookmarks Toolbar
    *If the "Bookmarks Toolbar items" is not on the Bookmarks Toolbar then drag it back from the toolbar palette in the customize window to the Bookmarks Toolbar
    *If missing items are in the toolbar palette then drag them back from the Customize window on the toolbar
    *If you do not see an item on a toolbar and in the toolbar palette then click the "Restore Default Set" button to restore the default toolbar set up
    *http://kb.mozillazine.org/Toolbar_customization
    *https://support.mozilla.org/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • Scheduling the report from Infoview portal does not show up data

    "The crystal report is based on a SAP BI query. The parameters of the report are basically the parameters(SAP variables) of the SAP BI query. When we run the crystal report in the CR Report Designer tool, it runs fine showing all the data correctly. Then we published the crystal report to the Crystal Enterprise Server from the SAP BI system. Through the Infoview portal, the user clicks on the 'Schedule' link for the report and sets the parameters. When the 'Schedule' button is clicked, it runs successfully but no data is seen in the report except for the template. But under the same report, in Infoview portal, if the user selects "View" link, sets the parameters and then clicks the 'Execute' button, it runs successfully showing all correct data.
    Dont understand why it works for 'View' link but doesn't work for 'Schedule' link. Is there any setting that needs to be made for this?"
    Thanks in advance,
    Sri

    Hi Sri,
    When we are able to see the report and unable to schedule the report with in the Info view, then check with the user rights.
    Just try to login with admin account and try to schedule the report.
    Also check the report in CMC and see the preview of the report.
    If the user doesn't have enough rights to schedule the report, then  it doesn't allow it.
    Also check with in the Folder rights with in the report is saved.
    Regards,
    Naveen.

  • When I turn on my ipad2 the volume box appears and does not go away until i hit the volume button on the side and the increase volume button does not seem to funtion only the lower section does?

    I need help. I got an ipad 2 for Christmas and the volume box appears every time I turn it on and it won't go away until I hit the side volume button.  I also realized that the upper portion of the volume key does not seem to work properly.  Any solutions?

    i face totally similar problem so i think its a software flaw. but mine got on quite a long time.
    what should i do, i dun like going to the store in exchange for a refurb one

  • TS1559 wi-fi does not respond ; in settings when i get to screen: chose a network even that wi-fi is on the whole screen freezes and does not respond to touch. i have to press home button to go out. settings point is not coresponding either (in top left c

    wi-fi in settings does not respond to touch, page becomes frozen and i have to out from it with home button. can not choose network or anything on that screen!?

    noelani72 wrote:
    I'd be curious to go buy an old Linksys WRT54G Wifi Router and see how the iPads work on it....but my lord, I have already spent so much time on this issue as it is.
    Message was edited by: noelani72
    Unless you get that WRT54G for free or next to free, pass on it and pick up an old apple WAP off eBay or similar site. Like you my iPad has a connectivity problem with the WRVS4400N running iOS 4.2.1, where it didn't have trouble with iOS 3.2.2 and ran fine for five months.
    My solution at the office was to spur a second router off my DSL router just for the iPad. The first was a WRT54G that had to be set to only one 802.11 protocol to keep the iPad reliably connected, but swapped it out for an old airport extreme that I kept on after testing it to be good. With a home network like you describe, I would run a subnet off the WRVS4400N just for iPad using an apple WAP (the configuration app for Windows is easy to use).
    Good luck.

Maybe you are looking for

  • Sending  Payslip as PDF

    Dear all, I developed the Report program which will send  payslip as PDF attachement to all employees.i am able to receive the mail along with Payslip as PDF Format. but i am unable to open  the PDF format.its showing  error message as "Adobe reader

  • Page footer

    Hi All! I want to make footer for all portal pages. Our requirement is that footer should be always on the screen. What is the best way of achieving above? Thanks in advance! Regards, DK

  • Backup Incremental - What's it doing?

    Hi, I'm doing an incremental back up to an iDisk using the Backup utility. As it's over the internet, this takes a while - but even when I change very little between backups, the incremental is still very large. Does anyone know - is there a way of f

  • Display in same Row

    I have the following table: Service Tag Asset Type Id Issued To Region FCH11179 1000 [email protected] EMEA CN-011D3V 1004 [email protected] EMEA GX2 1001 [email protected] EMEA CN-00W6KV 1005 [email protected] EMEA LZ242BK0 1004 [email protected] EM

  • Is Lightroom 5 upgrade version (from Lightroom 3) ?

    Is Lightroom 5 upgrade version (from Lightroom 3) compatible with OS X.8.4 or do I have to buy the full Lightroom 5?