Rewrite of request of old style in ANSI format

Hi guys,.

I have the following query of old style that I have written in ANSI format. However, the new query return less number of records compared below. The idea was to make the code more readable and more effective. In addition, I'm not quite sure mean the following statements in the old query:
AND UPPER(a.class(+)) = 'LCS'AND 
eff.Efftotal(+) LIKE p_vessel
As I understand it, he's trying to do a LEFT JOIN and EFFTOTAL CLASS could have NULL values. Here's my interpretation:
AND (UPPER(aref.class) = 'LCS' OR aref.class IS NULL)  
-----------------
OLD QUERY
-----------------
SELECT Docobid,
             Docno,
             Title,
             Revision,
             type,
             Shipselectedrecord,
             Tsc,
             Sourceofpm,
             Daconfigured,
             Dasignoff,
             Lifecyclestate,
             Securityclassification,
             Organisation,
             class,
             Efftotal,
             raisedAgainstCNCount,
             releasesCNCount,
             resultsInCNCount
        FROM (SELECT td.Docobid,
                     td.Docno,
                     td.Title,
                     td.Revision,
                     td.TYPE,
                     td.Shipselectedrecord,
                     td.Tsc,
                     td.Sourceofpm,
                     td.Daconfigured,
                     td.Dasignoff,
                     a.longDesc as Lifecyclestate,
                     td.Securityclassification,
                     td.Organisation,
                     eff.CLASS,
                     eff.Efftotal,
                     REPLACE(eff.class || ' ', ' ', ' NULL_EFF') AS classCalc,
                     REPLACE(eff.Efftotal || ' ', ' ', ' NULL_EFF') AS EfftotalCalc,
                     COUNT(ra.cnobid) + COUNT(raBlank.Cnobid) +
                     COUNT(raNull.Cnobid) AS raisedAgainstCNCount,
                     COUNT(rel.cnobid) AS releasesCNCount,
                     COUNT(ri.cnobid) AS resultsInCNCount
                FROM ttcTecDoc     td,
                     ttcRevEff     eff,
                     ttcAdminRef   a,
                     Ttccnaffects  ra,
                     Ttccnaffects  rablank,
                     Ttccnaffects  ranull,
                     Ttccnaffects  rel,
                     Ttccnresultin ri
              /* Doc Attribute Filter */
               WHERE td.Program = p_program
                 AND td.Project = p_project
                 AND UPPER(td.Docno) LIKE UPPER(p_docName)
                 AND UPPER(td.Revision) LIKE UPPER(p_rev)
                 AND UPPER(td.type) LIKE p_docType
                 AND UPPER(td.Organisation) LIKE p_org
                 AND a.short(+) = td.lifecyclestate
                 AND UPPER(a.class(+)) = 'LCS'
                    /* Effectivity Filter */
                 AND td.Docobid = eff.Revobid(+)
                 AND eff.CLASS(+) LIKE p_class
                 AND (eff.CLASS LIKE p_class OR
                     (eff.CLASS IS NULL AND p_class = '%'))
                 AND eff.Efftotal(+) LIKE p_vessel
                 AND (eff.Efftotal LIKE p_vessel OR
                     (eff.Efftotal IS NULL AND p_vessel = '%'))
                    /* Raised Against CN Count Filter */
                 AND td.docobid = ra.itemobid(+)
                 AND ra.disposition(+) = 'Raised Against'
                 AND td.docobid = raBlank.itemobid(+)
                 AND raBlank.disposition(+) = ''
                 AND td.docobid = raNull.itemobid(+)
                 AND raNull.disposition(+) IS NULL
                    /* Releases Count Filter */
                 AND td.docobid = rel.itemobid(+)
                 AND rel.disposition(+) = 'Releases'
                    /* Results in Count Filter */
                 AND td.docobid = ri.itemobid(+)
               GROUP BY td.Docobid,
                        td.Docno,
                        td.Title,
                        td.Revision,
                        td.type,
                        td.Shipselectedrecord,
                        td.Tsc,
                        td.Sourceofpm,
                        td.Daconfigured,
                        td.Dasignoff,
                        a.longDesc,
                        td.Securityclassification,
                        td.Organisation,
                        eff.class,
                        eff.Efftotal,
                        ra.disposition,
                        raNull.Disposition,
                        raBlank.Disposition,
                        rel.disposition
               ORDER BY td.Docno, td.Revision)
       WHERE (classCalc LIKE '%' || p_class || '%' OR
             classCalc LIKE p_classCalc)
         AND (EfftotalCalc LIKE '%' || p_vessel || '%' OR
             EfftotalCalc LIKE p_vesselCalc);
-------------------------
NEW SQL QUERY
-------------------------
SELECT Docobid,
             Docno,
             Title,
             Revision,
             type,
             Shipselectedrecord,
             Tsc,
             Sourceofpm,
             Daconfigured,
             Dasignoff,
             Lifecyclestate,
             Securityclassification,
             Organisation,
             class,
             Efftotal,
             raisedAgainstCNCount,
             releasesCNCount,
             resultsInCNCount
        FROM (SELECT td.Docobid,
                     td.Docno,
                     td.Title,
                     td.Revision,
                     td.TYPE,
                     td.Shipselectedrecord,
                     td.Tsc,
                     td.Sourceofpm,
                     td.Daconfigured,
                     td.Dasignoff,
                     aref.longDesc as Lifecyclestate,
                     td.Securityclassification,
                     td.Organisation,
                     eff.CLASS,
                     eff.Efftotal,
                     REPLACE(eff.class || ' ', ' ', ' NULL_EFF') AS classCalc,
                     REPLACE(eff.Efftotal || ' ', ' ', ' NULL_EFF') AS EfftotalCalc,
                     COUNT(ra.cnobid) AS raisedAgainstCNCount,
                     COUNT(rel.cnobid) AS releasesCNCount,
                     COUNT(ri.cnobid) AS resultsInCNCount
                FROM ttcTecDoc td
                LEFT JOIN ttcadminref aref ON  td.lifecyclestate = aref.short
                LEFT JOIN ttcreveff eff ON td.docobid = eff.revobid
                LEFT JOIN ttccnaffects ra ON td.docobid = ra.itemobid
                LEFT JOIN ttccnaffects rel ON td.docobid = rel.itemobid
                LEFT JOIN ttccnresultin ri ON td.docobid = ri.itemobid
              /* Doc Attribute Filter */
               WHERE td.Program = p_program
                 AND td.Project = p_project
                 AND UPPER(td.Docno) LIKE UPPER(p_docName)
                 AND UPPER(td.Revision) LIKE UPPER(p_rev)
                 AND UPPER(td.type) LIKE p_docType
                 AND UPPER(td.Organisation) LIKE p_org
                 AND (UPPER(aref.class) = 'LCS' OR aref.class IS NULL)  
                    /* Effectivity Filter */
                 AND (eff.CLASS LIKE p_class OR
                     (eff.CLASS IS NULL AND p_class = '%'))
                 AND (eff.Efftotal LIKE p_vessel OR
                     (eff.Efftotal IS NULL AND p_vessel = '%'))
                    /* Raised Against CN Count Filter */
                 AND (ra.disposition = 'Raised Against' OR ra.disposition IS NULL)
                 AND (rel.disposition = 'Releases' OR rel.disposition IS NULL)
               GROUP BY td.Docobid,
                        td.Docno,
                        td.Title,
                        td.Revision,
                        td.type,
                        td.Shipselectedrecord,
                        td.Tsc,
                        td.Sourceofpm,
                        td.Daconfigured,
                        td.Dasignoff,
                        aref.longDesc,
                        td.Securityclassification,
                        td.Organisation,
                        eff.class,
                        eff.Efftotal,
                        ra.disposition,
                        rel.disposition
               ORDER BY td.Docno, td.Revision)
       WHERE (classCalc LIKE '%' || p_class || '%' OR
             classCalc LIKE p_classCalc)
         AND (EfftotalCalc LIKE '%' || p_vessel || '%' OR
             EfftotalCalc LIKE p_vesselCalc);
Really would appreciate help of experts out there.

Thank you very much.

rohan123 wrote:
Thanks for your reply, it makes sense. But what I don't understand is why join you a table column and a parameter, or a value of "CHA". Would it not be better to write as a WHERE clause or condition AND?

Hello, one thing to know with ANSI OUTER joins is that if you include a filter on a table OUTSIDE joint in the WHERE clause, you convert that to an INNER JOIN. Thus, for example, this:

SELECT *
  FROM table1 t1
  LEFT OUTER JOIN table2 t2 ON (t1.id = t2.id AND t2.col1 = 'ABC')

Is an OUTER JOIN, but this:

SELECT *
  FROM table1 t1
  LEFT OUTER JOIN table2 t2 ON (t1.id = t2.id )
WHERE t2.col1 = 'ABC'

Is an INTERNAL JOIN.

Tags: Database

Similar Questions

  • During riding an old style CSS with a new

    Hello

    I'm still learning how to deal with CSS and I'm having this problem. I'm redesigning an existing site and trying to replace the old styles with new ones. When I select the text I want to change, I try to apply a new style, and it does not work. It is sometimes applied part of the style. I tried to change the order of the styles in the Panel "all rules", but that did not work. The old rule is #content a: hover, a: active and the new (top of the list) is #named anchor. The problem is that the old one looks like a link to nowhere (there is a background color). I know that there must be a simple solution here (in addition to cut and paste text that looks right in different place and rewriting of the text as I've been doing-AHHHHH!). I don't want to change the properties of this rule, because it works in other places would impede the Web site. Can I delete somehow all the information of old style off the coast of these positions, and then reapply the new style? Help!

    Wrap your headers in

    ,

    and

    Tags in the HTML properties panel.

    Then style your headers using the CSS properties panel.

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • What happened to the police of Iowan Old Style pages?

    Hello! I opened Pages today to write a short story. I use my favorite font, Iowan Old Style, for this. I went to select, it wasn't there. If it has been removed in the updated Pages/IOS 10? I just want to know - thank you!

    I can confirm that it is not available on my iPad as well. But since I have never used or had no interest in him, can't say when it was deleted or if I'd never.

  • How can I move my music from iPod to old style to my computer so I can reload the music to a new iPod?

    How can I move my music from iPod to old style to my computer so I can reload the music to a new iPod?

    You should really have your iTunes library on your computer and keep a current backup of it.  iDevices are not designed or adapted for the storage of data in the long term.  See the tips to the user of turingtest2 on recover your iTunes from your iPod or an iOS device for a list of tools and methods (for Windows and Mac) that can be used to copy media from your iPod to your computer.

  • Taskbar appearance, siderbar and window Windows Vista continues to change in the old style.

    Every so often the appearance of my windows and the menu siderbar and start and the taskbar by default to the old style. How can I change this back, and how can I prevent this from happening?

    Hello

    What are you doing with the system when he returns? This behavior indicates something interferents or incompatible with the aero theme, so he stops. You must consider what remains is produced on the system when this happens. A boot minimum troubleshooting can help, find the steps detailed here: http://support.microsoft.com/default.aspx/kb/331796?p=1

    Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org

  • Is it possible to change the format of Windows 8 back to the old style like Windows 7 or XP? This Windows 8 is the worst thing that ive had to face since owning a computer!

    Is it possible to change the format of Windows 8 back to the old style like Windows 7 or XP? This Windows 8 is the worst thing that ive had to face since owning a computer. When you try to browse, it takes you to some completely different screen that you don't want to go because the parameters are so sensitive. The old style was not broken. There is no reason or need to repair or change it!

    Is it possible to change the format of Windows 8 back to the old style like Windows 7 or XP? This Windows 8 is the worst thing that ive had to face since owning a computer. When you try to browse, it takes you to some completely different screen that you don't want to go because the parameters are so sensitive. The old style was not broken. There is no reason or need to repair or change it!

    Search before asking.  ;-)
      http://www.eightforums.com/customization/12971-list-start-menu-replacements-Windows-8-a.html
     
    A change is not always a "fix."  Sometimes, it's just a change.
     
    Pick one that allows you to boot to the desktop with a Start Menu/button as you're used to.

  • How can I apply a new style with an excerpt and DW artifact of the old style?

    Hello

    I use Dreamweaver CS5 in Windows XP SP3. My problem seems simple, but the resolution remains elusive.

    Let's say I'm stuck-in editing the text in MS Word that DW auto-formaté. I highlight text and use a clip to attach the text of the h2.

    Rather than delete the old style and its replacement by h2, DW applies the h2, but copy the old style, enclosing nothing and it bumps to the next line. If the old style included a paragraph tag, which flows into the extra space. For anything.

    Now, this seems to be a minor thing, but it is not so little, when you try to quickly prepare a large document with different header styles. Having to make dozens of changes that, in my view, should be completely useless becomes a burden.

    Is it possible to attach some text in a new style with an excerpt without the old style of stick around?

    Thanks for all the answers!

    Oreo Say

    If I pointed out this bit and click to apply my excerpt:

    The header

    the result is:

    The header

    You need not of snippets for this.

    Select it

    tag with the selector tag between (bottom of the design view) and the top of the property inspector, then, in the property inspector, Select Heading 2 in the dropdown Format menu.

    DW will replace

    with

  • Why not save a file HOST Unicode or any other format beside ANSI format? Either way, which is Unicode format?

    Why not save a file HOST Unicode or any other format beside ANSI format? Either way, which is Unicode format?

    You would normally use unicode when you want to a text file that contains those outside of the normally the ASCII value... accentuated characters and others. They are rarely used in the definition of host names.

  • delete the cell style - to preserve formatting

    Hello scripters.

    Is it possible to preserve the formatting when I remove a cell applied by the following code style?

    "MyCellStyle.remove (app.activeDokument.cellStyles.firstItem ());

    How can I access this feature in my script? (see also the screenshot-> red arrow)

    perserve_formating.png

    Thanks for the tips.

    Roland

    Roland:
    You can browse all your cells with the applied cell style, select the cells, one after the other and apply a menu action to break the link style ("Break link to Style" / "Operation mit Format Hegelian").

    You can then delete the cell style without losing any formatting.

    To invoke the menu action, you can use this code. For security reasons, I've got it wrapped up with a "try/catch":

    //Disconnect the cell with the applied cell style (option in the cell styles panel of the UI: "Break Link to Style" / "Verknüpfung mit Format aufheben"):
    try{app.scriptMenuActions.itemByID(132129).invoke()}catch(e){};
    

    Uwe

  • by default generate scripts in the old style instead of ansi to designer lev joins

    I have already deployed 1000 owb mapings and default is to show the intermediate result script in ANSI syntax.

    Is it possible to change the property of configuration in OWB (syntax SQL ANSI false condition) to the generation of ANSI SQL and Oracle SQL-level code instead of the mapping level designer?

    Help, please.

    Hello

    There is a quick blog here;
    https://blogs.Oracle.com/warehousebuilder/entry/owb_configuration_templates_default_values

    See you soon
    David

  • Old style Searchbar disappeared after update

    Set Firefox to automatically update this morning at 43.0. Since then, my search bar appears now as the latest new style. Previously I had been using the subject: thing of config with browser.search.showOneOffButtons = False parameter to keep the older style (one that has the drop-down menu to select, then click the visible search engine).

    I checked that the selection of OneOffButtons is always false and even tried under tension of this return to True, and then returns to False. No luck. Is this an intentional change? Does anyone know how to go back to the old search without decommissioning bar?

    For my work, I often have to do repeated searches with custom search engines loaded. It is easier simply select the engine (or even Ebay so I'm looking a bunch of stuff from Ebay) and then to search repeated with this engine without having to select this engine in the drop-down list more recent every time. It's also nice to have the Visual indicator of what the current engine is selected instead of the magnifying glass.

    In other words, the most recent search, for me, bar has lost virtually all of the features in terms of ease of use. I use Firefox for years and it was pretty much the last thing keep me hanging instead of switch to Chrome.

    "browser.search.showOneOffButtons" was a temporary thing. The underlying code that have supported this preference is gone like Firefox 43.

    https://addons.Mozilla.org/en-us/Firefox/addon/classicthemerestorer/ has an option for old search (experimental) in Options of CTR > UI (1)

  • If we consider how help topics are listed in the NEW TAB page, it would not sense for her return to the old style, one that was simple and effective

    Suck it features 'NEW TAB', to say clearly in computer talk about the terms. With so many people asking how it works or how to get back to the old design, would it be better to compile all the negative comments and confusion on this new format, and reverse back to the old design? As the saying goes... "IF IT ain't BROKE...". DO NOT REPAIR. "I don't even use the NEW TAB page now that I have no desire to understand or read how get my links to be retained and which stored again. A lot of my links aren't there anymore and even visit the sites, is not put these links on the NEW selection TAB page. Honestly this just unwanted thing. Guys we need to stop changing things that work. Sometimes, when a thing is created... you were right the first time. Sorry, but are running out of Internet Explorer. They did not move, but... when they have did... it was just things that need an update or a hotfix.

    I also hate the new shit tab in 38.0.5!

    Open a new tab if you need with speed, it's much better all you have to do is write about: config newtab in the search box and and delete what has the newtab value, as you can see in the picture, I don't download.

  • I had a tab in my top left of my page that says firefox and I did something and his party, and now it has the old style of menu there how change this back?

    I had a tab at the top left that says firefox and I could go there to manage the toolbars, history and other things. I clicked on something and now there is the old format which has (file, publishing, display, etc.). Now my favorites have went on the right side to the left side. I have it want to come back and do not know how to fix it.

    Right click on some empty on the toolbar and deselect the menu baroption.

  • Call request phone old history of more than 6 months

    Hello

    I read in the forum that I could request a history of my calls Skype (for the acutal phones) over 6 months. I just want to know how do I make a request?

    Thank you very much.

    Max

    maaxhu wrote:

    I just want to know how do I make a request?

    Hello Max,.

    Please file here:

    https://support.Skype.com/en/FAQ/FA1170/how-can-I-contact-Skype-customer-service

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • How can I request a div style?

    I can't apply a Div style I created. I can use the style successfully if I manually, enter it in the page HTML code, but can't find a way to do the same in the user interface.

    Here's what I did when I tried to use the user interface: I selected a paragraph in my topic, go to styles Styles pod/Div and double-clicked on the new style.

    Result: nothing has changed - no style added, no changes to the underlying HTML language.

    There must be a simpler way you manually enter in the HTML code... someone could shed some light, please?

    Thank you

    G

    I checked not too far behind for someone else. It is an omission in the design editor that Adobe are aware now.

    See www.grainge.org for RoboHelp and Authoring information

    @petergrainge

Maybe you are looking for