Something Wrong with my DELETE statement

Dear All, The below Code suppose to delete those records which are matching p.sys_cd = 'DYT' criteria. But its deleteing 'DYT' matching records and the other records also. Do you thing any logic problem in the below code. Help me guys.
EXECUTE IMMEDIATE 'DELETE FROM SLS_F_TRANSACTION f
WHERE f.trans_dt_key between
(SELECT TO_CHAR(MIN(i.use_dt),''YYYYMMDD'') from stg_bi_actv_chrg_int i) and
(SELECT TO_CHAR(MAX(i.use_dt),''YYYYMMDD'') from stg_bi_actv_chrg_int i)
AND EXISTS (SELECT ''X'' FROM cp_d_customer p where p.sys_cd = ''DYT'')';
Thanks and Regards
Phani

Hi Phani,
can you give us the table structure?
seems like column f.trans_dt_key is a varchar2 column.
convert it to date when checking using "between" operator.
check if below query solves your purpose...
EXECUTE IMMEDIATE 'DELETE FROM SLS_F_TRANSACTION f
WHERE to_date(f.trans_dt_key,''YYYYMMDD'')  between
(SELECT MIN(i.use_dt) from stg_bi_actv_chrg_int i) and (SELECT MAX(i.use_dt) from stg_bi_actv_chrg_int i)
AND EXISTS (SELECT ''X'' FROM cp_d_customer p where p.sys_cd = ''DYT'' and f.sys_cd = p.sys_cd)'; Regards
Imran
Edited by: imran soudagar on Mar 25, 2010 7:46 PM

Similar Messages

  • What's wrong with my SQL statement?

    Guys,
    Please help me with this one.
    I am using Oracle JDBC Driver 9.2.0. When I did "select column1, column2 from tableName where rownum<1000", it was really fast. But when I do "select column1, column2 from tableName where rownum between 100 and 200", it won't return. The whole program just sit there, like there is some kind of infinite loop going on or something. I don't know Oracle database at all. Is there anything wrong with my SQL statements or there is some special Oracle SQL statement requirement/syntax?
    Thanks.

    Guys,
    Please help me with this one.
    I am using Oracle JDBC Driver 9.2.0. When I did
    "select column1, column2 from tableName where
    rownum<1000", it was really fast. But when I do
    "select column1, column2 from tableName where rownum
    between 100 and 200", it won't return. The whole
    program just sit there, like there is some kind of
    infinite loop going on or something. I don't know
    Oracle database at all. Is there anything wrong with
    my SQL statements or there is some special Oracle SQL
    statement requirement/syntax?
    Thanks.
    why don't you just try a standard WHERE
    "select column1, column2 from tableName where rownum > 100 and rownum < 200"

  • Is there something wrong with this table row definition?

    I have am supporting a coldfusion app that manipulates several forms.  One one particular page, there is a form that consists of several tables.  The last 3 lines of the last table are
        <tr>
                <td height="35" align="right" valign="middle">Description:</td>
                <td align="left" valign="middle"><input name="tmpPurpose" class="RptStd" size="70" maxlength="100" value="" onblur="document.ExpnDtl.Purpose.value = this.value;" onchange="ChkName(<cfoutput>#Session.CCWarn#</cfoutput>)" /><input type="hidden" name="Purpose" value="" />
                             <a href="#" id="aDesc" onclick="ShowHelp('9')" style="border:none; display:inline; padding: 0px 0px 0px 0px"><img src="/images/Help_Icon.gif" height="14" width="13" border="0" /></a>
                            </td>
          </tr>
          <cfif IsDefined("form.ExpnsCntrb")>
              <tr id="CntrbErr">
                   <td colspan="2" class="Error"><cfoutput>#form.ExpnsCntrb#</cfoutput></td>
              </tr>
          </cfif>
          <tr id="expnContrib">
                  <td align="left" valign="middle" height="35" class="RptStd" colspan="2">Is expenditure a contribution to a candidate, officeholder, or political committee?    <input type="radio" name="rdoCntrb" value="Y" /> Yes    <input type="radio" name="rdoCntrb" value="N" /> No</td>
           </tr>
          <tr id="COHInfo">
              <td colspan="2" class="RptStd" align="left" valign="middle" height="35">
                  <input type="checkbox" name="chkCand" id="chkCand" value="X" onclick="if (this.checked) document.ExpnDtl.btnCOH.disabled = false; else document.ExpnDtl.btnCOH.disabled = true;" />Direct expenditure to benefit a candidate or officeholder    
                  <input type="button" name="btnCOH" value=" Enter C/OH Information " class="RptBtn" onclick="window.open('/Testing/Test_COHBenefit.cfm?Parent=' + document.ExpnDtl.ItemID.value + '&Type=EXPN&Form=' + document.ExpnDtl.ExpnCode.value, 'CandidateInfo', 'width=730px,height=475px,scrollbars,resizable,location')" disabled /> <a href="#" id="aDirExpn" onclick="ShowHelp('11')" style="border:none; display:inline; padding: 0px 0px 0px 0px"><img src="/images/Help_Icon.gif" height="14" width="13" border="0" /></a>
              </td>
         </tr>
         </table>
    Now whne the form is displayed on my page, I always see the line of text Description and the line of text Direct expenditure to benefit a candidate or officholder (in bold above).  But I never see the line of text  Is expenditure a contribution to a candidate... (in italics above).   It seems so simple but I can't figure out why that line does not display!!  Is there something wrong with that tr/td definition?

    Have you tried removing the ID?  Just to see if some CSS might be using that ID with a display:none or visibility:none statement?

  • Hi. Whenever I go through one of the menus in firefox, the links remain highlighted after my mouse passes over them. Is there a bug fix for this or is there something wrong with my computer? I am running windows 7 if that helps.

    Hi. Whenever I go through one of the menus in firefox, the links remain highlighted after my mouse passes over them. Is there a bug fix for this or is there something wrong with my computer? I am running windows 7 if that helps. This problem started ever since I upgraded to version 5.

    I have downloaded and used the iPod Reset Utility, alot that did. My current state is iTunes on my XP Home with SP3 sees the iPod. When I drag a song to the iPod, the Sync message appears for about 5 minutes, then the Apple symbol appears. But no song has been transferred to the iPod.
    I tried to tap into the XP iTunes database from my iBook, but although it acted like it would add the XP library to the iBook library, it did not. I've got 19 Gs of songs on the XP. If I have to load each song from its original CD to get it on my iBook I'm going to start looking for some other app or device so that I can listen to my music.
    It is a shame, in the old days, Apple techs use to look at what was going on, now it appears they don't, so they never know they have problems until Apple's profits fall.

  • There's something wrong with my iphone 4s

    So there's something wrong with my iPhone 4s.
    Just recently it worked fine and all of a sudden it started going insane so what I did was turn my phone off for five minutes then back on. When I did my imessage won't work nor does my app called Line won't allow me to log in claiming my network is not working properly (when in fact it is because I used safari and searched five websites and it works fine) then I tried my imessage and it still won't work so I went to my settings and when I did it said my imessage was off so I switched it on and it was asking for my apple ID and I gave the correct information, making sure to type the password slowly so I won't make errors but still it claims I have the wrong password. I have other apple IDs and I used them and they all have the same password and still nothing. It's really annoying and I want it to be fixed soon because I've tried everything, I've tried putting it on airplane mode then putting it off, turning off imessage and restarting then turning it on again, I can't even log on to my apple ID here properly a few seconds ago and I restarted my phone already and shut it off too and still no difference.
    I'm hoping someone who can help me, please  nothing that requires deleting files because my files are important I do remember backing up on iCloud but I'm not quite sure when I did that and so I'm afraid of using that back up file.

    Hi Rsh Ahmed,
    Thanks for visiting Apple Support Communities.
    If you're not able to connect to wi-fi networks after updating, try the steps in our wi-fi troubleshooting article:
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/ts1398
    All the best,
    Jeremy

  • How do I import my photos from my iPhone to iPhoto, when I press import I just get a message saying there is something wrong with one of my photos and disconnects my iPhone.

    How do I import my photos from my iPhone to iPhoto, when I press import I just get a message saying there is something wrong with one of my photos and disconnects my iPhone.

    I couldn't find Image Capture at my first try, butI will try again. Do you inow how I can find the corrupted photo on my iPhone? Im a bit lost..
    Sorry, I just noticed, I made a mistake. "Image Capture" is in the Applications folder, not Utilities. And it may have a different name on your Mac, if your system language is not English:  Look for the icon with the camera:
    When Image Capture can import from your iPhone, spilt the folder with the imported photos in several small subfolders and try to import them separately to iPhoto. This way, you can identify a subset of photos with the corrupted one.
    Then try to import from that small subset one by one, until you hit the culprit. And then delete that photo or video from the phone.

  • My phone wont let me download anything even free stuff or update.it keep saying something wrong with my billing info so i fix it but still cant download.I signed out sign back in still nothing please help i'm getting angry

    My phone wont let me download anything even free stuff or update.it keep saying something wrong with my billing info so i fix it but still cant download.I signed out sign back in still nothing please help i'm getting angry

    If it says your billing info is wrong that means that your credit card issuer is refusing to approve your account. You will have to solve the problem with your bank or credit card company.

  • I have a Mid 2009 Macbook Pro 13 with no restore disk; it has OS 10.8.4 I believe there is something wrong with the OS due to I can not install flash player to view Youtube videos and the when we plug in a Bose headset the sound out will work sometimes

    I bough a used Macbook Pro mid 2009 that came with OS 10.8.9 it didn't have a backup restore disk with S/N W8******66D
    When trying to view some youtube videos; a window would pop up saying "it needs adobe flash player is required for video play back get the latest flash player" but after downloading the file and during installation would have errors and will not installed.....tried to reboot and install again.....but still the same.
    The othe thing I had noticed is when using a good Bose headset with mic the sound output would noticed the headset and then switch from headset to Internal speekers and headset.....thinking that there might be something wrong with the plug in port of the computer or the headset.....the headset works with no issues on my iPad so there must be something wrong with the computer.....tried to move the plugin around the port but no change....while the headset is plug in can hear a short clicking noise and the sound would get lost and back again......but with nothing plugin to the port there is no issue with the sound or mic.
    Thanks for your feed back......it looks like I have two different issues one is a software issue and the outher is a hardware issue
    <Edited By Host>

    The "restore disk" is built into the Mac. See About Recovery.
    Need more specifics about what error messages you got while installing Adobe Flash.
    However, you can almost avoid Flash altogether by setting YouTube to play the HTML5 version instead.
    Click the Try something new! link at the bottom of the YouTube page.
    I don't know about the sound issue. Might be hardware as you think. Try other headphones to check.

  • I'm not able to down load free apps without money on a credit card but the app is fee is this correct or is something wrong with my ipad

    I can not download apps that are free without money on a credit card. Is this right or is something wrong with my ipad

    Read here... https://discussions.apple.com/thread/5979741
    Keeka36 wrote:
    is something wrong with my ipad
    No.

  • There is something wrong with the volumes buttons in my macbook pro, every time i pressed the one who raises the volume, it leads me to the screen where (i do not no what its called) the background is black with the date and time and a calculator.

    There is something wrong with the volumes buttons in my macbook pro, every time i pressed the one who raises the volume, it leads me to the screen where (i do not no what its called) the background is black with the date and time and a calculator. However, when i lower it, my safari tab goes out of the screen. What do you guys think i should do? I'm getting very nervous.

    hey HAbrakian!
    You may want to try using the information in this article to adjust the behavior of your function keys to see if that resolves the behavior:
    Mac OS X: How to change the behavior of function keys
    http://support.apple.com/kb/ht3399
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • There is always a blue screen appears after the Apple logo during the booting process. And then everything is back to normal. What is this thing? Is there something wrong with my screen or something?

    There is always a blue screen appears after the Apple logo during the booting process. And then everything is back to normal. What is this thing? Is there something wrong with my screen or something?

    Nah - that's just the normal boot process.
    Clinton

  • I synced. All my music disappeared. Now it will only sync my apps and not my music. Is something wrong with the port on my ipod, the USB cord, or Itunes?On Itunes it says I still have all my music. :(

    I synced my ipod to my computer and all my music disappeared. I tryed resyncing it and it would only sync my apps and not my music. I cant add music to my ipod. I something wrong with the USB port in the IPOD, the USB Cord, or ITUNES itself. Itunes still shows that all my music is there on my ipod. Itunes is recognizing that my ipod is connected, but it doesnt recognize that theres no music on my ipod anymore. Im so sad. Someone please help me. I miss my music.

    The music sync is one way - computer to ipod.  The only exception is itunes purchases.
    The ipod is not a storage/backup device.  It simply mirrors the selected content of your computer.
    As the music came from your computer in the first place, it should still be there and in your backup copy of your computer.

  • "The file 'Acknowledgements.rtf' cannot be installed because the file cannot be found in the cabinet file 'iTunes.cab'.  Is there something wrong with the latest installer? (11.3.1)

    Getting error message as shown: "The file 'Acknowledgements.rtf' cannot be installed because the file cannot be found in the cabinet file 'iTunes.cab'.  Is there something wrong with the latest installer? (11.3.1)

    Installs fine for me, so I'd guess you got an incomplete or corrupt download. See the Further Information area of Troubleshooting issues with iTunes for Windows updates for direct links and download a fresh copy of the installer.
    tt2

  • Something wrong with my CD/DVD drive??

    I think there is something wrong with my CD/DVD drive. here are the things I notice:
    At time the CD drive will act up and make a little noise (same normal noise as when mac starts up) but for no reason
    When I put my mac on stand by, my CD drive decided to make some noise and then it woke the computer from sleep mode
    Any suggestions? What could be the problem here?
    Thanks.
    Dorian

    well i live in a small town so finding an apple repair service is out of the question....but i will probably just make an appointment....now my biggest problem is i cant find the receipt from best buy where i bought it from. but as soon as i got home and turned it on i registered it online and when i went to check it earlier and typed the serial number it says its still under limited warranty until january 18 2008...can i just tell them the serial number since i dont have the receipt anymore or will they charge me since i dont have the receipt? should i just buy applecare before i make an appointment and bring it in? thanks for all of your help

  • I just purchased Final Cut Pro X and I want to burn a dvd but the tabs do not see the option of SHARE. Is there something wrong with my Final Cut Pro X?

    I just purchased Final Cut Pro X and I want to burn a dvd but the tabs do not see the option of SHARE. Is there something wrong with my Final Cut Pro X?

    It's also under the File menu.

Maybe you are looking for

  • I keep getting an error can someone please help

    i am trying to develop a web application using tomcat. i have a servlet that will not compile because of two things. firstly, it says that package beans does not exist and secondle it gives an error becuase im using a user bean here to set some attri

  • Problem in deployment (BPM 11g Suite)

    Hi, I am using BPM 11g suite and created one sample BPM project. But while deployment I am getting some error and not able to deploy my process. While deployment I am getting the following error: [12:28:31 PM] Deploying 2 profiles... [12:28:31 PM] Wr

  • Upgrading from Solaris 8 to Solaris 10

    Hi I am in the process of upgrading from Solaris 8 to 10 on a sparc server. What I would like to know if anyone has experienced compatibility issues during the upgrade with the Korn and C Shell as well as perl.

  • While taking rman some problem with catalog password

    what is password for this C:\>rman target 'rolta' catalog 'rman\rman@cmms' Recovery Manager: Release 10.2.0.1.0 - Production on Tue Apr 1 01:03:54 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. target database Password: connected to targ

  • New Release - WD My Cloud DL2100 Firmware Release 1.06.133 (6/25/2015​)

    WD is happy to announce the release of its latest WD My Cloud DL2100 Firmware Update. You can post your experiences here in the My Cloud Business Series forum. Please create individual topics for any questions that arise. Also please note the firmwar