Question about GROUP BY and HAVING

Good afternoon,
I have the following query which returns the desired result (set of students who take CS112 or CS114 but not both). I wanted to "condense" it into a single SELECT statement (if that is at all possible - DDL to execute the statement is provided at the end of this post):
-- is this select distinct * and its associated where clause absolutely
-- necessary to obtain the result ?
select distinct *
  from (
        select s.sno,
               s.sname,
               s.age,
               sum(case when t.cno in ('CS112', 'CS114')
                        then 1
                        else 0
                   end)
                 over (partition by s.sno) as takes_either_or_both
          from student s join take t
                           on (s.sno = t.sno)
  where takes_either_or_both = 1
;The following looked reasonable but, unfortunately unsuccessful:
  Window functions not allowed here (in Having Clause)
select max(s.sno),
       max(s.sname),
       max(s.age),
       sum(case when t.cno in ('CS112', 'CS114')
                then 1
                else 0
           end)
         over (partition by s.sno) as takes_either_or_both
  from student s join take t
                   on (s.sno = t.sno)
group by s.sno
having sum(case when t.cno in ('CS112', 'CS114')
                then 1
                else 0
           end)
         over (partition by s.sno) = 1
Invalid identifier in Having clause
select s.sno,
       s.sname,
       s.age,
       sum(case when t.cno in ('CS112', 'CS114')
                then 1
                else 0
           end)
         over (partition by s.sno) as takes_either_or_both
  from student s join take t
                   on (s.sno = t.sno)
group by s.sno, s.sname, s.age
having takes_either_or_both = 1
;I have searched for a document that completely defines the sequence in which the clauses are executed. I have found tidbits here and there but not something complete. I realize that my running into problems like this one is due to my lack of understanding of the sequence and the scope of the clauses that make up a statement. Because of this, I cannot even tell if it is possible to write the above query using a single select statement. Pardon my bit of frustration...
Thank you for your help,
John.
DDL follows.
        /* drop any preexisting tables */
        drop table student;
        drop table courses;
        drop table take;
        /* table of students */
        create table student
        ( sno integer,
          sname varchar(10),
          age integer
        /* table of courses */
        create table courses
        ( cno varchar(5),
          title varchar(10),
          credits integer
        /* table of students and the courses they take */
        create table take
        ( sno integer,
          cno varchar(5)
        insert into student values (1,'AARON',20);
        insert into student values (2,'CHUCK',21);
        insert into student values (3,'DOUG',20);
        insert into student values (4,'MAGGIE',19);
        insert into student values (5,'STEVE',22);
        insert into student values (6,'JING',18);
        insert into student values (7,'BRIAN',21);
        insert into student values (8,'KAY',20);
        insert into student values (9,'GILLIAN',20);
        insert into student values (10,'CHAD',21);
        insert into courses values ('CS112','PHYSICS',4);
        insert into courses values ('CS113','CALCULUS',4);
        insert into courses values ('CS114','HISTORY',4);
        insert into take values (1,'CS112');
        insert into take values (1,'CS113');
        insert into take values (1,'CS114');
        insert into take values (2,'CS112');
        insert into take values (3,'CS112');
        insert into take values (3,'CS114');
        insert into take values (4,'CS112');
        insert into take values (4,'CS113');
        insert into take values (5,'CS113');
        insert into take values (6,'CS113');
        insert into take values (6,'CS114');

Hi, John,
Just use the aggregate SUM function.
        select s.sno,
               s.sname,
               s.age,
               sum(case when t.cno in ('CS112', 'CS114')
                        then 1
                        else 0
                   end) as takes_either_or_both
          from student s join take t
                           on (s.sno = t.sno)
       GROUP BY  s.sno,
                s.sname,
              s.age
       HAVING  sum(case when t.cno in ('CS112', 'CS114')
                        then 1
                        else 0
                   end)  = 1;Analytic functions are computed after the WHERE- and HAVING clause have been applied. To use the results of an analytic fucntion in a WHERE- or HAVING clause, you have to compute it in a sub-query, and then you can use it in a WHERE- or HAVING clause of a super-query.

Similar Messages

  • Question about the WRT54GS and having to reset it all the time!

    I just got this router a couple of days ago. I bought it online on eBay. It seems to have been used before.
    It seems like whenever I am away from the computer I get kicked off the internet. I have to unplug it and reset it and once it comes back up it works fine. I have two computers on this router, one hard wired in and one wireless.
    The problem of being kicked off the network seems to happen to both. It is only after I reset that I get the network back up and can access the internet. I have set up the WEP security feature and am using the network provided by the graduate school.
    I had an old crappy COMPUSA router that worked fine with no problems. However it was used and I was not able to set up a secure wireless network. I got the Linksys because I trust it and can wanted to have the option of securing the network.
    There are several wireless networks in our building and I think they may all be set up in their default state. All of them have WEP or WPA security set up.
    Please advise!

    ensure that the router has the latest firmware on it....change the MTU settings to 1452 .., wireless settings as ssid - non-linksys name , channel - either 1 or 11 , beacon interval - 50 , fragmentation & RTS threshold - 2304

  • Question About Color's and Gradients

    Hi all,
    I have a question about color swatches and gradients.
    I am curious to know, if I have 2 color swatches that I make into a gradient color, is it posible to change the tint of each indivdual color in that gradient and have that applied to the gradient without having to adjust the gradients opacity.
    The reason that I'm asking this is because in creating a project I found that the colors that I chose for to make my gradient from my swatches were to dark, and while I can adjust each one's tint to my liking (if the object they were applied to was going to be a solid color) but that doesn't seem to apply to the overall gradient.
    I hope that makes sense, I know that this was something that was able to be accomplished in quark and was wondering if I can do something similar.

    If you double click your gradient swatch (after adding it to the swatches)
    Then click a colour stop in the gradient, and then change the drop down menu to CMYK (or rgb)
    And you can alter the percentages there. It's not much use for spot colours but it's a start.
    But making tint swatches would be a good start anyway.
    At least then when you double click the gradient (in the swatches) to edit it you can choose from CMYK, RGB, LAB, or Swatches and adjust each colour stop to your liking.

  • A few questions about the ka790gx and dka790gx

    i have a few questions about the ka790gx and dka790gx , how much better is the dka790gx compaired to the ka790gx ? . how much difference does the ACC function make to overclocking etc , i plan on getting a phenom II 940BE or 720BE . i already have the ka790gx so would it be worth building another system using the dka790gx mobo , or should i keep what i already have and just change the cpu ?

    It's largely irrelevant what other boards had VRM issues other than the KA790GX - the fact is it died at stock settings. Since there is little cost difference between the more robust DKA790GX (or Platinum if you really need 1394) why bother with the proven weakling? There are other examples around of the KA not having a robust power section.  There's no way I would use even a 95W TDP CPU in the KA and absolutely not O/C.....!
    As for the credentials of Custom PC, I have generally found their reviews accurate and balanced, and echo my own findings where applicable. If a little too infrequent.
    The fact that the KA has such a huge VRM heatsink leads me to my other comments on the Forum, particularly regarding the "fudge" aspect:
    """Henry is spot on - the notion that adding a heatsink to the top of the D2PAK or whatever MOSFETS is effective is virtually worthless. The device's die thermal junction is the tab on the device back - which is always against the PCB pad. The majority of heat is therefore dissipated in to the board, and the fact that the epoxy plastic encapsulation gets hot is simply due to the inability of the heat to be conducted away from the device die via the tab. Not sure when Epoxy become an effective conductor of heat.... Good practice is to increase the size of the PCB pad (or "land" in American) such that the enlarged PCB copper area acts as an adequate heatsink. This is still not as effective as clamping a power device tab to an actual piece of ali or copper, but since the devices used are SMD devices, this is not possible. However, the surface area required to provide sufficient PCB copper area to act as a heatsink for several devices isn't available in the current motherboard layouts. Where industrial SBC designs differ in this respect is to place the VRM MOSFETs on the back of the PCB on very enlarged PCB pads - where real estate for components is not an issue.
    Gigabyte's UD3 2oz copper mainboards sound like a good idea, on the face of it. However, without knowing how they have connected the device tabs to where and what remains a mystery. I suspect it is more hype than solution, although there will be some positive effect. From an electrical perspective, having lower resistance connecting whatever to whatever (probably just a 0V plane) is no bad thing.
    The way the likes of ASUS sort of get round the problem is to increase the sheer number of MOSFET devices and effectively spread the heat dissipation over a larger physical area. This works to a degree, there is the same amount of heat being dissipated, but over several more square inches. The other advantage of this is that each leg of the VRM circuit passes less current and therefore localised heat is reduced. Remember that as well as absolute peak operating temperature causing reduced component life, thermal cycling stresses the mechanical aspects of components (die wire bonds for example) as well as the solder joints on the board. Keeping components at a relatively constant temperature, even if this is high (but within operating temperature limits), is a means of promoting longevity.
    For myself, the first thing I do with a seperate VRM heatsink is take it off and use a quiet fan to blow air on to the VRM area of the PCB - this is where the heat is. This has the added benefit of actively cooling the inductors and capacitors too....
    Cooling the epoxy component body is a fudge. If the epoxy (and thus any heatsink plonked on top of it) is running at 60C, the component die is way above that.....
    It's better than nothing, but only just."""

  • Group by and having

    Hi,
    According to standard sql, we must have:
    select ___
    from ___
    where ___
    group by ___
    having ___;
    However, I tried do the query with the following order:
    select ___
    from ___
    where ___
    having ___
    group by ___;
    And I received the same result.
    Does anybody knows the difference between those two orders? Are they always give the same result?
    Thank You

    According to the 9i documentation:
    Specify GROUP BY and HAVING after the where_clause and CONNECT BY clause. If you specify both GROUP BY and HAVING, they can appear in either order.
    Which you've got to admit does match your experience.
    Cheers, APC

  • GROUP BY and HAVING can appear in either order.

    Hi,
    please give me one example for the following line i found it in "19-28 Oracle Database SQL Language Reference".
    If you specify both GROUP BY and HAVING, then they can appear in
    either order.
    yours sincerly

    Hi,
    944768 wrote:
    that means both queries bring same result?Right; both ways produce the same results.
    GROUP BY  deptno
    HAVING    COUNT (*) > 2does exactly the same thing, just as efficiently as
    HAVING    COUNT (*) > 2
    GROUP BY  deptno

  • Question about clear page and reset pagination

    Hi,
    I have a question about clear pages and the reset pagination in an URL. What is the reason why a clear page doesn't also trigger a reset pagination on the pages which are cleared?
    I can't really imagine a business case where it makes sense to clear all data of page items on a page and don't reset the pagination of reports on that page which probably use a page item in there where clause...
    The drawback of this behavior is that a developer always has to set the reset pagination checkbox when he clears the target page and the even bigger drawback is that if you specify other pages to clear, you can't reset pagination for them, because reset pagination only works for the target page.
    Thanks for your input.
    Patrick
    *** New *** Oracle APEX Essentials *** http://essentials.oracleapex.info/
    My Blog, APEX Builder Plugin, ApexLib Framework: http://www.oracleapex.info/

    Enhancement request filed, thanks,
    Scott

  • The question about portlet customization and synchronization

    I have a question about portlet customization and synchronization.
    When I call
    NameValuePersonalizationObject data = (NameValuePersonalizationObject) PortletRendererUtil.getEditData(portletRenderRequest);
    portletRenderRequest.setPortletTitle(str);
    portletRenderRequest.putString(aKey, aValue);
    PortletRendererUtil.submitEditData(portletRenderRequest, data);
    Should I make any synchronization myself (use "synchronized" blocks or something else) or this procedure is made thread-safe on the level of the Portal API?

    HI Dimitry,
    I dont think you have to synchronize the block. i guess the code is synchronized internally.
    regards,
    Harsha

  • A question about item "type and release" of  source system creation

    Hello expert,
    I have a question about item "type and release" of  source system creation.
    As we know,when we create a web servie source system,there will display a pop-up which includes three items as "logical system","source system"and "type and release".
    About the item "type and release",when we push "F4" button,there will be three default selections as below:
    "ORA 115     Oracle Applications 11i
    TLF 205     Tealeaf 2.05B
    XPD 020     SAP xPD".
    Who can tell me when and how should I use the three selections.
    And also I attempted to input the item by some optional letters except the default three selections and it seems that I can input it freely.
    Thank you and Best Regards,
    Maggie

    Hello DMK,
    Thank you very much for your answer.It is very helpful for me.
    Can I ask you further about it?
    I got that it is a semantic description item.
    You said the default selections are set by our basis people.Would you like to tell me how should we creat a new value except the default ones for item "type and release"?Only by inputing the value in the item directly?But you see we canot see the new value item we created by ourself when we push "F4" button next time ,is that ok?Or do we have to ask basis people to define one new value item just like the default seletions before we use it.
    Also if possible would you like to describe detail about "This becomes important when you are troubleshooting certain issues especially when RFC connection problems."
    Thank you and Best Regards,
    Maggie
    Message was edited by: Maggie

  • Questions about Groups Wheel & Admin

    OK I have two systems. One is an iMac upgraded from Leopard to Snow Leopard. Its main hard drive has the following owner & group:
    Owner: "system" (Read & Write)
    Group: "admin" (Read & Write)
    But on my Mac Pro's main drive it is like this:
    Owner: "system" (Read & Write)
    Group: "wheel" (Read & Write)
    Note: The Mac Pro was a clean install of Snow Leopard from the full install disk, whereas the iMac was Leopard upgraded to Snow Leopard.
    I have read in some places that in Snow Leopard they use "wheel" instead of "admin", but why would Apple choose to use such a cryptically named group as "wheel" when the use of a logical, sensical term such as "admin" would be much easier to understand to most users? Why is one Snow Leopard computer using the "admin" group whereas another is using the "wheel" group as the default group for the main hard drive? What is the correct group that the main boot drive should have for it (i.e. when you click on the hard drive on the desktop and do "get info" what should it say)?
    I used Migration Utility to copy a user from my MacBook Pro to the Mac Pro. Then I logged in as Root on the Mac Pro and used this method (http://support.apple.com/kb/HT1428) to rename my user directory to be a new shortname, then create a new user with that shortname and point it at that folder (to fix some nagging permissions issues). Then I deleted the old user account. Then I renamed the new user account folder with the old shortname that it used to have, and created a new user with that name. But every time I create a folder it has the "Wheel" group... which seems like a security problem since anything I download into that folder will now be able to SU. Why would that be the default group?
    In the old OS X (like 10.0, 10.1) there used to be "NetInfo Manager" where you could see all the users on a system and all the groups and change all that stuff, if you wanted to. In Leopard there was "Directory Utility" but it had much more limited features. In Snow Leopard, how do I pull up a list of all the users on a system and be able to edit their groups and all that stuff about them?

    DaddieMac wrote:
    V.K. wrote:
    run the following command in terminal
    sudo chown root:admin /
    you'll have to enter your admin password (which you won't see). that's normal.
    This will change the ownership on the hard drive to root:admin.
    Why can't I just "Get Info" on the drive, and set its group to "admin" in there?
    the whole GUI permissions management in Leopard and Snow leopard is very clunky and leaves a lot to be desired.
    Can I just question why Apple has given us the ability to change the group in the "Get Info" box when really it doesn't do anything, and you still have to resort to using the Terminal and typing in non-plain-English commands that are merely relics of an operating system from 40 years ago that somehow still persists in our basement despite its lack of user friendliness?
    what? SU?? wheel is the superuser group. by default only root belongs to it and nobody else. so having a wheel group on a folder does not create security issues.
    what folders exactly have the wheel group? you home folder? as I said, folders created in any folder will inherit the group of that folder so maybe the wheel on your whole drive is doing this.
    Well, even though I went into the "Get Info" box and took off "Wheel" from my root directory, still, when I make new folders on the root level of the drive, it creates them as being group "Wheel." Now, my understanding is that if I download a program and save it INTO that folder, then it would have the ability to execute as root because it will belong to the "Wheel" group -- am I not understanding this correctly? Thanks.
    as I said, the GUI permission management is all messed up. you just keep running into various messed up aspects of it. this is another one. here is what happens.
    when you remove a group completely from permissions using GUI it does not simply go away. it also incredibly changes to wheel.
    you just don't see it because the permissions for the group are changed to none. so, for example, say, you have a file with the group staff and that group has read permissions to the file. you select that group in GUI permissions panel and use "-" to remove it. what should happen is that the group remains the same but it's permissions are set to 0. what does happen is that the group changes to wheel (which has group id=0) and its permissions are set to 0.
    this is definitely a bug and a silly programming error. It's been around since Leopard. I reported it to Apple a long time ago.
    so despite your hate of terminal and unix you are going to have to use them to fix the issue. get used to it. OS X is unix based and sometimes one has to use terminal to fix things. in this case there is no other way to do this. run the terminal command I gave you and it will fix the problem with new (but not already existing) folders at the top level of the hard drive. if you want to change the group on those you'll need to run similar commands for them too.

  • A few questions about Group Policy development

    This post was originally in the Windows Development forum. Please note the following:
    This question is not about the application and management of GPOs. It's about how to develop a group policy.
    I know about Group Policy Preferences, please do not provide this as an answer.
    I create a custom group policy for an application.
    Recently the application developers allowed settings to be controlled via policy registry keys, in order to make these settings easier to set for Systems Administrators I have created a GPO. Unfortunately, there aren't that many resources
    I can find that help with Group Policy creation, so:
    Is there an easier way to create and edit admx/adml files rather than just a xml editor? Like a GUI front end?
    The vast majority of this applications settings are just a simple Boolean, is there any way to just use one base presentation element for multiple policies? or do I really have to create a presentation element for every single policy? :/
    As mentioned above, most settings are a simple Boolean, but with an additional enforce parameter. If you "enforce" the setting the user is blocked from changing the value. I was going to peg the setting Boolean to whether the policy was
    Enabled or Disabled and have an enforce check box in the policy itself (this would make it easier to just glance at the configured settings and get an idea). Unfortunately, when you disable a policy you cannot interact
    with its contents, so the enforce check box cannot be toggled. So I have two options:
    Have two policies for each setting eg: Disabled: Load printer settings with the document and
    Enabled: ENFORCE Load printer settings with the document
    OR what I have elected to do is just have the one policy with 2 check-boxes in it, one for the setting and one for the enforcement
    The former is both more complex to write for me and more time consuming to configure for the Administrator, the later is easier for me to write but still annoying to use. So my final question is: can I make it so, even though a policy is disabled, you can
    still toggle settings within the policy?

    Hi Thomas.
    > (this will set the default in the application) and then toggling whether
    > that setting is Enforced (unable for the user to modify it - disabling
    > it in the user interface).
    As said - that's not how policies are intended to work - they are always
    enforced. You are talking about preferences that have an optional
    "enforce" switch :) But doesn't matter for the remainder of this post.
    >  1. The presentation table contains hundreds of presentation tags that
    >     essentially are the same thing. From your response there is no way
    >     to make the GPO any easy to write? I can't just create one generic
    >     presentation that multiple policies can use? I have to create a
    >     presentation for every. single. policy.?
    I'd sugggest to use ADM instead of ADMX. Much easier to write and
    maintain, and copy/paste works very well in ADM :)
    https://msdn.microsoft.com/library/bb742499.aspx
    >  2. Because of how the settings are set, as mentioned in my earlier
    >     post, I have chosen to have each policy contain two check boxes.
    >     Each setting could be set to the following:
    >      1. True
    >      2. False
    >      3. True and Enforced
    >      4. False and Enforced
    What elements you need depends on the registry values your application
    is expecting/checking. I'd suggest a radio button (enabled/disabled) and
    a check box "enforced".
    >     there a way for a Disabled policy to also have settings that can be
    >     modified in Group Policy Management? Or can only Enabled policies be
    >     modified?
    You cannot edit what a disabled GPO does, but you can define it
    (VALUEOFF in ADM files if I recall correctly).
    >     well because it would make it easier for them to read the GPO. But I
    >     think you are saying this is not possible.
    Yes, it isn't. It still - at least to me - is a slight misunderstanding
    of "preferences" versus "policies" :)
    Greetings/Grüße,
    Martin
    Mal ein
    gutes Buch über GPOs lesen?
    Good or bad GPOs? - my blog…
    And if IT bothers me -
    coke bottle design refreshment (-:

  • Question about Id3-tags and song managem

    Hello, I am getting ready to buy a Zen Touch 20GB in a couple of weeks and I have a few questions about the management software.
    (Correct me if I am wrong about something)
    ) Are songs organized into groups by Genre instead of just folders like on the Ipod?
    2) Are Id3-tags used instead of filename for identification?
    3) What parts of the tag are needed besides title and artist?
    4) Which version of tags does the Zen Touch recognize: Version or Version 2?
    5) If I edit my tags using an external program such as Id3-TagIT, will the tags carry over to the Creative software and to the player?
    Thanks a lot for your help. I want to make sure I have my music collection in order before I get my Zen Touch.

    euph_jay wrote:Ok, so lets say I have all my music in folders right now seperated into different categories on my hard dri've. Some folders denote the artist, some the album, and some a genre. Example: Folder: Chicago Contents: Chicago .mp3 files Folder: Techno Contents: various Techno artist's songs What is the best way of organizing my folder system, so that the transition will be easy to the player?
    Folders are pretty much irrelevant. What the software will do is look at the *tags* in the files and then use these to build the player's library.
    Will imbedded folders work on the player? (like Techno->Crystal Method->Cystal Method .mp3's)
    Again the player has no concept of folders, although if you set Techno as a Genre tag you will be able to view via this in the Music Library.
    Or, am I misunderstanding how music is stored into the mp3 player. Instead of storing music in a "folder like" system (like the Chicago folder or Techno folder), does it store all the songs individually on the device? Then you have to sort it by artist, album, or genre?
    Using your example, in the Music Library you have essentially three categories: Album, Artist, and Genre. So under Album you would see "Vegas" (the Crystal Method's album), under Artist you would see "The Crystal Method", and under Genre you would see "Techno" (and then either the album or artist under this... I forget which it is offhand).
    Make sense?

  • Some questions about Skype Manager and Skype Conne...

    Hallo,
    I found one of your post:
    That, if I have some questions I may contact with  Contact our solutions team
    Sadly that link wont work...
    I have few questions and also I contacted with Microsoft support, but sadly they wasn’t able to help me. Only what they suggests, that I may contact with Skype Team trough to Forum, or Facebook...
    So, I choose first one and maybe you can help me, or redirect my question !?
    About my questions:
    As I understand Skype for business is just name what contain two free software, like Skype manager and Skype connect. Also those are free, without charge ?
    Also I read that there are two different accounts, like Premium and regular one. Premium contains some benefit. So, If I use that Skype for business manager system to I may or can add some premium accounts for some my staff and leave others with regular account ? I don’t have that manager systems installed jet, but what I read, I understand that I maybe just split credit - or is there way how I may also share regular and premium conots ?
    Also, Right now my customers have 25 workers, but what - if soon my another customer also want to use Skype Service, and he have 50 - 100 workers ? Will be there special price for different amount of users on one firm ?
    And at last, firm who I represent right now are using Elion VoiP (Elion, is Estonian ISP) service, trough to xLite program. 
    Sadly that one wont work properly, it will hack, or you cant hear other people and so on. With, Skype everything works fine. So, if he will starting to use Skype manger and will make account for every workers (sips) can he bound those sips with same VoiP numbers what he will use right now with Elion ? Or if not, is there some way how to redirect those numbers (to lose those numbers, is sadly out of question) ?
    I hope, you can help me guy´s.
    Best regards
    Rainer

    Tere Rainer,
    indeed we don't have the solutions team offer any longer. Let me try to answer some of your questions here.
    Skype Manager and Skype Connect itself are free of charge. But obviously you can purchase and distribute paid products via Skype Manager.
    Yes, you can freely distribute Premium subscription to Manager group members and leave others without. You can do the same with all kind of Skype products, e.g. Skype numbers, calling subscriptions etc.
    There are no discounts with Skype Manager purchases. It's a tool to simplify administration.
    Unfortunately you cannot transfer numbers to Skype connect. For more details on which features are supported and how they work please have a look here: https://support.skype.com/en/faq/FA10549/what-is-s​kype-connect-and-how-does-it-work
    I hope my answers could help a bit already.
    Tervitustega Mustamäelt.
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Question about setting cookies and custom authentication

    I have a question about setting cookies.
    I have two different 'projects' in HTMLDB - we will call them App1 and App2.
    I also have two different connection configurations setup in the DADs.conf file. - we will call them Connect1 and Connect2.
    App1 is setup to use database authentication (no user is specified in the DAD) and uses Connect1. Once the user successfully logs in, we set a username cookie (this is a persistent connection).
    We created a custom authenticatoin scheme for App2 - this scheme checks for the username cookie (set by App1). We would like for App2 to use Connect2 (HTMLDB_PUBLIC_USER is the default user specified and it uses connection pooling).
    Is it possible to set a cookie from App1, Connect1 for App2, Connect2 - then redirect to App2 and pick up that cookie?
    Here is an example of what we are trying to accomplish:
    A user loggs into App1, we set a cookie, and the user is redirected to App2. If the cookie exists, we allow them access to the home page in App2, if no cookie, we redirect back to a 'Login Failed' page in App1. We don't want App2 to use the same database connection as App1 though, we need App2 to use connection pooling.
    Is this possible? OR...Is there a better way to accomplish what we want to do?
    This is an enhancement to an existing app. Our requirements are to use Database Authentication (setup where pass expires after 60 days or so, cannot reuse last 3 passwords, etc.) - which is already setup and being used by other applications in our organization. All of our users have accounts in the database. We don't want users to have a new username/pass - and we don't want to manage a separate group for HTMLDB apps.
    The existing application uses HTMLDB's built in authentication - which uses database username/pass, and it uses connection pooling, but we cannot handle the pass expire stuff in it, unless there's something we're not seeing or understanding - at least that's how our DBA explained it to us.
    Any help with this will be appreciated so much. I can send you the code we have if needed.
    Thanks!

    Same problem here.  I have so many problems with this remote app.  Is there an iTunes API? I would like to write my own remote app that actually works.

  • Question about dependent projects (and their libraries) in 11g-Oracle team?

    Hello everyone,
    I have a question about dependent projects. An example:
    In JDeveloper 10.1.3.x if you had for instance 2 projects (in a workspace): project 1 has one project library (for instance a log4j library) and project 2 is a very simple webapplication which is dependent on project 1. Project 2 has one class which makes use of log4j.
    This compiles fine, you can run project 2 in oc4j, and the libraries of project 1 (log4j) are added on the classpath and everything works fine. This is great for rapid testing as well as keeping management of libraries to a minimum (only one project where you would update a library e.g.)
    However in 11g this approach seems not to work at all anymore now that weblogic is used, not even when 'export library' is checked in project 1. The library is simply never exported at all - with a noclassdeffound error as result. Is this approach still possible (without having to define multiple deployment profiles), or is this a bug?
    Thanks!
    Martijn
    Edited by: MartijnR on Oct 27, 2008 7:57 AM

    Hi Ron,
    I've tried what you said, indeed in that .beabuild.txt when 'deploy by default' is checked it adds a line like: C:/JDeveloper/mywork/test2/lib/log4j-1.2.14.jar = test2-view-webapp/WEB-INF/lib/log4j-1.2.14.jar
    Which looks fine, except that /web-inf/lib/ is empty. I presume its a sort of mapping to say: Load it like it in WEB-INF/lib? This line is not there when the deploy by default is not checked.
    I modified the TestBean as follows (the method that references Log4j does it thru a Class.forName() now only):
    public String getHelloWorld() {
    try {
    Class clazz = Class.forName("org.apache.log4j.Logger");
    System.out.println(clazz.getName());
    catch(Exception e) {
    e.printStackTrace();
    return "Hello World";
    In both cases with or without line, it throws:
    java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:42)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at nl.test.TestBean.getHelloWorld(TestBean.java:15)
    Secondly I added weblogic.xml with your suggested code, in the exploded war this results in a weblogic.xml which looks like:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    <jsp-descriptor>
    <debug>true</debug>
    <working-dir>/C:/JDeveloper/mywork/test2/view/classes/.jsps</working-dir>
    <keepgenerated>true</keepgenerated>
    </jsp-descriptor>
    <library-ref>
    <library-name>jstl</library-name>
    <specification-version>1.2</specification-version>
    </library-ref>
    <library-ref>
    <library-name>jsf</library-name>
    <specification-version>1.2</specification-version>
    </library-ref>
    </weblogic-web-app>
    The only thing from me is that container-descriptor tag, the rest is added to it during the deployment. Unfortunately, it still produces the same error. :/ Any clue?

Maybe you are looking for