Delete Script required

Hi,
I want to delete the records which comes from the below query.
select da.deal_id, da.subsection_id, count(*) from tableDA da
where da.subsection_id = 9000 group by da.deal_id, da.subsection_id having count(*)=1
Please help me to write the delete query. Thanks in advance.
Regards,
Subhadeep

I would delete like this:
delete from tableDA d
where d.subsection_id = 9000
and not exists (select null from tableDA t
                     where d.deal_id = t.deal_id
                     and d.subsection_id = t.subsection_id
                     and d.rowid != t.rowid);

Similar Messages

  • Rman archive deletion script required

    hi
    i need a shell script which will delete archivelog using rman and will take backup of archivelog to specified location.DB 10gR2 OS RHEL 5 686.
    backup archivelog all to destination '/oracle/oracle/.Arch_bkp/';
    delete archivelog until 'sysdate-10';
    kind regards
    Edited by: no one on May 24, 2012 1:40 AM

    Kuljeet Pal Singh wrote:
    cat db_rman.sh
    <<all oracle environment variable>>
    CUR_DATE=`date +%d%m%y`
    export CUR_DATE
    DT=`date +%d%m%y_%H-%M`
    export DT
    LOG_DEST=/u02/backup/TAPE_Backup_Log
    export LOG_DEST
    rman target / catalog db_cat/password@rmanprod log=$LOG_DEST/RMAN_$DT.log <<EOF
    run {
    backup archivelog all to destination '/oracle/oracle/.Arch_bkp/';
    delete archivelog until 'sysdate-10';
    }I am in nocatalogue database.
    exit
    EOF

  • Import Format script required to update multiple fields

    Further to my previous post yesterday (Import Format script required to work across multiple fields I now need my import script to update multiple (two) fields at the same time, based on criteria set across multiple fields. So far, I can use DW.Utilities.fParseString to assess the values across multiple fields, but I now need to update not only the field in question, but also an additional field at the same time. For example:
    Function TBService(strField, strRecord)
    ' How do I update a second field at the same time?
    Dim strField2 As String
    If Left(strField, 1) = "S" Then
    If DW.Utilities.fParseString (strRecord, 3, 8, ",") = "B1110" Then
    strField2 = "N101"
    Else
    strField2 = "Network N/A"
    End If
    TBService = strField
    Else
    TBService = "Service N/A"
    End If
    End Function
    Is this even possible? Should I be looking at creating an event script which would work post-import? Or can this be done right here in the import script?

    All the logic you require can be encapsulated in the import script for the second field. You don't need to reference the second field in the first import script.
    Edited by: SH on May 2, 2012 5:39 PM

  • Help in DELETE script

    Hi, I have duplicate records and want to delete any 2nd duplicate row. Please help in DELETE script.
    Select * from cmhrec
    Sr_no  code    date     charge   Charge2 Code_ID
    1        AAA   1-1-2014  24.0      24.0      5
    1        AAA   1-1-2014  24.0      24.0      9
    2        AAA   1-1-2014  23.0      23.0      4
    2        AAA   1-1-2014  23.0      23.0      11
    3        AAA   1-1-2014   26.0      28.0     12
    3        AAA   1-1-2014   26.0      28.0     19
    --Desired output after deleting any 2nd duplicate row.
    Sr_no  code    date     charge   Charge2 Code_ID
    1        AAA   1-1-2014  24.0      24.0      5
    2        AAA   1-1-2014  23.0      23.0      4
    3        AAA   1-1-2014   26.0      28.0     12

    Thank you
    You can simply do this
    DELETE t
    FROM cmhrec t
    WHERE EXISTS
    SELECT 1
    FROM cmhrec
    WHERE SrNo = t.SrNo
    AND Code = t.Code
    AND Code_ID < t.Code_ID
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • "Echo" error from deletion script.

    Hey forum!
    I've got this deletion script (attached) that's throw back
    this error:
    Error: Error #2101: The String passed to
    URLVariables.decode() must be a URL-encoded query string containing
    name/value pairs.
    at Error$/throwError()
    at flash.net::URLVariables/decode()
    at flash.net::URLVariables()
    at flash.net::URLLoader/onComplete()
    I don't understand what the problem is. When i look up that
    error i find that usually that error is called by bad echoes, but
    my script doesn't have any. Any help or tips is appreciated!
    Thanks,
    John

    By the way, the script is working as intended.
    Thanks again

  • A login webpage gives the message "This script requires that jquery.js be loaded first." then will not show the user ID and password login boxes. How can this be corrected?

    A login webpage gives the message "This script requires that jquery.js be loaded first." then will not show the user ID and password login boxes. How can this be corrected?

    That message is listed in two scripts on the bank's site. One function that can display the message is named PhotoRotator and the other is named PromoRotator. However, I can't seem to trigger the error myself.
    If you have any add-ons that alter the page, such as ad blockers, try creating an exception for these sites and see whether that helps:
    www.northrim.com<br>
    www.northrimbankonline.com
    You also could try this logon page: https://www.northrimbankonline.com/onlineserv/HB/Signon.cgi
    (''Obviously you should be cautious about links offered on public forums to ensure you are not being phished! Check them out carefully before entering your username and password.'')

  • Silent Installation Script Require

    Hi,
    Scripts require for silent installation of oracle 11g on Windows XP -32bit.
    Oracle :-- 11gR2
    OS :- Windows XP
    Thanx in advance.
    Regards,
    Praful K

    Hi,
    see the description in the installation manual: [url http://download.oracle.com/docs/cd/E11882_01/install.112/e10843/advance.htm]Silent install. You have to build your own script because the environment can be special.
    Herald ten Dam
    http://htendam.wordpress.com

  • Deleting a Requirement Plan

    Hello All,
    I have a issue regarding PIR -> Requirement Plan.
    We have uploaded a Requirement Plan through a BADI which read Excel File with TCode ZMD61 which has the Prodn Plan for Jan2010, plan named as JAN10.
    Requirement Qty of this plan is getting updated in table MDPB.
    Now i want to Delete this requirement plan, how can i do that !?
    I tried to delete the requirements through MD62, was able to delete all, but the table (MDPB) still shows the Requirement plan JAN10 still existing at the table level. Becuase of which the reports which are linked to MDPB table are giving values of the Plan which i have deleted.
    How can i remove  / edit these values at table level.
    Thanks in advance,
    Harris

    Dear All,
    Thank you so much for your inputs and valuable comments.
    But the Issue got resolved in rather orthodox manner.
    Issue: Plan not existing, but the table was displaying the
    1. I uploaded the Materials which were being displayed in the table MDPB through MD61.
    2. Put any Qty as a Requirement.
    3. Saved the Plan
    4. Deleted the plan.
    Result: The entries got cleared from the Table.
    Thanks and regards,
    Harris

  • How to delete dependent requirement

    I need to delete dependent requirement but when tried to delete it by using change mode in MD04, I got message that planned order 0000**** does not exists.

    Hi,
    In MD04 screen, using material number and the plant you can view all the planned orders. From MD04 screen, u can celect the planned order by change mode and you can delete the planned order.
    Regards,
    V. Suresh

  • Path Deletion Script

    i currently have a script which contains a line for deleting all of the channels in a tif file:
    activeDocument.channels.removeAll()
    and this works fine.  i would like to add the necessary code to also delete all of the paths in a file.  i tried adding the line: activeDocument.paths.removeAll() but i received an error message.
    does anyone know the correct way to do this?  please advise.
    thanks.

    John A Horner wrote:
    thank you both so much for your replys.  it have incorporated your suggestions and the sript seems to be working fine.
    i have one more related question: i notice that in some of the scripts i already have there is a semi-colon at the end of most of the lines but not all.  for example:
    activeDocument.flatten();
    activeDocument.channels.removeAll()
    activeDocument.pathItems.removeAll();
    does it make a difference one way or another?
    finally, i am new to the forums and saw that i was only able to give 1 correct answer or 2 helpful so i wasn't sure the correct protocol for situations where there are 2 apparantly correct solutions.  but now, even though i have 2 correct solutions, it shows up as only "possibly answered".  is there a way to edit this?  please let me know if there is a proper way to handle this on the forums.  thanks again for everything.
    jh
    If you are flattening the document first, then the warning about deleting vector masks for the current layer won't apply to you, you are good to removeAll.
    From what I remember, adding the ';' at the end of each line is 'proper' javascript, and I believe was once required. It often doesn't matter from what I've seen (I am often lazy and forget/neglect to use it myself) as many scripts will run just fine whether it is there or not. I believe it still is required in certain circumstances, although I am not completely sure what they are.
    I don't know how the Adobe system uses it's points, not sure what to tell you on that.

  • Need to delete the requirements in md61 screen for the past month

    Hi Gurus,
    I am having one requirment that my client need to auto delete the md61 screen entries , Suppose the requirement is maintained for 1000 the planned order will also generated for 1000 qty if stock is not available , then the production is done only for 500 quantities. On the next MRP run the system is considering again the past month 1000 quantities .
    How we can restrict this? If suppose the balace 500 quantities also the user dont want to produce . Then how can we delete automatically .
    Pl help me out this.

    Hello Vishnu,
    You can delete the old PIRs when the new month begins through batch job for MD74/MD75/MD76.
    Other way is to define a period of adjustment for the MRP Group in transaction OMPG and assign the MRP group to your material. Please refer F1 help there
    Adjusting in the past, that is the period of adjustment is calculated backwards - the system starts from today's date and calculates backwards by the number of days specified. Thus, planned independent requirements that lie before the date calculated by the system are not included in the planning run.
    Please refer
    MD61 considering Past requirements
    Best Regards,
    R.Brahmankar

  • Service relocation automatic script required in oracle 11gr2 in perl or she

    Hi Everyone
    I require script to relocate service automatically in oracle 11gr2 to the prefered node if nodes goes down
    it can be either shell script or perl script?
    thanks
    Nitin

    Hi,
    1.) No if you define a service with TAF, then the TAF information will be provided to the client, without having to specify it again in the TNSNAMES.ora (neither client nor server).
    However it does not hurt, if you have specified it additionally (it just makes it more difficult if you want to change something, because the client side does not get updated).
    See this whitepaper for more information:
    http://www.oracle.com/technetwork/database/clustering/overview/awm11gr2-130711.pdf
    2.) However it seems you have forgotten to specify something with the service (you seem to be missing -m):
    srvctl add service -h
    Adds a service configuration to the Oracle Clusterware.
    -P {NONE | BASIC | PRECONNECT} TAF policy specification
    -e <Failover type> Failover type (NONE, SESSION, or SELECT)
    -m <Failover method> Failover method (NONE or BASIC)
    -w <integer> Failover delay
    -z <integer> Failover retries
    Regards
    Sebastian

  • Export multiple SSIS Packages- Script Required(SQL Server 2008R2 onwards)

    Team,
    I have the below requirement:
    Script to export multiple packages(Say 100) and take a backup on filesystem.
    Script to Import multiple packages (100) at a time in batch.
    This should be compatible with SQL Server 2005, 2008R2 and 2012. Please help me with this.
    Regards,
    Sharath

    Thanks Much Arthur, I am able to export the packages. However for Import should I use the below?
    Copy-isitemfiletosql
    -path
    "C:Program FilesMicrosoft SQL Server100DTSPackages*"
    -destination
    "msdbsqlpsx"
    -destinationServer
    "$env:computername"
    -connectionInfo
    @{SSISCONFIG=".SQLEXPRESS"}
    To import, I'd use DTUtil http://msdn.microsoft.com/en-us/library/ms162820.aspx it is just much easier to iterate over the package files off the file system.
    Arthur
    MyBlog
    Twitter

  • Script required for styling

    Hi All,
    I am currently type-setting a dictionary and need to character style the keyword used in the example which follows the definition. of the entry. Following is an example of such:
    bukkett (buk-kett) n.m.
    pl.s. bukketti
    Ħafna fjuri marbutin flimkien b’xi żigarella. • F’Jum l-Omm Toni xtara bukkett fjuri lil ommu.
    Line 1: Paragraph style: Headwords using a nested style to give a character style (Headword) to the first word
    Line 2: Paragraph style: terms
    Line 3: Definition followed by example, seperated by a space, bullet and non-breaking space. Paragraph style: Text entry with a grep style styling the example with a character style (keyowrd in example).
    The above is all done.
    I need a script to find in the example the preceeding entry styled as Headword (in this case bukkett). I am very poor in Javascript and VBscript.
    I hope I was clear enough. If required I can make available for download a sample of the document including the current styles I'm using.
    Thank in advance
    Stephen

    Hi,
    was grumbling for a clever solution, but didn't find one ;-)
    No errorhandling applied ...
    var myDoc = app.activeDocument;
    var allStories =  myDoc.stories;
    s = allStories.length;
    for(var i = 0; i < s;i ++){
    currStory =     allStories[i];
    var storyParagraphs = currStory.paragraphs;
    p = storyParagraphs.length;
    for(var j = 0; j < p;j++){
    var currPara = storyParagraphs[j];
    var paraName = currPara.appliedParagraphStyle.name
    switch(paraName){
    case  'Headwords'  :
    app.findTextPreferences = NothingEnum.nothing;  
    app.findTextPreferences.appliedCharacterStyle = 'Headword';  
    var Res = currPara.findText();
    var resCont = Res[0].texts[0].contents; break;
    case 'Text entry' :
    app.findTextPreferences = NothingEnum.nothing;  
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.findWhat = resCont;
    app.changeTextPreferences.appliedCharacterStyle = 'keyword in example';
    currPara.changeText(); break;
    default : break;
    app.findTextPreferences = NothingEnum.nothing;  
    app.changeTextPreferences = NothingEnum.nothing;
    Hans-Gerd Claßen

  • Delivery deleted but requirements are still shown in MD04

    Hi Gurus,
    I have an issue , where the item has been deleted from the delivery . However the requirements for the material are still being shown in MD04. I want the requirements should be removed from MD04.
    Please help me  in  resolving this issue.
    Thanks in advance.

    Once the sale order is created and saved, the requirements will be transferred to MD04 which means, through sale order, you are asking the system to consider those requirements for production.
    In the same way, if you delete a delivery document, it will not  be passed on to MD04.  In order to remove those requirements from MD04, go to VA02, input the sale order reference against which you have created and deleted the delivery and execute.  There assign Reason for Rejection for those line items and save.
    Now again go to MD04 and refresh it and see how it works.
    thanks
    G. Lakshmipathi

Maybe you are looking for