Scope aliases in union issue

I use 11.2.0. I need to create a select to get a set of objects as well as data from related tables to a view type dashboard.

Here are simple tables that illustrate the problem:

CREATE table operation
(
operation_key op_nn1 NUMBER (10) CONSTRAINT NOT NULL,.
name VARCHAR2 (30),
order_key number (10),
PkO CONSTRAINT PRIMARY KEY (operation_key)
);

CREATE the table oper_part
(
operation_key opp_nn1 NUMBER (10) CONSTRAINT NOT NULL,.
part_key opp_nn2 NUMBER (10) CONSTRAINT NOT NULL,.
PkOP CONSTRAINT PRIMARY KEY (operation_key, part_key),
CONSTRAINT fkOP FOREIGN made REFERENCE to KEY (operation_key) operation (operation_key) ON DELETE CASCADE
);

create table step
(
step_key stp_nn1 NUMBER (10) CONSTRAINT NOT NULL,.
name VARCHAR2 (30),
operation_key number (10) stp_nn2 of the CONSTRAINT NOT NULL,.
PkS KEY (step_key) PRIMARY CONSTRAINT.
FkS of CONSTRAINT FOREIGN made REFERENCE to KEY (operation_key) operation (operation_key) ON DELETE CASCADE
);

CREATE the table step_part
(
step_key stpp_nn1 NUMBER (10) CONSTRAINT NOT NULL,.
part_key stpp_nn2 NUMBER (10) CONSTRAINT NOT NULL,.
PkS CONSTRAINT PRIMARY KEY (step_key, part_key),
CONSTRAINT fkSP FOREIGN made REFERENCE to KEY (step_key) step (step_key) ON DELETE CASCADE
);

Here's a statement select fails to analyze:

SELECT a.operation_key, b.SID,
(SELECT COUNT (*) OF)
(SELECT op.part_key
Of oper_part op
WHERE op.operation_key = a.operation_key
UNION
SELECT sp.part_key
Of AFTER step please
INNER JOIN step_part ON sp.step_key = stp.step_key Ms
WHERE stp.operation_key = a.operation_key)) bom_count
One OPERATION
WHERE a.order_key = 2
ORDER BY a.operation_key;

The error I get is:
ORA-00904: "A". "" OPERATION_KEY ": invalid identifier
00904, 00000 - '% s: invalid identifier '.
* Cause:
* Action:
Error on line: column 5:36

I don't see how this can be out of reach. The alias is defined in the WHERE clause, and the column is valid. It is the scope of the rules which forbid what I try to do, or is this a bug? If the scoping rules, where can I find that documented and is there a work around?

Thanks in advance for your help.

Sincerely,

Jim Brandley

Hi, Jim,.

It is difficult to correlate a subquery at the request of his grandparents.
It can be simpler and more effective to get the desired results with a join rather than a correlated subquery, like this:

WITH  union_results     AS
(
     SELECT  part_key
     ,     operation_key
       FROM        oper_part
    UNION
        SELECT  sp.part_key
     ,     stp_opeation_key
       FROM      step          stp
     JOIN      step_part   sp   ON   sp.step_key = stp.step_key
)
,     got_bom_cnt          AS
(
     SELECT        operation_key
     ,        COUNT (DISTINCT part_key)     AS bom_cnt
     FROM        union_results
     GROUP BY   operation_key
)
SELECT       o.operation_key
,       o.name
,       b.bom_cnt
FROM           operation     o
LEFT OUTER JOIN      got_bom_cnt     b  ON  b.operation_key  = o.operation_key
WHERE        o.order_key   = 2
ORDER BY  o.operation_key
;

I hope that answers your question.
If this isn't the case, display the instructions INSERT for examples of data and the results desired from these data.
Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum {message identifier: = 9360002}

Tags: Database

Similar Questions

  • Setting alerts for newly added or deleted nodes

    Hi all

    Is there a way to create an alert when one of my team members add or remove a node from the cluster, it sends an email to say a particular user added or removed a node? That will be extremely useful for us to follow the State of health.

    Any ideas or suggestions would be greatly appreciated.

    Thank you

    Prashanth

    Hello

    This seems to be outside the scope of this script (issue probably General vSphere that you can post in the forum of vSphere), but you can certainly create an alarm based on an event or a threshold. If you go in your vCenter Server server, there is an option under alarm is triggered when a host is added. You can do cela a general alarm for your vCenter server or on a specific cluster. The alarm, you can send either an SNMP trap, run a script on the vCenter server or send an e-mail.

  • Aliases in a UNION query

    Hello people.
    Since I found nothing on Google, here's my simple question:

    How can I use column aliases in a UNION query. It seems that if I specify the alias it will not appear.

    Ex:
    SELECT * FROM
    (
    SELECT SYSDATE FROM DUAL
    UNION ALL
    SELECT SYSDATE FROM DUAL
    )  TEST;
    Will not serve the TEST column aliases.

    Thank you in advance.

    You have not shown how it does not work for you.

    SQL> ed
    Wrote file afiedt.buf
    
      1  SELECT * FROM
      2  (
      3  SELECT SYSDATE as mydate FROM DUAL
      4  UNION ALL
      5  SELECT SYSDATE FROM DUAL
      6* )  TEST
    SQL> /
    
    MYDATE
    --------------------
    18-MAY-2012 10:46:04
    18-MAY-2012 10:46:04
    

    looks ok to me.

  • Import files *.ai as vectors, aliasing issues

    Greetings to all.

    I have a weird problem here in AE.

    I'm trying to import some vector files from Adobe Illustrator to AE and I'm having a hell of a time doing so. The files to import very much like merged images, but when I drop them into a composition lines appear all aliases and so fuzzy.

    What is curious to me, is that these lines fall on whole pixels in Adobe Illustrator. The object is placed on whole AE pixels (as it should). Maybe 80% lines are fine - perfectly crisp and accurate (as I expect), but the other 20% is an alias for a reason completely beyond me. I have tried to change the anti-aliasing options in the interpretation of the images of fast accurate - not avail. Activation or deactivation of continuously rasterize has no effect because the images is not be scaling.

    I know are vector files, well, vector and some things like curves and other things are meant to be an alias. What I don't understand, is why AE is quirking out and lines of aliasing that are otherwise perfectly straight and should create a cutting edge completely. AE seems to think that this isn't the case and I get an additional border of pixels that shouldn't be there.

    Why is this happening?

    -KT

    OK, I had a look at the pictures:

    It's one of the Illustrator:

    It's that of EI:

    I guess that these images are screenshots to 3200%. It would be easier to understand if I had the file HAVE original but I'd be willing to bet that the reason it HAVE screenshot shows the grey pixels on the edge is the file HAVE is interpreted as an odd number of pixels wide. This brings sampling sub pixel at stake and gives you the antialiasing your seeing.

    You say that the file is set on paths of pixelation at 72 dpi. What you probably meant was that Document pixelation effect parameters have been set at 72 dpi. Document raster settings have no effect in After Effects. Probably, what is happening here is that the work in Illustrator is not exactly aligned to the pixel grid so AE is adding a pixel to the width of interpretation of the work. If it is an Illustrator file imported as a model using layer sizes so you should be able to see this in the information palette. If your artwork is imported as a file instead of a model then the size of the artboard will be the dimensions. If you have imported as a model, then you will see the position values that are not on the nearest whole pixel. If the work is not exactly positioned in artificial intelligence on a pixel, and then you will see pixel whole values position and anchor point unless the work plan is an odd number of pixels high or wide.

    Take a look at this example. Same work, exactly positioned on the artboard, an even number of pixels high and wide with 2 settings different raster give exactly the same look on the right side but show the sub pixel on the left product sampling gray lines when the Test2.ai file is out of position by a fraction of a pixel.  The red glow was created in illustrator with the two different Document Raster display settings.

    In AE screenshots were taken at 400%.

    Fix the position of your layer of in AE or correct the positioning of the work in AI and you should be able to clean the right side of your image in AE.

    Also antiailising issues and the edges as if you were seeing in the screenshots you posted are perceived differently in a film in a still. There is no way that you can keep your illustration clearly defined with no gray on the sides pixels if the layer moves to something other than a multiple whole pixel by image on the screen. Moving to values whole pixel by image can actually produce a Visual variation which is very hard on the eyes, even if executives are sharp as a cleat. The only way you can judge the quality of a film is watching as he played at a speed on the device you use for playback. I was shocked the first time I've seen a title sequence that I created for a film transferred to the film and projected. The variation has been terrible, and I had to redo the synchronization of the entire project. He expects much to read on the screen of my computer, horrible on film. After that I fixed it the titles was beautiful at the same time.

  • I can't see a message from my Union because of problems with the address changed for pop-upwindows and some other issues

    Hello
    I am from Sweden and I have problems with a Web site that has my Union. I could see messages from them before, but they changed their address and on the site, they say people that they must put the new address on the approved list of the pop-up windows. I did but it still does not. Maybe I did wrong, I don't know, but it's annoying as hell that I can't see the messages they send.

    I really need help with that.

    Best regards
    Lena

    You can control and manage permissions for all areas on the Subject: authorizations page.

    You can delete all data stored in Firefox with a specific area through "Forget this Site" from the context menu of the history entry (see the history or the history sidebar) or via the subject: permissions page.

    Using "Forget this Site" will delete all data stored in Firefox in this area as bookmarks, cookies, words of past, cache, history, and exceptions, so be careful and if you have a password or other data from this area you don't want to lose so take note of these passwords and bookmarks.
    You can't recover from which "forget" unless you have a backup of the affected files.

    It has no lasting effect, so if come back you on such a 'forgotten' site, then the data of this Web site will be saved once more.

  • another namespace issue? 'CameraSettings' was not declared in this scope

    I have a camera native c ++ application coded and run successfully.

    I want to change the flash mode.  So I add:

    CameraSettings* cameraSettings = new CameraSettings();
     cameraSettings->setFlashMode(CameraFlashMode::Light);
     camera->applySettings(cameraSettings);
    

    I also add:

    #include 
    #include 
    

    When I build, I get the error:

    'CameraSettings' was not declared in this scope.

    Is it a matter of namespace or a:

    LIBS += ?
    

    ... question?

    Something else?

    My current LIBS:

    LIBS += -lcamapi -lscreen
    

    I see what is happening, I mix with QT c functions.

    I need to use the settings as shown in this example:

    http://supportforums.BlackBerry.com/T5/native-development/Flash-always-on-camera/m-p/1911403/HIGHLIG...

    Thanks for your help.

  • Union of order by causing the issue of SetWhereClause

    Hello

    I am extending a CO and addition of new query to the query of the VO.

    I've added a where clause to the query of the VO. Also, the Union added. The Union is the same query VO with another condition where. Failure to query VO was an order by clause.

    The total query now looks like this.

    Select * from
    (select a, b).
    x, y) QRSLT
    where the...
    UNION
    Select * from
    (select a, b).
    x, y) QRSLT1
    where the...
    order of upper (a)

    'Order by' is doing added since this is in the initial request of the VO.

    Now, I get the error like "java.sql.SQLException: ORA-01785: ORDER BY item must include the number of an expression in the SELECT list.

    The query above without the order of works well. What is the best way to solve this problem?

    Thank you
    HC

    Just add the order by clause also during runtime when you add the additional query than seeded.

    Thank you
    -Anil
    http://oracleanil.blogspot.com/

  • issues of scope: verification of string values in the upper levels of Foreach loops

    We have problems with a RTF model. How can you check a string value in a loop for each higher level? Here is a trivial example, the RTF does not appear anything.

    < LEVEL1 >
    < LEVEL1_NAME > ANN < / LEVEL1_NAME >
    < LEVEL2 >
    < LEVEL2_NAME > BOB < / LEVEL2_NAME >
    < / LEVEL2 >
    < / LEVEL1 >

    RTF:

    <? for-each: LEVEL1? >
    <? for-each: LEVEL2? >
    <? If: LEVEL1_NAME = "ANN"? >
    <? LEVEL2_NAME? >
    <? end if? >
    <? end foreach? >
    <? end foreach? >


    Thanks for any help, we were faced with this days.
    Mike W.

    Or navigate between them using file.., use... to move up a level

    
    ANN
    
    BOB
    
    
    

    RTF:

    
    
    
    
    
    
    
    

    or can be implemented, without if statement.

    
    
    
    
    
    
  • Preview color management issue - glued assigned Adobe RGB image

    I often web elements page layout in InDesign that my composition tool, then copy and paste in Photoshop as a smart object to then generate optimized web images. It's just easier to use photoshop. Problem, it is in the latest versions of Adobe have clogged the engine of anti-aliasing and now when rasterising a PDF file or paste a picture also as a chip oppose any portion of the image of this asset is smoother. You don't really notice that if the image of origin placed in InDesign is say double or more this resolution of the web version of final product, the scale hides the issue. But if they are closer to really see faceting full size occurs. Long story... anyway, I decided to study the implementation overview of Apple as a gateway for the rasterising instead of photoshop. He did a good job on glued assets resampling, but on this point saving and checking in Photoshop, I note that Preview assigned Adobe RGB profile to the processed image. Even if I opened the InDesign PDF and export as image in my size. My color workflow is sRGB. InDesign and Photoshop are two parameters in this way, the image placed in InDesign also has sRGB profile, the PDF has sRGB profile. If I copy / paste between InDesign and Photoshop, they are both aware glued Trump space and warn me if different from that of the target document. I have no idea where Preview becomes Adobe RGB, I don't see its place in the app to change that as a preference, and in any case, it seems very strange to be a defect when most of the people would not use them.

    In the preview, click on the tools bar menu point and scroll to the bottom of the drop-down list to assign the profile

    the next submenu you can click on and select sRGB at the bottom of this list. To save this profile to your image,

    do a "save under" (click on file, press the option/alt key Save As should appear). You can also test under the view menu bar item.

  • iMessage on iPhone, iPad and Mac Mini issues

    So, here's a nice.

    Mac Mini, iPad Mini, iPhone5. All are on the latest versions of the OS. Connected to the identical services iCloud and iTunes on all three devices. The iPhone 5 is delivered to US, the others are the European Union (NL) issued.

    When I send an iMessage on the phone, the message sent is not the Mac Mini or Mini iPad. sent iMessages to iPad or Mac appear on both devices, but not on the phone.

    Incoming messages only appear on the phone, not on the other two aircraft.

    People receiving my messages of either the Mac Mini - combo of the iPad and the iPhone5, have two separate conversations in their messages, but an entry from me in their list of contacts.

    In iCloud online, all devices can be considered to be connected with the same account. All have been disconnected from iCloud, password has been changed and reconnected. All devices were restarted. All to nothing does not.

    Other services such as calendar function without any problem at all, an appointment has been made on what devices instantly extends to the two other devices. New contacts are shared between all the devices too. If the problem is limited to the iMessage.

    In short, I suspect there is a difference between EU and devices of the American unit, preventing them to be treated equally. Does anyone else have this problem or something similar?

    Post edited by: mackert

    Hello mackert,.

    Thank you for using communities Support from Apple. I know that Messages does not properly or sync with your devices is not what you expect. Based on what you said, it seems that you encounter some problems of synchronization with connected devices to your Apple for message ID. Good news is I had this problem myself and I solved this problem by following these steps:

    1. Firstly, you disconnect from your Apple ID for iMessage on all your devices. On your iOS devices, go to settings > Messages > Send and receive and sign for your Apple ID. Then go to settings > Messages and turn off of iMessage.

    2. on your Mac Mini, open messages, then go to the Messages menu > Preferences > accounts. Click your iMessage account in the left sidebar, and then click Sign Out and then sign out again.

    3. restart your devices as closing down and starting process is important to keep the software works correctly:

    Restart your iPhone, iPad or iPod touch

    How to turn on or off your Mac

    4. now sign in iMessage on your iPhone first. Go to settings > Messages, turn on iMessage and connect you to your Apple ID in settings > Messages > Send and receive. Make sure that you are successfully connected, iMessage is activated, and you see your phone number and e-mail available for both "you are reachable by iMessage to ' and"Start new conversations." That's because iMessage uses your iPhone SMS to activate iMessage on your Apple ID.

    If you get an error when you try to activate FaceTime or iMessage

    5. Once your iPhone has configuration iMessage, then sign into your other accounts and check the synchronization of Messages. You can also turn on "Text Message Forwarding" under settings > Messages on your iPhone to better ensure that all devices have the same messages.

    Use Messages with your iPhone, iPad or iPod touch

    Messages (El Capitan): Set up Messages

    Continuity of use to connect your iPhone, iPad, iPod touch and Mac

    See you soon!

  • No data presented on article 'Zoom Horizontal' or-Scope

    Hi all

    I apologize if this is the wrong forum for this question.  Windows XP

    I am a relatively new user of NOR/very inexperienced.    We have a NO-5133 digitizer hooked to an o-scope and NO-Scope.  We are able to see the waveforms and the o-scope OR Scope data.  We are not able to use the "horizontal zoom" function as no data is presented in the window.  What is a question game?  We tried different versions of NOR-Scope without success.  A simulated signal work on the zoom feature, so I guess it's a problem related to the input (digitizer).  I would appreciate anyones help to understand this issue.  Thank you in advance.


  • OR-SCOPE-223409 error

    I got an error in the driver OR-SCOPE (version 4.1.3), using the NOR-5122 digitizer. The error is died in the niScope_SendSoftwareTriggerEdge function. The relevant sequence of commands that I send is:

    Secret = niScope_Abort (SessionID);
    Secret = niScope_ConfigureHorizontalTiming (SessionID, 380E6, 256, 0.0, 1, VI_FALSE);
    Secret = niScope_ConfigureTriggerEdge (SessionID, "0", 0,0, NISCOPE_VAL_POSITIVE, NISCOPE_VAL_DC, 0.0, 0.0);
    Secret = niScope_ConfigureChanCharacteristics (SessionID, '0', NISCOPE_VAL_50_OHMS, 0,0);
    Secret = niScope_ConfigureVertical (SessionID, "0", 0.2, 0.0, NISCOPE_VAL_DC, 1.0, VI_TRUE);
    Secret = niScope_InitiateAcquisition (SessionID);
    Secret = niScope_SendSoftwareTriggerEdge (SessionID, NISCOPE_VAL_SOFTWARE_TRIGGER_REFERENCE); Secret = 223409

    The return of niScope_errorHandler is:

    Error FFFC974F.

    Possible reasons:
    Internal software error has occurred in the extended software. Please contact the support of National Instruments.

    Name of the component: nihsdrk
    File name: \Measurements\highSpeedDigitizers\hsd\driver\trunk\4.1.1\source\kernelPrimitive\tMacroSupervisor.cpp
    Line number: 716

    Source:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:

    State code:-223409

    The error will not occur if I call niScope_close and niScope_init after every acquisition, but I guess I should not have done that.

    Hi rings,

    It is a known issue, you're right that you shouldn't call niScope_close and niScope_init each time, but for now, this is the best solution.

  • CA CERT_E_UNTRUSTEDROOT on the issue of the licence

    Hi all

    I need to issue a certificate using a root certification authority policy.inf business Windows Server R2 2012.

    I connected the CA with HSM and created the template for cert is issued, such as getting the HSM KSP provider.

    I can issue some certificates already very well with the GUI model, but I tried from policy.inf:

    [Version]
    Signature = ' NT $Windows $.

    [NewRequest]
    Object = 'C = SG, O = Ezlink, CN = test-Server'
    HashAlgorithm = SHA256
    KeyAlgorithm = RSA
    KeyLength = 2048
    ProviderName = "Safenet Key Storage Provider.
    KeyUsage = 0xa0
    MachineKeySet = TRUE

    [RequestAttributes]
    CertificateTemplate = ComputerHSM

    Then when I submit, I get this error:

    RequestId: 13
    RequestId: "13".
    Certificate issued not (denied) error of construction or a certificate Publishing c
    ESTAMP chain processed, but finished in a root certificate which is not very
    Usted by the trust provider. 0X800B0109 (-2146762487 CERT_E_UNTRUSTEDROOT)
    Certificate request processor: A chain of certificates processed, but completed in
    a root certificate which is not approved by the trust provider. 0x800B0109 (-2146
    762487 CERT_E_UNTRUSTEDROOT)
    Error of construction or publishing certificate

    Subsequently, I can't issue more cert even with a graphical interface. Any guidance would be greatly appreciated, thank you kindly,

    LOTRCA

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • SCVMM and LUN Mapping issue

    Hi all

    We have C7000 blade Gen9 servers and manage through the HP ONEVIEW. We have installed HYPER V and in addition, we have 2 virtual machines running on that. We must create the Windows cluster to that. I therefore created a Virtual SAN Manager and assigned WWN to the virtual machine.

    When you assign the LUNS to the virtual machine, its not detecting not not the OS level. HITACHI V OPEN I added manually in the MPIO, but logic unit number is not visible. When I checked in the Device Manager it shows like device hidden in the server.

    Also I need a suggestion for the below,

    We have virtual machines HYPER v for SCVMM.

    Is it mandatory to have the Windows for SCVMM Failover Cluster in a virtualized environment?
    Also, have we not create HYPER V failover cLUSTER to manage the HYPER-V hosts in SCVMM?
    Cant, we manage the guest individually through SCVMM?
    If we all the Hyper-V cLUSTER, all guests will have 2 a throgh redundancy the Cluster FAILOVER and new to SCVMM. Whats is the best practice.

    Help, please

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • Issue of report SCOM

    I am facing this problem under when I generate Operation Manager VMM report.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *

Maybe you are looking for