How to creare function to work with EXISTS function

Hello,
I would need some help with code in where clause. I have 6 queries which has a same condition:
AND NOT EXISTS (SELECT 0
FROM TAB1 T1
WHERE T1.COL1 = T2.COL1
AND T1.COL2 = T2.COL2)
I would like to write some function so I don't have to change a code in every statement:
AND NOT EXISTS FUNCTION1(T2.COL1, T2.COL2);
I wonder if that is possible. I was searching forum and documentation but did not find nothing useful. I do not know what type of function must be and how this could work. If someone now please help.
Regards,
Igor

user5528050 wrote:
Hello,
I would need some help with code in where clause. I have 6 queries which has a same condition:
AND NOT EXISTS (SELECT 0
FROM TAB1 T1
WHERE T1.COL1 = T2.COL1
AND T1.COL2 = T2.COL2)
I would like to write some function so I don't have to change a code in every statement:
AND NOT EXISTS FUNCTION1(T2.COL1, T2.COL2);
I wonder if that is possible. I was searching forum and documentation but did not find nothing useful. I do not know what type of function must be and how this could work. If someone now please help.
Regards,
IgorHello
If your 6 queries are hitting the same tables but are applying different where clauses i.e. filters, you might benefit from creating a view to encapsulate the common SQL. That way you only have to implement the core logic once and you can have your 6 queries go to the view... i.e.
CREATE OR REPLACE VIEW v_myview
AS
SELECT
   a,b,c,d....
FROM
   t2....
WHERE
    NOT EXISTS (SELECT 0
                       FROM TAB1 T1
                       WHERE T1.COL1 = T2.COL1
                       AND T1.COL2 = T2.COL2)
select * from v_myview WHERE a = 100
/HTH
David

Similar Messages

  • My Time Capsule does not work with existing WiFi

    Following a question solved on March 24 by LaPastenague, but gone bad again.
    Apple AirPort Time Capsule
    I felt the need for a physical backup of my data, as I would not completely trust the different clouds. I use, and have used Dropbox for 4-5 years and are very satisfied with that, but I am still not sure if or when a political lunatic will shut off the internet.
    I purchased the Apple AP Time Capsule 2T, because all my other stuff are Apple, and that it's wireless. My old backup is Maxtor 300 GB.
    Since we stay 2-3 weeks on two locations, one in Norway and one in Sweden (two different countries) we must use Mobile Broadband 4G, cables or fibre connections are useless for us, and we don't have it up to the houses. I have one mini router for each country, we bring with us iPhones, iPads, iMac, Apple TV, APExpress. When we pass the boarder I change the mini router, and the system continues working perfect on the WiFi, except the APExpress that needs to be reconfigured,  but then it works.
    The APTC was difficult to make working as it would not accept to be in an existing network, but with good help from the Apple Community, LaPastenague, with forcing the TC connect to the APE with Ethernet cable in bridge mode, ref "My Time Capsule does not work with existing WiFi" from March 24, the problem was solved and all gadgets worked together in a perfect harmony, until we changed location.
    Now, as I have my second WiFi network, and the APExspress is reconfigured, it's like the TC thinks, I am the base boss here, I am not taking orders from APE one more time, and it simply does not work, not only that, it fluctuates all the time.
    I have a slight feeling that the two WiFi bands are making the trouble as during the configuration of the TC sometime the last figure 6 and 7 pops up, and that has something two do with the two different 2,4 and 5 GHZ bands
    So, I am curious if you have any idea ?
    I am thinking of returning the TC if I don't make it work now, but how do I delete all the data that's on it?

    I can deal with the last question first and easily.
    I am thinking of returning the TC if I don't make it work now, but how do I delete all the data that's on it?
    Open the airport utility .. go to the disk tab and select erase.
    When you select erase you will get mulitiple options.
    Quick removes the file table but does not delete the files,, it takes 2min or less.
    A Zero out data is the secure way,, by writing 0 ie low level drive format.
    It can take several hours..
    7 pass will take a week.. not recommended..
    35 pass erase is ridiculous.. it would take a month.. put an ax through the TC. It is quick and better.
    Now, as I have my second WiFi network, and the APExspress is reconfigured, it's like the TC thinks, I am the base boss here, I am not taking orders from APE one more time, and it simply does not work, not only that, it fluctuates all the time.
    The fact that it did work and has now failed might point to faulty unit.
    The only way to tell is reset it properly to factory and start over.
    Universal Factory Reset.. any model TC or AE.
    Unplug your TC/AE from power or turn off at the power point.
    Hold in reset. and power the TC/AE back on..  all without releasing reset and keep holding in for about 10sec. (this is often difficult without a 2nd person or a 3rd arm).
    Release it when the status light flashes rapidly. If it doesn’t flash rapidly you have missed it and try again.
    Note..
    Be Gentle! Feel the switch click on. It has a positive feel..  add no more pressure after that.
    TC/AE will reboot after a couple of minutes with default factory settings and will wipe out previous configurations of the router.
    No files are deleted on the hard disk in a TC.. No reset of the TC deletes files.. to do that you use erase from the airport utility.
    Generally having multiple wireless AP should not cause problems.. but it is better to set channels manually.. so it doesn't go beserk rotating channels.
    Remember to keep all names short, no spaces and pure alphanumeric.
    Sadly though the Apple routers have no logging now and no SNMP and almost nothing to help diagnose a problem, so if it continues .. take it back to apple.. they have given you no other method of fixing it.

  • Has anyone figured out how to get speech recognition working with sticky keys enabled on mountain lion?

    I'm trying to use speech recognition to input text on my iMac running the latest mountain lion, 10.8.3.
    I have sticky keys enabled.
    When I try to start speaking by pressing the function key twice nothing happens. I can only get it to work if I disable sticky keys.
    The same problem occurs with all the other modifier keys as shortcut, they do not work with sticky keys.
    When I try to select a different shortcut, I am unable to select a two key combination, but am limited to one.
    If I select the F6 key, or any other single key, I am able to start speech recognition. However the second time that I press the key, it does not stop recognition and process my words. Instead, it restarts the recognition.
    Has anyone figured out how to get speech recognition working with sticky keys enabled?
    Or a way to get an individual key shortcut to start on the first press and process it on the second?
    Or a way to get key combinations to work, as specified by the help:
    Dictation On and Off
    To use Dictation, click On.
    When you’re ready to dictate text, place the insertion point where you want the dictated text to appear and press the Fn (function) key twice. When you see the lighted microphone icon and hear a beep, the microphone is ready for you to speak your text.
    Shortcut
    By default, you press the Fn (Function) key twice to start dictation. If you like, you can choose a different shortcut from the menu.
    To create a shortcut that’s not in the list, choose Customize, and then press the keys you want to use. You can press two or more keys to create your shortcut.

    I noticed with version 10.8.4 of OS X that I am now able to select F6 to activate, and the return key to complete the speech recognition. This is still different than the description of how these should function that's included in the help, but at least it's an improvement.

  • Working with existing HTML

    Hello all,
    I am anxiously working with Edge Animate and very excited at the prospect of what it has to offer. However, I'm running into problems working with existing HTML files. Specifically, when I open an HTML file created outside of Edge, I've noticed that elements such as div's, etc are set to "static" and not "managed". Thus, I am unable to access some parameters, like setting x/y and scale to percentages. Also, the stage is omitted and I can't see how to add a stage. I assume opening an HTML file and developing with Edge is not the way to do this?

    Hi, Nando-
    If you open an existing HTML, it will use the structure of that file and will try to keep it as close to its original state as possible, as you may have added CSS formatting to the div that we don't want to overwrite.  Thus, it becomes a "static" item instead of a "managed" element.  You can create your own managed elements on top of a file that you open by drawing rectangles/roundrects/ellipses (a div), adding text, or importing images to the stage, and all of these elements will be able to be changed using the controls in the toolbar and properties panel.
    Hope that helps.
    -Elaine

  • Is it possible to have your whole family on one apple id or is it better to have each person have there own? If each has their own does each id have to buy their own music and apps? How does find my iphone work with one apple id or two?

    Is it possible to have your whole family on one apple id or is it better to have each person have there own? If each has their own does each id have to buy their own music and apps? How does find my iphone work with one apple id or two? also I am going to be going off to college soon should I make an itunes id for my self and how will I get all the music from the old id?

    Is it possible to have your whole family on one apple id or is it better to have each person have there own?
    Yes, it is possible. 1 apple ID can be associated with up to 10 devices.
    If each has their own does each id have to buy their own music and apps?
    Yes, all purchases are non-transferable.
    How does find my iphone work with one apple id or two?
    Every device associated with one apple ID through Find my iPhone is tied to that Apple ID; Find my iPhone will work in the same way with up to ten devices associated with one apple ID. You cannot enable Find my iPhone for one device across two apple IDs
    I am going to be going off to college soon should I make an itunes id for my self and how will I get all the music from the old id?
    If you have authorized a computer with the old apple ID, you can transfer old media purchased through the old to other devices via iTunes. This doesn't mean the media purchases through the old apple ID it transferred to the new account. If you plan to make future purchases and don't wish to share them with others, make your own apple ID.

  • Our software vendor tells to use FF 3.5.1. because of some printer issues with their web based program. How safe is it to work with FF 3.5.1 in 2012?

    Our software vendor tells to use FF 3.5.1. because of some printer issues with their web based program. How safe is it to work with FF 3.5.1 in 2012?

    Thanks for the reply. I'll have a look at your solution.

  • How does the newest Iphone work with Ford Sync?

    How does the new Iphone work with Ford Sync? I was thinking of purchasing the 4s but may go elsewhere if there is a better phone for the equipment in my vehicle.

    That would be a NO.. I should have done my homework before I switched to IPhone because the Bluetooth just does not want to sync with my Ford Truck. Its such an inconvience. But I see from other posts that Ford isn't the only car experiencing problems. So Hopefully Apple fixes this problem QUICKLY!

  • How to configure Ogone for working with business catalyst ?

    How to configure Ogone for working with business catalyst ?
    In france ogone seems to be the only solution for seamless payment and there's no explications on the forum to configure it.
    Thx for your answers

    Hi ,
    [Configuration Guide SAP adapter for SAP Quality Center by HP|https://websmp101.sap-ag.de/~sapdownload/011000358700000612662007E/Adapter_Configuration_.pdf] might be useful.
    Check [Master guide|https://websmp201.sap-ag.de/~sapdownload/011000358700000612672007E/Adapter_Master_Guide.pdf]  also.
    Regards
    Naveen
    Edited by: Naveen kumar Palanichamy on Feb 19, 2009 6:38 AM

  • How does premiere pro CC work with nvidia GT 630M (2GB) vega???!

    how does premiere pro CC work with nvidia GT 630M (2GB) vega????!

    That will work. I would just not expect major performance with a heavier load on playback.
    Eric
    ADK

  • How are we supposed to work with the new motion tweens if there's no motion editor anymore?

    How are we supposed to work with the new motion tweens if there's no motion editor anymore? Without motion editor we can't see what kind of keyframes are set and we can't set any accelerations anywhere. Does Adobe now want us to go back and use the old motion tweens?

    Hi All,
    Flash Pro CC 2014 (v 14.0.0.110) is now available for download via the Creative Cloud App.
    We have included an all new Motion Editor along with several other new features with this release of Flash Pro. The new Motion Editor is completely redesigned, intuitive and easy to use while preserving the core functionalities and backward compatibility with Flash CS6
    To Invoke the Motion Editor, simply Double-Click on your Motion Tween span on Timeline (or Right-Click and select 'Refine Motion') and the Motion Editor opens up in-context in the Timeline itself. Double-Click again to collapse once you have made your adjustments.
    Complete list of New features in Flash Pro CC 2014 is available at these links:
    Overview:         https://www.adobe.com/in/products/flash.html
    Whats new:      https://helpx.adobe.com/flash/using/whats-new.html
    Release Notes: https://helpx.adobe.com/flash/release-note/flash-professional-cc-2014.html
    Videos:           https://helpx.adobe.com/in/flash.html
    Thanks,
    Nipun

  • All songs in my iTunes library are listed twice. I have two copies of my library in two different locations. How do I make iTunes work with one copy of my library?

    All songs in my iTunes library are listed twice. I have two copies of my library in two different locations. How do I make iTunes work with one copy of my library?

    That is the way the iphone works.
    You need to copy everything from your backup copy of your computer.

  • How does operator 'less than' work with Rectangle objects?

    Just found in legacy code the following:
    private var firstRect:Rectangle;
    private var secondRect:Rectangle;
    if (firstRect < secondRect)
    // do something
    How does operator 'less than' work with Rectangle objects?
    Doc says that object is converted to number if it is not a String.
    Rectangle is not a String, though has conversion to String.
    Please help.

    IME the best way to know for sure is to experiment. The docs are only one person's best understanding of how things worked on the day, which is seldom 100% accurate. I find that even with code I wrote I can't accurately say 100% of what it does until I've worked with it for a while. Keep in mind that the docs are usually written when the code is written, so  never expect more than a rough idea from the docs.

  • Just installed a new time capsule and i want to use my airport express to extend my wireless range....time capsule working with existing devices at this time...but i am not able to get airport utility to recognize the airport express.....????

    just installed a new time capsule and i want to use my airport express to extend my wireless range....time capsule working with existing devices at this time...but i am not able to get airport utility to recognize the airport express.....????

    Temporarily connecting your AirPort Express to one of the Time Capsule's Etherent LAN <-> ports...as LaPastenagure suggests....is always a good way to setup and configure other network devices.
    If you want to configure the Express using wireless, remember that the Express broadcasts a default wireless signal with a name like Apple Network xxxxxx. You must log on to this network first....no password is required....then open AirPort Utility to "see" the AirPort Express.

  • How well does Compressor 4 work with Final Cut 6?

    How well does Compressor 4 work with Final Cut 6?

    The short answer is that there is no interoperability between them. Of course, you can certainly export a QT movie from FCP and bring it into C4.
    Honestly, I'm not sure it's worth it for someone already has C3. There is very little that C4 can do that C3 cannot. The major differences are that C4 has certain presets like  MPEG 4 h.264 and 1080 Apple TV; it can also create simple Blu Rays and DVDs. Qmaster is integrated, but I'm not sure whether that is a gain.
    Russ

  • How well does the Ipad2 work with the verizon 4g hotspot?

    How well does the ipad2 work with the verizon 4g hotspot?

    WoW Macbook Pro 2011 15" i7 2.3Ghz quad core AMD 6750 hi-res AG OSX gameplay with FPS and temps 
    MacBook Pro 17in. Review (Early 2011) 
    http://www.youtube.com/watch?v=hiEDf_l0PqY

  • How do i set up an iCloud account to work with existing hotmail account

    So i have iphone 4s and a macbook and i want the email address that i used to have sync via fetching the data manually to work with icloud, I made an icloud account so that i could do this but now that and the other email account are seperate so nothing ever syncs, how can i just add my hotmail account to icloud to make it sync to my iphone automatically?

    There is no way to setup iCloud on a PC, it must be setup first on a compatible Mac, iPhone, iPad or iPod touch.

Maybe you are looking for

  • Custom fields to backend

    I have custom field at header level in purchase order. Our's is extended classic scenario, mapping is fine at header level as i see while debug in the BADI BBP_ECS_PO_OUT_BADI, *-- PO CUF at header level   MOVE 'POHEADER'               TO wa_cust-ref

  • Long Running Task ...

    I have a requirement where a user kicks off a long running task ( usually 2 to 5 minutes). I want to show a 'In Progress' message while the task is procesing. The long running process needs to be passed an ArrayList. To achieve this , I use a ServerS

  • Setting alv layout  as defualt for all usres

    Hi, Is it possible to set the webdynpro alv layout set as default for all users. I need your input if this is possible in WD ABAP ALV setting. Thanks in advance ! Alok

  • Mac Book OS X 10.6.8  installer not working

    I've trying to update my Itunes and it will not work i get the following message: "The update could not be expanded, and may have been corrupted during downloading. The update will be downloaded and checked again the next time that Software Update ru

  • Norton AntiVirus on MacBook?

    I previously had a MacBook Pro for a few days and had installed Norton AntiVirus on it with no problems. But when I switched over to the MacBook, installing and using Norton was a nightmare (almost as bad as not being able to sync with Bluetooth). I