Blocking issue---help

DELETE FROM #tmpbatch WHERE batchid NOT IN (select distinct #tmpbatch.batchid  from #tmpbatch LEFT JOIN tinvoiceitem ii on ii.batchid = #tmpbatch.batchid
LEFT JOIN tpaymentitem pi on pi.batchid = #tmpbatch.batchid LEFT JOIN tworkorderevent woe on woe.batchid = #tmpbatch.batchid where (ii.servicecenterid IN (select branchid from #tmpuserbranches)) OR (pi.servicecenterid IN (select branchid from #tmpuserbranches))
OR (woe.servicecenterid IN (select branchid from #tmpuserbranches))
               This SQL is in-line SQL in the vb module \App_code\TSPDBSQL\accounting.vb in a public method
named pbatchlistbydate.  This is called from a public method named Get_Batches_By_Date located in the vb module \App_Code\TspAccounting\batch.vb which in turn is called from Office\showbatches.aspx.vb.
               The problem with this block of SQL is the “NOT IN” statement which is selecting from a temp
table that joins back to invoiceitems and paymentitems.  Those joins are causing blocking on the invoice and payment item tables which are used by a lot of SQL in the system.  This SQL needs to be carefully reviewed and optimized so that it does
not introduce unnecesssary scanning of the invoiceitem and paymentitem tables which ultimately blocks other processes.

As we do not know the database structure include indexes, hope this code might be helpful:
CREATE TABLE #NotForDel ( Id INT ) ;
INSERT #NotForDel
( Id )
SELECT tmp.batchid
FROM #tmpbatch AS tmp
LEFT JOIN tinvoiceitem ii ( NOLOCK ) ON ii.batchid = tmp.batchid
LEFT JOIN tpaymentitem pi ( NOLOCK ) ON pi.batchid = tmp.batchid
LEFT JOIN tworkorderevent woe ( NOLOCK ) ON woe.batchid = tmp.batchid
WHERE ( ii.servicecenterid IN ( SELECT branchid
FROM #tmpuserbranches ) )
OR ( pi.servicecenterid IN ( SELECT branchid
FROM #tmpuserbranches ) )
OR ( woe.servicecenterid IN (SELECT branchid
FROM #tmpuserbranches ) ) ;
DELETE t
FROM #tmpbatch AS t
WHERE NOT EXISTS
( SELECT *
FROM #NotForDel AS n
WHERE Id = t.batchid ) ;
T-SQL Articles
T-SQL e-book by TechNet Wiki Community
T-SQL blog

Similar Messages

  • HTML not working in PL/SQL block..Help me ASAP

    declare
    l_col VARCHAR2(30) :=to_number(to_char(to_date('01-feb-2011','dd-mon-yyyy'),'dd'));
    CURSOR name_cur IS
      select name
          from   od_shift_schedule
          where   year=2011
          and    (month)=('Feb')
           and    decode(l_col,1,"01",2,"02",3,"03",4,"04",5,"05",6,"06",7,
                         "07",8,"08",9,"09",10,"10",11,"11",12,"12",13,"13",14,"14",15,"15",16,"16",17,"17",18,"18",19,"19",20,"20",
                         21,"21",22,"22",23,"23",24,"24",25,"25",26,"26",
                       27,"27",28,"28",29,"29",30,"30",31,"31")='W';
    BEGIN
      DELETE FROM nam;
      commit;
      FOR i IN name_cur
      LOOP
      dbms_output.put_line(i.name);
      htp.p('<b>Employee '||i.name||'  has been ticked.
       </b><br/>');
      EXECUTE IMMEDIATE 'insert into nam(name) values('''||i.name||''')';
      commit;
    END LOOP;
    end;Kindly help me with this
    If i'm wrong here kindly help me that how can i place a display message

    Re: HTML not working in PL/SQL block..Help me ASAP
    Using the community discussion forums for urgent issues is rude and a violation of the terms and conditions.
    http://www.oracle.com/html/terms.html
    >
    4. Use of Community Services
    Community Services are provided as a convenience to users and Oracle is not obligated to provide any technical support for, or participate in, Community Services. While Community Services may include information regarding Oracle products and services, including information from Oracle employees, they are not an official customer support channel for Oracle.
    You may use Community Services subject to the following: (a) Community Services may be used solely for your personal, informational, noncommercial purposes; (b) Content provided on or through Community Services may not be redistributed; and (c) personal data about other users may not be stored or collected except where expressly authorized by Oracle
    >
    Also please read the FAQ on how to ask questions.
    SQL and PL/SQL FAQ
    >
    2) Thread Subject line
    Give your thread a meaningful subject, not just "help please", "Query help" or "SQL". This is the SQL and PL/SQL forum. We know your question is going to be about those things, make it meaningful to the type of question so that people with the right sort of knowledge can pick it up and those without can ignore it. Never, EVER, mark your subject as "URGENT" or "ASAP"; this forum is manned by volunteers giving their own time to help and your question is never urgent or more important than their own work or than other people's questions. It may be urgent to you, but that's not forum members issue.

  • Hello.I wanted to upgrade my iPad 1 to iOS 5.1 Over the Air.I was running iOS 5.0.1.It said it had an error connecting to server.It is already 5 hours i cant install this update.I also have an iPhone 4 with iOS 5.0.1 with the same issues.Help please!

    Hello.I wanted to upgrade my iPad 1 to iOS 5.1 Over the Air.I was running iOS 5.0.1.It said it had an error connecting to server.It is already 5 hours i cant install this update.I also have an iPhone 4 with iOS 5.0.1 with the same issues.Help please!

    You're probably running into the servers simply being swamped. Thousands of people are all going for the software update at the same time. Give it a try again and if that doesn't work, then try plugging it into your computer and trying it that way.
    I didn't get a notion of the size, it doesn't seem to be as big as the 700 meg 5.0 update, but it did take me 20+ minutes to download via cable internet so it's a large file. That in and of itself takes a while.
    If you're trying to download it directly to your iPhone, you'll need to be on wifi since I'm sure it's well over the 20 meg file size limit for 3G.

  • Helo , my secret question and apple id was blocked, please help me repair my apple id , i want to keep using this my apple id

    dear ...
    please help meeee.... my my secret question and apple id was blocked, please help me repair my apple id , i want to keep using this my apple id.
    please helppppp meeeeeee......
    <E-mail Edited by Host>

    Dendyhebatz wrote:
    dear ...
    please help meeee.... my my secret question and apple id was blocked, please help me repair my apple id , i want to keep using this my apple id.
    please helppppp meeeeeee......my email & apple id XXXXXXX
    Try changing your Apple ID password at iforgot.apple.com first.
    Also:
    How to reset your Apple ID security questions.
    Go to appleid.apple.com, click on the blue button that says 'Manage Your Apple ID'.
    Log in with your Apple ID and password. (If you have forgotten your Apple ID password, go to iforgot.apple.com first to reset your password with a password recovery email)
    Go to the Password & Security section on the left side, and click on the link underneath the security questions that says 'Forgot your answers? Send reset security info email to [email]'.  This will generate an automated e-mail that will allow you to reset your security questions.
    If that doesn't work, or  there is no rescue email link available, then click on 'Temporary Support PIN' that is in the bottom left side, and generate a 4-digit PIN for the Apple Account Security Advisor you will be contacting later.
    Next, go to https://getsupport.apple.com
    (If you see a message that says 'There are no products registered to this Apple ID, simply click on 'See all products and services')
    Choose 'More Products & Services', then 'Apple ID'.
    A new page will open.
    Choose 'Other Apple ID Topics', then 'Forgotten Apple ID Security Questions'.
    Click the blue 'Continue' button.
    Select the contact option that suits your needs best.

  • Recently i upgrade my iPad2 to 7.1(11D167) and now the wifi connection is very weak, I am not sure if it is a hardware or software issue, help please!

    Recently i upgrade my iPad2 to 7.1(11D167) and now the wifi connection is very weak, I am not sure if it is a hardware or software issue, help please!

    I am not sure, I have full signal on my iphone 5  and just 1 dot on my ipad, tomorrow I will test connection with other router and network, I thank you for your help and I will tell you the test result when done

  • Accound blocked pls help

    i cant use my skype adrees i think account blocked pls help me i wanna use my skype bychat1

    Try to release your account by filling out the information requested in the Online Resolution Center ;
    https://support.skype.com/account-recovery
    If in case still necessary, you can alsocontact customer support for clarifications or further assistance. Just click the link below to see the instructions on how you can get in touch with the Support team ;
    https://support.skype.com/en/faq/FA1170/how-can-i-contact-skype-customer-service
    CONTACT SKYPE CUSTOMER SERVICE   |  HOW TO RECORD SKYPE VIDEO CALLS  | HOW TO HANDLE SUPICIOUS CALLS AND MESSAGES   |  WINDOWS PROBLEMS TROUBLESHOOTING   |  SKYPE DOWNLOAD LINKS  
    MORE TIPS, TRICKS AND UPDATES AT
    skypefordummies.blogspot.com

  • Delivery block issue

    HI ,SD GURUS
    Issue is , once created a sale order and delivery ,so between created sale order and delivery , price may be revised by the customer. Delivery control deapartment  they dont have awareness about price revision..i maintained the condition record fro the materials.
    my requirement is i need block the delivery due to price changes from the condition record.
    pls help me
    with regards
    dinesh

    Hi,
    One point came to my mind is, the prices in sales order are agreed upon prices with the customer. Now even if you change the prices later, the prices agreed upaon still holds good.. right..
    Before changing anything always take into consideration the business perspective also.
    So in this case my suggestion would be to have delivery blocks in sales order. Before the users create delivery, check the prices and then release the block.
    Or
    If you are gonna use the latest prices then do as Madhu suggested.
    Let us know.
    SB

  • RESOLVED: "This driver is blocked-" issue on Windows Vista

    Hi.  I have a ThinkPad T60, originally an XP machine that came pre-installed with Roxio RecordNow.  Recently, I upgraded it to Windows Vista. Unfortunately, I did not find the information about needing to uninstall this product *before* upgrading my system to Vista until it was too late – and I know from my search for a solution, I am not the only one
    In my/our defense, the Microsoft Vista Upgrade Advisor found the potential problem before I did the upgrade but the message simply said something like “Caution.  You may have to obtain a Vista-compatible update for…” from Roxio.  This was true for drivers and sw from Lenovo too.  And, after upgrading I easily updated my ThinkPad drivers and applications by downloading the updated components from the Lenovo site.  
    But even after *purchasing* an upgrade to a newer version of Roxio's software – which their support people claimed would a) be compatible with Vista (it is) and b) fix my problem (it did not) – I cannot get rid of this issue...  
    Program Compatibility Assistant
    This driver is blocked due to compatibility issues... 
    Driver: Sonic Solutions DLA...
    Publisher: Sonic Solutions
    Location: Not Available
    A driver is installed that causes stability problems with your system…
    This error message comes up (and cannot be closed) every time I restart my PC.
    Long story short, the Microsoft and Lenovo sites (rightfully) point the finger at Roxio, but they have been of no help to me...  After having me try numerous, time-consuming things that they thought "this may work" (for example, see http://kb.roxio.com/content/kb/Creator/000127CR and http://kb.roxio.com/content/kb/Creator/000131CR their ultimate answer is “reformat your hard disk and start over with a new/clean Vista install…”
    I cannot accept this answer.  There is way too much sw on my machine, purchased and installed over the last 1.5 years and all of which gracefully (more or less) went through this upgrade with me, for me to “start all over”!!!
    I have been unable to find a solution to this problem amongst all the chatter on the net although I have found clues and I feel I may be getting close.  And so now, finally, my question...
    I now know the related software and offending driver is found in C:\SWTOOLS\APPS\MMCfTO which is where Lenovo originally installed with sw on my hard drive.  To solve my problem, can I simply delete this folder *and* find/remove the corresponding Registry keys???
    Thanks in advance to anyone here who can help me.
                -dave (Lenovo T60/Type 2623-KEU/Widows Vista updated/current)
    Message Edited by srda310 on 04-05-2008 02:01 PM
    Solved!
    Go to Solution.

    For posterity...   I was able to resolve this issue by using some tips and tricks not specifically related to my issue, but allowed me to get to a solution nonetheless.
    1) The following article was NOT written for/about Vista, so you cannot run the "REG ADD" command it suggests.  However,  you can use REGEDIT to make the suggested addition to the Registry by hand.
            see  http://mcpmag.com/columns/article.asp?editorialsid=990
    2) This change allows you to run the Control Panel / Program Uninstall in Safe Mode and then you can Uninstall the Sonic Solutions DLA software.
    Yay!
    Message Edited by srda310 on 04-04-2008 07:57 AM

  • All Emails Sent to Verizon Email Addresses Are Blocked - Please Help

    Hello,
    Email messages that our company sends to Verizon recipients are being blocked by the anti-spam system. I have copied a sample failure message below. I have submitted whitelist requests several times, but get automated messages in return saying the IP is dynamically assigned (see below). Our IP address is static, not dynamically assigned. No spam is going out from the system, and we are not on any of the blacklists. Our emails to [email protected] and [email protected] are also being blocked, so I have found nowhere else to turn for assistance.
    Can you please help or assign an agent to help us in this matter? We have many customers who are not receiving their online purchases or responses to their requests for assistance from us because Verizon is blocking all emails to them from our servers. We certainly don't want to have to post to our online store that we cannot sell to or assist anyone with a Verizon email address.
    The mail server in question is: *******
    IP address: ******
    Your help would be greatly appreciated.
    Thank you,
    TraciG
    MailEnable: Message Delivery Failure.
    Reason: ME-E0193: [629A7226243B4A9D90F818B13EEF69C2.MAI] Message Delivery Failure.
    Your message addressed to the target domain (verizon.net) could not be delivered because the mail server responsible for this domain returned a permanent error.
    The server returned:
    571 Email from ****** is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 141223
    After investigation, Verizon Online Security has determined that e-mail from your IP address will not be allowed access to the Verizon Online e-mail domain due to one or more of the following reasons:
    Your IP has been blocked because of spam issues or because your ISP indicates that it is dynamically assigned
    Once you have addressed any security-related issues on your network, you should  contact Verizon Online Security via this form. At that time, we will work with you to restore normal e-mail traffic or to take other action as we deem appropriate.
    Sincerely,
    Verizon Online Security
    http://www2.verizon.net/policies
    [email protected]
    Solved!
    Go to Solution.

    Hi TraciG,
    Your issue has been escalated to a Verizon agent. Before the agent can begin assisting you, they will need to collect further information from you. Please go to your profile page for the forum and look at the top of the middle column where you will find an area titled "My Support Cases". You can reach your profile page by clicking on your name beside your post, or at the top left of this page underneath the title of the board.
    Under "My Support Cases" you will find a link to the private board where you and the agent may exchange information. The title of your post is the link. This should be checked on a frequent basis, as the agent may be waiting for information from you before they can proceed with any actions. To ensure you know when they have responded to you, at the top of your support case there is a drop down menu for support case options. Open that and choose "subscribe". Please keep all correspondence regarding your issue in the private support portal.

  • Customer Delivery Block Issue

    Hi Experts,
    I am facing a strange problem while changing a sales order, information message customer xxxx-xxxx has delivery block.
    However I have checked carefully in VD05 that there are no block maintained for order, delivery or billing.
    Our finance person activated customer delivery block two weeks before for particular customer xxxx-xxxx and now removed customer delivery block, but when we goto change the sales order still showing message and delivery also can't create
    How to solve this issue?
    Plz help!!!!!
    Regards
    Sankaran

    Hi,
    Initially,even if there are blocks at the customer levels,those blocks will not be assigned at the sales order.
    Suppose,we have a billing block at the custoemr level.While creating the invoice,it will throw an error message that "Customer is having billing block".
    If you remove this block there in T.Code "XD05",then you can proceed.
    Could you pls check in XD05/VD05 for your sales area and company code,whether the block is still there are not.
    If the delivery block is present at the order level,we have to remove that block eitehr manually or by using workflow functionality if needed.
    For removing the block at the order level,we have to got for "MASS" T.Code for bulk removal.
    Regards,
    Krishna.

  • Blocking issues with the new d2 quadra

    I just bought 2 of the newest 500GB d2 quadras and I attempted to set up a level 1 RAID with them daisy chained to my imac via firewire 800 and using disk utility. When I went to set the RAID Block size to 256k and create the RAID I got the screen of death. I then restarted and it did it again on start up. I unplugged the drives and started the computer back up and tested each one individually. I reformatted and tried again, same thing happened.
    I took them into the apple store and it happened again on their computers. We tested other Block configurations (32k, 64k, 128k) and they all worked except 256k. The genius's didn't know what the problem could be. A Leopard issue, hard drive issue, or what else.....
    Is anyone else having this issue? Should I be worried that there is an issue with one of the drives I am trying to RAID and return and get a new drive, or should I just set the block to 128k and not worry. I am pro photographer and am going to be storing and accessing RAW files in large amounts on these drives. What are the benefits and drawbacks for 128k formatting and 256k formatting?
    Any advice would be great! Thanks!

    marisaholmes, welcome to the Apple Boards,
    This board is for the discussion of a specific piece of Apple Hardware called the Xserve RAID. I think there is probably a more appropriate board for this question where you are more likely to find an answer.
    Sorry, hope this helps,
    =Tod

  • RAID blocking issues with the new d2 quadra

    I just bought 2 of the newest 500GB d2 quadras and I attempted to set up a level 1 RAID with them daisy chained to my imac via firewire 800 and using disk utility. When I went to set the RAID Block size to 256k and create the RAID I got the screen of death. I then restarted and it did it again on start up. I unplugged the drives and started the computer back up and tested each one individually. I reformatted and tried again, same thing happened.
    I took them into the apple store and it happened again on their computers. We tested other Block configurations (32k, 64k, 128k) and they all worked except 256k. The genius's didn't know what the problem could be. A Leopard issue, hard drive issue, or what else.....
    Is anyone else having this issue? Should I be worried that there is an issue with one of the drives I am trying to RAID and return and get a new drive, or should I just set the block to 128k and not worry. I am pro photographer and am going to be storing and accessing RAW files in large amounts on these drives. What are the benefits and drawbacks for 128k formatting and 256k formatting?
    Any advice would be great! Thanks!

    marisaholmes, welcome to the Apple Boards,
    This board is for the discussion of a specific piece of Apple Hardware called the Xserve RAID. I think there is probably a more appropriate board for this question where you are more likely to find an answer.
    Sorry, hope this helps,
    =Tod

  • Coding block issue

    Hi Experts,
        I have added some fields to FI business according to technology coding block. There was no error message when I done this. But now some SAP standard programs dump and the system hints me that some standard programs have error code because of my modification. I did not modify the standard program,only use coding block to add some fields.
      For example, The T-Code F.14,which calls the program  SAPF120 dynamically, and SAPF120 has some error codes blow:
        IF IS INITIAL.
      ELSE.
        CLEAR FTC.
        FTC-FNAM = 'TIBAN-IBAN '.
            FTC-FVAL = .
        APPEND FTC.
      ENDIF.
    I don't know how these codes generate?Any one encouter this issue?Could you please help me ??
    Thanks in advance. Villy.Lv

    Hi ,
    I have added the coding block fields in BSEG with OXK3 transaction and those fields have appeared in BSEG table. But Icannot find them in FB01..Can you tell me what should i do for them to come in the transaction?
    Thanks,
    KP

  • Control blocks/MS Help problem

    When using control blocks in generated forms/Headstart, you're
    required to give them an alias of qms$ctrl.
    If you then try to generate MS help for the form, it doesn't
    work for the control block. Think it's because of the '$'
    character, looks like this is a significant symbol to the MS
    help compiler.
    Any ideas for a fix/workaround?
    null

    Cheryl Riley (guest) wrote:
    : When using control blocks in generated forms/Headstart, you're
    : required to give them an alias of qms$ctrl.
    : If you then try to generate MS help for the form, it doesn't
    : work for the control block. Think it's because of the '$'
    : character, looks like this is a significant symbol to the MS
    : help compiler.
    : Any ideas for a fix/workaround?
    Cheryl,
    This is a known issue for Headstart for Designer 1.3.2. The work
    around is the following:
    1. change the following initialization command in qms$init_appl
    in your application library (or qmslib34 if you don't have such a
    library):
    l_control_block varchar2(50) := 'QMS$CTRL';
    should read
    l_control_block varchar2(50) := 'QMS_CTRL';
    2. Make the same name change to all your existing control block
    definitions in Designer and regenerate those modules.
    null

  • TABLE --- BLOCK SIZE - HELP

    Hi,
    Good day to all.
    There are totally 4 tables(EMP, DEPT, STORE_INFO,WAREHOUSE_INFO) which has the range partition been applied.(Partition is on the date range for current date i.e. for every 1 day the partition will be automatically created)
    There is a timer concept been applied such as the purge should automatically be done based on the days we pass.
    But I can see the information in my table as “11 – Which indicates that the table is overloaded”.
    For my surprise; for all the tables (NUM_ROWS and BLOCKS is NULL) except “EMP” table for which the NUM_ROWS IS NULL and BLOCKS size is 1,540,356.
    1)     Will this be an issue during purge?
    2)     Why NUM_ROWS is NULL and BLOCKS size is showing high.
    Please help....

    Thanks Hemant for your prompt reply.
    Sorry and forgot to mention that this information is for our records "11 - Status which moves when table is overloaded".
    Actually i was in an assumption that "because of the BLOCK SIZE" the table overloaded issue was getting raised.
    Is the below code right?
    When i am running it; it says the
    Error
    ===
    ORA-20000: TABLE "MOQ"."EMP" does not exist or insufficient privileges
    ORA-06512: at "SYS.DBMS_STATS", line 2105
    ORA-06512: at "SYS.DBMS_STATS", line 5210
    ORA-06512: at "SYS.DBMS_STATS", line 5243
    ORA-06512: at line 8
    DECLARE
       num_rows      NUMBER;
       num_blocks    NUMBER;
       avg_row_len   NUMBER;
    BEGIN
       -- retrieve the values of table statistics on MOQ.EMP
       -- statistics table name: EMP    statistics ID: TEST1
       -- MOQ - SCHEMA_NAME
       DBMS_STATS.get_table_stats ('MOQ'
                                  ,'EMP'
                                  ,NULL
                                  ,'EMP'
                                  ,'TEST1'
                                  ,num_rows
                                  ,num_blocks
                                  ,avg_row_len
       -- print the values
       DBMS_OUTPUT.put_line (   'num_rows='
                             || num_rows
                             || ',num_blocks='
                             || num_blocks
                             || ',avg_row_len='
                             || avg_row_len
    END;Or only DBA has the privileage?
    Please help

Maybe you are looking for

  • Downloading ALV to excel file

    Hi all,    i am trying to download ALV to excel file.    but as the alv contains many fields,    the row in the excel is automatically wrapped to the    next row ..    what i want is the row in excel should come as it is    in the ALV (whole thing in

  • File Info and Variable values visible in Sharepoint?

    (FM11) We're considering Sharepoint as a CMS for use with FM11 (maybe FM12 later) and are looking for some trailheads. Can values of FM variables become visible through Sharepoint? What about File Info values (File > File Info) ? Which features of Sh

  • MAC/PC compatible video file?

    Longtime MAC user and FCS 2 user. With all the video work we do, what is a good MAC/PC video file format? I used to create MPEG 1 files a lot, but thats not used so much these days. Is there a new file type that will work on a PC with Windows Media P

  • Invalid root. The WEB-INF/flex folder must contain either flex-config.xml or services-config.xml.

    Hi, I am tryng to create a Flex Project, but got stuck with an error.... The Error is  Invalid root. The WEB-INF/flex folder must contain either flex-config.xml or services-config.xml. Initially I download jboss-5.1.0.GA and placed it in C folder. Wh

  • Restrict excess posting against manual reservation (for movement type 311).

    Hello, Reservations are created for transfer posting within plant (311). However, during posting the system allows to post more than the reservation quantity. Can this be restricted? Regards Sameer