Trouble with a group by expression.

I have a fairly simple select statement from which I am pulling two tables worth of data into one output which later gets put into a cursor for export to java. I need to be able to group by one column and I get a 'not a group by...' statement. I could use some guidance from the masses about proper group by usage.
select errors.VALIDATION_TYPE,errors.error_number,errors.error_msg,errors.err_time_stamp,t_batch.*
from errors,t_batch
where errors.co_id = t_batch.co_id and
errors.facility_id = t_batch.facility_id and
errors.batch_id = t_batch.batch_id and
errors.ry = t_batch.ry and
errors.reporter_id = t_batch.REPORTER_ID
group by errors.batch_id;
Thanks alot in advance.
Allan Richards

You can try something like this example:
SQL> select decode(gr,1,dname,null) dname, ename, job
  2  from (
  3  select count(1), d.dname,e.ename,e.job, grouping(e.ename) gr
  4  from dept d, emp e
  5  where d.deptno = e.deptno
  6  group by grouping sets (d.dname, (d.dname, e.ename, e.job))
  7  order by d.dname,gr desc
  8  )
  9  /
DNAME          ENAME      JOB
ACCOUNTING
               KING       PRESIDENT
               CLARK      MANAGER
               MILLER     CLERK
RESEARCH
               FORD       ANALYST
               ADAMS      CLERK
               JONES      MANAGER
               SMITH      CLERK
               SCOTT      ANALYST
SALES
               WARD       SALESMAN
               ALLEN      SALESMAN
               BLAKE      MANAGER
               JAMES      CLERK
               MARTIN     SALESMAN
               TURNER     SALESMAN
17 rows selected.Rgds.

Similar Messages

  • Trouble with connection to Airpot Express on new Macbook

    Hello my fellow Apple users! I hope one of you can help me. I purchased a new Macbook last week and I love it except I'm having trouble with the connection to my Airport Express. I originally set up the Airport on my old iMac, which is located on the 2nd floor of my house. The Airport is plugged in to the modem on the 1st floor. Since I have a new Macbook, I boxed up the old iMac and put it in a closet on the 2nd floor because I'm not using it anymore.
    The weird thing is that my wifi connection works just fine on the 2nd floor but can't find a connection on the 1st floor; where the Airport is plugged in.
    So I'm thinking I need to uninstall the Airport on my iMac but I don't know how to do that. Any tips?

    V Rodriguez wrote:
    I'm having trouble with the connection to my Airport Express. I originally set up the Airport on my old iMac, which is located on the 2nd floor of my house. The Airport is plugged in to the modem on the 1st floor. Since I have a new Macbook, I boxed up the old iMac and put it in a closet on the 2nd floor because I'm not using it anymore.
    The weird thing is that my wifi connection works just fine on the 2nd floor but can't find a connection on the 1st floor; where the Airport is plugged in.
    So I'm thinking I need to uninstall the Airport on my iMac but I don't know how to do that.
    Welcome to Apple's discussion groups.
    Once an Apple AirPort base station is configured it retains no history of the computer that originally configured it. So "uninstalling the AirPort on your iMac" would not accomplish anything useful, even if you could do something that could be described that way.
    How is your AirPort Express connected? Is its Ethernet port connected to a broadband modem?

  • Trouble with airport extreme and express

    Hey all. I recently bought a new airport extreme and I'm now having problems setting up a network with the airport express. the airport express that we have is connected to a very old G3 iMac because it doesn't have an airport card and is upstairs. I have so far managed to set up the airport extreme so my G4 iBook and my MacBook Pro are both connected via wireless. The trouble seems to be that I can't get the next step set up as i'm not very experienced with networks and I can't get the express to establish a connection with the extreme. i hope somebody could help me sort out the next step. On a side note, this new airport extreme doesn't allow my xbox 360 to connect to it and i wondered if there is any way I can get it to connect again via wireless, either by changing a setting or the security?
    Any help and feedback would be greatly appreciated,
    Thanks.

    applefan08, Welcome to the discussion area!
    To continue to use the AirPort Express (AX) to give Internet access to the iMac G3, you will need to configure the 2 devices to use WDS to wirelessly connect. The instructions start on Page 41 in "Designing AirPort Extreme 802.11n Networks" (http://manuals.info.apple.com/en/DesigningAirPortExtreme802.11nNetworks.pdf).

  • Is anyone having trouble with smart groups being recognized in mail after the Maverick update?

    Since I updated my iOS to Mavericks, my smart groups are no longer recognized in Mail.
    Is anyone else having this problem?  How can I fix it?

    Here's another similar thread: Smart mailboxes are empty in Mavericks mail
    You may need to reindex Spotlight: http://support.apple.com/kb/HT2409

  • The trouble with 'expression' -- how to edit that

    I just walked to the corner bodega ( even though its korean sooo bodega is misleading ).. to get some beer...
    ITS BEER THIRTY -- yipee !
    and on way back down the block where I live ( which is suburban ) some boy kid on a bike was riding and playing with a girl kid ( probably was his slightly older sister - these kids probably around 12 years old ) in front of a rental property with some spanish americans hanging out in their cemented yard on hammocks near bar b q...with their own kids...(they have planted another hopeful "veg garden" around the perimeter of their so called yard...tomato plants etc )...so anyway, the picture here is a "neighborhood" of sorts with a somewhat lower middle class family atmosphere in a fairly lower class area on the verge of becoming middle class ( with God's help ).
    And anyway, I passed by the boy kid on the bike and smiled at him cause he seemed to be a decent kid having fun with his friend ( they were sorta laughing about something and having fun before I showed up as the big "adult" and looked at me ). His smile back was like sunshine and true and he immediately recognized he could keep having fun with his friend and I wasn't a "threat" , but instead some sorta "neighbor".  She did the same more or less ( I think she had some devious design re: the game they were playing ... like " OK, you think you're so great on that bike, try to CHASE me ! " or something like that....kid stuff... and fun thank God.  This neighborhood has it's share of bad things going on in the streets at times.  And that leads to my focus on " The trouble with expression".
    A lot of people, like me for example, can't express themselves well in some ways. I didn't say , " Hi there kids !  What's new ? " when I met them on the way back from the bodega.  I didn't stop and ask what the heck they were laughing about.  Nor did I speak to the spanish people adjacent to the kids ...in their "yard" ...with the bar b q and hammock and obvious friday afternoon socializing they were into....
    We in nyc area are typically a mixed bag of races... I'm white, kids were african amer ( black but more like brownish if you ask me ), spanish people like mexicans IMO... who cares.  This is suburbia so you can imagine how more mixed it is in the city.
    Anyway, the reason I don't express myself so well in situations like that ( spontaneously on the street ) is cause I used to stutter real bad as a kid.. couldnt talk... so I clamed up. All my life I've been fighting that disability ( and other "challenges" re: learning, reading , writing, asthma , etc ) in terms of the "repercusions".  Kids like me make fun of me cause I stutter...I can't fight back verbally and lash out physically... become a "maniac".  Get kicked out of city schools etc...  Trouble maker.  Can't express myself, fight back with words....when kids are mean to me. After a while they dont matter much as if they are mean I just keep quiet and keep mouth shut and start "thinking" instead... how to keep on top of this person and not let things get crazy... meet the challenge.
    Turns out I'm not stupid and at some point my being " quiet" becomes a positive thing.. peers start asking my advice.. I'm suddenly a " deep thinker" in their eyes.  I go from being disabled ( stupid ) to being " a deep thinker" about the age of puberty... when nobody knows what they are doing anymore.
    I start thinking about expressing myself some other way than talking.. like maybe draw pictures... paint stuff, do things to have fun with people that doesnt put me in the " limelight".. where I have to talk etc.  More success follows this tendency to socialize and express myself... and I discover that chics like the strong silent type.
    ( I have been into gymnastics thru my fathers infactuation with it since age 2 -- which I think eventually ( inadvertantly ) " cured me " of many of my learning disabilities etc --  (talk to an OT about this and modern child development stuff to know what I mean here )
    Meanwhile I am very fond of dogs as my family has dogs one after the other and I am one of their best friends. I find I can communicate with dogs better than I can communicate with people sometimes.  This seems to be a problem in some cases with some people, but for me it never got crazy... where I " loved dogs " more than I " love people ".  I have never loved any dog more than any person and shudder when I think of those who do.  Those people who do have more problems than I ever had to deal with.
    And now, after all these years ( I am now 60 ), working on movies and tv stuff etc as a crew person with some college fine art schooling ( eventual photo major ) to get me started, I got into this " editing " stuff... A program I can actually " use " on my mousey computer introduces me to a more " final product " than I ever had access to before.
    BUT I don't shoot motion pic stuff, cant afford that - and never could before basically, and now I think about the triple threats and future of movies and tv as a business... as well as the tools ( in this case the editing programs in conjunction with the cameras ( arri, panavision etc ) ) and the desire to express something ...
    This has to be ( if you want an audience ) ... " tell a story ".  You could just put a camera on a rocket ( strap it to the rocket ) and shoot the takeoff etc and show that.. but you need a V.O. saying " well, I just shot off a rocket and this is what it looked like"...to bring the experience to the audience... or else IMO there is no story.
    Which leads to what's going on now in the world of reality tv, episodic tv , some big movies, etc.  Telling a story is more than showing you stuff that you just wouldnt have seen if you hadn't been there yourself. Telling a story is more like saying something that bridges the gap between your own experience of life and its challenges ( of being part of your neighborhood and making sense of your own childhood and being an adult now maybe ).. and what others also have gone through to get to the same conclusions....
    This is the object of " expression" IMO, whether you can talk about it, draw pictures about it, or make music about it...
    And the editing program is a tool to help do that.. it is not the end all or purpose of life or the " personal crusade" in the long run.
    It's one reason scary snakes often shock people out of their desire for comfort and predictable living... makes you think about that one serpent in the garden of eden you create for yourself .... and IMO who cares what editing program you use to write that and shoot it ??

    Steve Grisetti, the MOD of the Premiere Elements forum and co-founder of a video/photo/editing Web site, Muvipix, did a nice article, "Don't just make a movie - tell a story." His audience was more consumer video editors, than the folk that we see around here, but his points were well-made, and were embraced by many in the Muvipix community.
    I think that too many, forget that concept - and I am talking Hollywood and NYC here. It's almost as if, when the story breaks down, they instinctively know to throw in a car chase, or big explosion.
    I know that I cite it too often around The Lounge, but that was what I enjoyed most about the LOR trilogy. It told a story. Now, though I had some exposure to the story, when much younger, I have to admit that I never read Tolkien, though almost everyone, that I knew, was busy with every book. Still, I only knew some of the high points, and not much more. However, almost immediately, I was drawn into the story, and only wished that I did not have to wait so long between episodes. The FX were cool, and I am a technoid sort, but it was the story that hooked me. I had read several articles on the FX production, so WAS looking for some of that, but what I wanted was the story. This is one that I will buy the BD "Director's Cut" of, and do a marathon. I have seen each segment, maybe three times, but never back to back to back. I still need to fill in a few blanks, and an entire day of viewing should do that - no phone, no visitors, nothing but LOR.
    As far as human communications, I can talk, even more than I write here, but only concerning things that I care about. I am horrible at "small talk," and would rather addrss an auditorium of 10,000, on something that matters to me, than talk about the weather to a single person at a fund raiser. Not that long ago, I was seated next to a potential donor at a charity dinner. I was rather dreading it, and when she mentioned that she did not drink (what, no wine?), I was worried. At some point, early in the evening, the subject turned to politics. Now, I usually am very quiet on my feelings, as they are not exaclty politically correct, and worry about hurting feelings, or making a scene. I fielded a question on Senatorial candidates, and just decided to answer from my heart. Her eyes lit up, and I did not notice that the event had ended. Her husband was standing, as was my wife, and we were talking politics, talk-radio, FoxNews, Senator John Kyl, Will Rogers and much more. I found that we were kindred spirits. Finally, our spouses pulled us apart, and we departed. We continued that conversation at 2 - 3 more events during "the season." One day, my wife informed me that she had just given $10M to the foundation - the largest single gift ever. At least she wasn't a screaming liberal, as I would surely have really messed up the deal... However, had it all been small talk, I would have found a reason to excuse myself and hide in the bar for a few hours.
    Also, the way that our society has developed, I will smile, nod, and say "hello" to strangers on the street, but always leave it at that. I am sure that many walk past and think "he wasn't all that friendly." They are probably right, but at least I was pleasant to them and did not rob them! Heck, I will usually tell telemarketers, "No, but thank you for your generous offer on that time-share... "
    Hunt

  • Problems with GROUP BY - not a GROUP BY expression

    Hello,
    I am fighting little bit with GROUP BY expression.
    After some tests I am able to reduce the problem to following...
    When can I use column numbers in GROUP BY expression?
    Consider this situation:
    CREATE TABLE EMP4 (
       NAME VARCHAR2(10)
    COMMIT;
    INSERT INTO EMP4 VALUES('Tamara');
    INSERT INTO EMP4 VALUES('John');
    INSERT INTO EMP4 VALUES('Joseph');
    COMMIT;
    SELECT NAME, COUNT(*)
    FROM EMP4
    GROUP BY 1;
    00979. 00000 -  "not a GROUP BY expression"
    -- This is working
    SELECT NAME, COUNT(*)
    FROM EMP4
    GROUP BY NAME;Why is the GROUP BY 1 not workig?
    I am using the GROUP BY 1 because in real query there is some PL/SQL function which somehow modifies the column NAME, so I can't use the column name
    SELECT TEST_PACKAGE.AppendSomeCharacter(NAME), COUNT(*)
    FROM EMP4
    GROUP BY 1;Of course I can nest the query and move the COUNT and GROUP BY to outer query or maybe something else, but I was just curious why is the GROUP BY not working...
    Also in real query, there are 3 columns in the GROUP BY expression, so I have there GROUP BY 1, 2, 3
    Thanks for help

    hai
    try the following
    CREATE TABLE TBL(ID NUMBER,VAL VARCHAR(20));
    INSERT INTO TBL VALUES(1,'Z');
    INSERT INTO TBL VALUES(2,'X');
    INSERT INTO TBL VALUES(1,'Z');
    INSERT INTO TBL VALUES(2,'X');
    INSERT INTO TBL VALUES(3,'A');
    INSERT INTO TBL VALUES(4,'H');
    INSERT INTO TBL VALUES(5,'B');
    INSERT INTO TBL VALUES(6,'C');
    INSERT INTO TBL VALUES(7,'T');
    INSERT INTO TBL VALUES(3,'A');
    INSERT INTO TBL VALUES(4,'H');
    INSERT INTO TBL VALUES(5,'B');
    INSERT INTO TBL VALUES(6,'C');
    INSERT INTO TBL VALUES(7,'T');
    CREATE TYPE SAMPLETYPE AS OBJECT ( ID NUMBER, NAME
    VARCHAR2(25) ) ;
    CREATE TYPE SAMPETBLTYPE AS TABLE OF SAMPLETYPE;
    CREATE OR REPLACE FUNCTION SAMPLEFUNC
    p_colname varchar2
    )return SAMPETBLTYPE pipelined as
    ret_val SAMPLETYPE;
    TYPE cursor_ref IS REF CURSOR;
    fcur cursor_ref;
    di TBL%ROWTYPE;
    sqlstr varchar2(1000);
    colname varchar(30):=p_colname;
    begin
    sqlstr:='SELECT * FROM TBL ORDER BY '|| colname ;
    DBMS_OUTPUT.PUT_LINE(sqlstr);
    open fcur FOR sqlstr;
    loop
    FETCH fcur INTO di;
    EXIT WHEN fcur%NOTFOUND;
    ret_val:=SAMPLETYPE(di.ID,di.VAL);
    PIPE ROW(ret_val);
    end loop;
    close fcur;
    return;
    end;     
    select * from table(SAMPLEFUNC('ID'));
    select * from table(SAMPLEFUNC('VAL'));

  • Trouble with SQL Expressions

    Hello everyone,
    I'm having trouble with this SQL expression that works in 8.5, and XI R2 runtime and designer, but I cannot edit the expression.  As soon as I open the SQL Expression and click the X-2 check button, the error following
    SQL Expression I'm trying to run:
    (Select Distinct b1.CandEmploymentType
        from ceistaffing a1
        inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
    Where a1.Staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID"
        and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
    The Errror I Receive After Clicking the X-2 button:
    Crystal Reports
    Error in compiling SQL Expression :
    Failed to retrieve data from the database.
    Details: ADO Error Code: 0x
    Source: SalesLogix OLE DB Provider
    Description: The multi-part identifier "CEIHRPROJECTEDACTUAL.STAFFINGCHAINID" could not be bound.
    Native Error:  [Database Vendor Code: 181797304 ].
    OK  
    This is the SQL statement passed to the database:
    SELECT (Select Distinct b1.CandEmploymentType
    from ceistaffing a1
    inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
    Where a1.Staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID"
    and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
    If I reverse the order of the where clause as follows, I do not get the error
    (Select Distinct b1.CandEmploymentType
    from ceistaffing a1
    inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
    Where CEIHRPROJECTEDACTUAL."STAFFINGCHAINID" = a1.Staffingchainid
    and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
    This is the working SQL statement passed to the database.
    SELECT (Select Distinct b1.CandEmploymentType
    from ceistaffing a1
    inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
    Where CEIHRPROJECTEDACTUAL."STAFFINGCHAINID" = a1.Staffingchainid
    and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
    FROM   "sysdba"."CEIHRPROJECTEDACTUAL" "CEIHRPROJECTEDACTUAL"
    I figured I would just reverse the where clause statements, but then I came to this one that I couldn't get to work:
    (Select case when tmp.restartcount = 0 then 'F' else 'T' end from
    (Select Count(b.restart) as restartcount from ceistaffing a inner join ceihrprojectedactual b on a.staffingchainid = b.staffingchainid
    where a.candcontactid = (Select distinct candcontactid from ceistaffing a2 where a2.staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID")
    and b.restart = 'T'
    and a.createdate = (Select min(a1.createdate) from ceistaffing a1
                   where a1.createdate > (Select max(a3.createdate)
                                  from ceistaffing a3
                                  where a3.staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID")
                   and a1.candcontactid = a.candcontactid)) as tmp )
    I've burned an entire day trying to find some solution.  Are there any patches out there that will fix this?
    I'm running Crystal Report XI Release 2 SP2 - Version 11.5.8.826
    Thank you, ...Rob

    Okay, to simplify the illustration of the problem Iu2019m facing, Iu2019ve created a bare bones example as described below:
    I've created a report that returns all contacts from our "CONTACT" table.  On the report, I've created a SQL expression to return a count of all contacts with the similar last name, as shown below:
    (Select count(a1.ContactID) from CONTACT a1 where a1.LASTNAME = "CONTACT"."LASTNAME")
    When I try to save the SQL expression,  I get this error:
    Crystal Reports
    Error in compiling SQL Expression :
    Failed to retrieve data from the database.
    Details: ADO Error Code: 0x
    Source: SalesLogix OLE DB Provider
    Description: The multi-part identifier "CONTACT.LASTNAME" could not be bound.
    Native Error:  [Database Vendor Code: 205193720 ].
    OK  
    This SQL expression works fine in CRW 8.5, but no luck in XI R2 SP4 - As mentioned above in the thread, this seems to be an issue solely with how XI R2 is parsing the SQL Expression.  If I remove the "A1" alias from my expression all is good, but that will not work for some of the more advanced SQL expressions I have that are using joins and sub queries.
    What will it take to get this recognized as an issue worthy of a hot fix?  I'm at a stand-still here, facing the unfortunate possibility of having to re-architect many of my reports.  Please help.
    Thank you, ...Rob
    Edited by: Rob Bartram on Aug 6, 2008 3:45 PM

  • Trouble with Extreme N base station and Express station wireless

    Upgraded extreme base station with new extreme "N" base station. Currently have the extreme "N" base station connected to cable modem on 2nd floor. I have wired the house to have the demarc on the 2nd floor. I purchased the express base station to be placed on 1st floor to extend the wireless range from the extreme "N" base station.
    Prior to this setup, I had a wired bridge on the 1st floor to the main router on the 2nd floor. I was able to connect all wireless connections to the bridge where there was weak signal to the main router on 2nd floor.
    The trouble I am having is that whether I have the express base connected or not. My signal is near the same as having only the main base station on 2nd floor. I can be seated right next to the express on the 1st floor and have only 1-2 bars on the signal.
    I have updated and running the latest utilities for the airports. I have also been seeing the same trouble with other Mac's and PC's.
    Also, I have been noticing the extreme "N" base station blinking amber when no Mac's or PC's are accessing the network or even when they are.
    So, even when both the extreme and express have solid green LED, I still have the problem.
    I am not sure if I am setting up this incorrectly or if I have hit a brickwall with this setup in my house.
    Could I hard wire the express from the extreme from the second floor as I did with the bridge I use to have? I am not sure if the express would work as a wired bridge.
    Just appears to be performing less then my prior PC networking products.
    Thanks everyone...hope to get some insight. I have read all the prior discussions and still not getting good results.

    Tesserax....Thanks for the quick clarification on using the expresss as a wired bridge. I did avert back to a wired bridge now using all apple products. I was trying to get away with reusing the hard wire from the base station since I was running out of ports on the base station. {Apple has to be difficult with only having 3 ethernet ports.}
    So I had to run a linksys switch off the extreme "N" base station.
    Thanks again..
    Guess I have to live with the quirks...

  • TS3276 Hi there I am having trouble with my outlook express this is the first time it has happened it keeps telling me can't connect to the SMTP server and every password I have tried is incorrect this is for 'iCloud' very frustrating as all our phones ar

    Hi there I am having trouble with my outlook express this is the first time it has happened it keeps telling me can't connect to the SMTP server and every password I have tried is incorrect this is for 'iCloud' very frustrating as all our phones are ok

    Well I am feeling a bit silly now because that was all I had to do. In the past Workgroup Manager had always opened right up to the list of my users, I never even thought to click on that but apparently that was all that was needed.
    I still am not sure how the iChat Server preferences changed themselves on me, but it is not the first time I have had weird "settings" issues with our Snow Leopard Server.
    Thanks!

  • Having trouble with my Airport Utility not supporting either of my Airports Expresses or Basestation. Do i have to update Firmware of airports or is the issue with my version of Utility which i believe is the latest. Thank you.

    having trouble with my Airport Utility not supporting either of my Airports Expresses or Basestation. Do i have to update Firmware of airports or is the issue with my version of Utility which i believe is the latest. Thank you.

    AirPort Utility in Mountain Lion will not support the older versions of the AirPort Express.....model numbers A1084 and A1088. Check on the side of the Express for the model number.
    In addition, AirPort Utility in Mountain Lion will not support the older "round" or "dome" shaped versions of the AirPort Extreme.
    Can you check to see how your devices might be affected?

  • GROUP BY with parameter - cause error -ORA-00979: not a GROUP BY expression

    I generate a query via PreparedStatement. For example:
    SELECT when, value FROM test GROUP BY ?;
    PrepState.toString(1, "when");
    That causing error: ORA-00979: not a GROUP BY expression
    My application using query like:
    SELECT to_char(data,1), SUM(vlue) as sum FROM test GROUP BY to_char(data, 2);
    PrepState.toString(1, "YYYY-MM");
    PrepState.toString(2, "YYYY-MM");

    Ah. Reproduced in the first chunk of PL/SQL below.
    The second chunk is a workaround.
    Basically, SQL is parsed by the syntax engine and optimizer to get an execution plan. Then you can have a sequence of "bind, execute, fetch, fetch, fetch..., bind, execute..."
    Since you can have multiple binds for a single SQL parse, then the fact that the first set of binds all happen to have the same value doesn't mean the next set will.
    The optimizer needs to be 100% sure that the value in the select must always be the same as the value in the group by, so you can't have two separate (and therefore potentially different) bind variable mappings. [Given the right circumstances, the optimizer might do all sorts of tricks, such as using materialized views and function-based indexes.]
    Misleadingly, it actually fails on the 'EXECUTE' step of DBMS_SQL rather than the PARSE.
    declare
      v_sql varchar2(1000) :=
        'select to_char(created,:b1), count(*) '||
        ' from user_objects u '||
        ' group by to_char(created,:b2) '||
        ' order by to_char(created,:b3)';
      v_fmt varchar2(10) := 'YYYY';
      v_cur number;
      v_ret_str varchar2(10);
      v_ret_num number;
      v_ret number;
    begin
      v_cur := dbms_sql.open_cursor;
      dbms_sql.parse(v_cur, v_sql, dbms_sql.native );
      dbms_sql.define_column_char (v_cur, 1, v_ret_str, 10);
      dbms_sql.define_column (v_cur, 2, v_ret_num);
      dbms_sql.bind_variable( v_cur, ':b1', v_fmt );
      dbms_sql.bind_variable( v_cur, ':b2', v_fmt );
      dbms_sql.bind_variable( v_cur, ':b3', v_fmt );
      v_ret := dbms_sql.execute( v_cur );
      WHILE ( dbms_sql.fetch_rows(v_cur) > 0 ) LOOP
        dbms_sql.column_value_char (v_cur, 1, v_ret_str );
        dbms_sql.column_value (v_cur, 2, v_ret_num );
        dbms_output.put_line('>'||v_ret_str||':'||v_ret_num);
      END LOOP;
    end;
    declare
      v_sql varchar2(1000) :=
        'select to_char(created,f.fmt), count(*) '||
        ' from user_objects u, (select :b1 fmt from dual) f '||
        ' group by to_char(created,f.fmt) '||
        ' order by to_char(created,f.fmt)';
      v_fmt varchar2(10) := 'YYYY';
      v_cur number;
      v_ret_str varchar2(10);
      v_ret_num number;
      v_ret number;
    begin
      v_cur := dbms_sql.open_cursor;
      dbms_sql.parse(v_cur, v_sql, dbms_sql.native );
      dbms_sql.define_column_char (v_cur, 1, v_ret_str, 10);
      dbms_sql.define_column (v_cur, 2, v_ret_num);
      dbms_sql.bind_variable( v_cur, ':b1', v_fmt );
      v_ret := dbms_sql.execute( v_cur );
      WHILE ( dbms_sql.fetch_rows(v_cur) > 0 ) LOOP
        dbms_sql.column_value_char (v_cur, 1, v_ret_str );
        dbms_sql.column_value (v_cur, 2, v_ret_num );
        dbms_output.put_line('>'||v_ret_str||':'||v_ret_num);
      END LOOP;
    end;
    /

  • Having trouble with report total row with expression based condition

    Hi,
    I have a simple SQL region that has 2 columns (country and pnl). I then had a request to display negative PNL in red. To do this I copied the Standard Alternating Row Colors report Template and changed the condition so that it uses one class (named "t16data") with a PL/SQL Expression condition NVL(#PNL#,0)<0
    Then, in the referencing page HTML header I added :
    <style>td.t16data{color:red} </style>
    For normal data rows it works fine. However, I also have a sum on PNL and the total row always shows red (even when it's a positive number).
    Any idea? Do I need to provide more information?
    Thanks

    My question about this is the other Dynamic VPN that is working has no static route.
    I added:
    route outside 10.10.10.0 255.255.255.248 xxx.xxx.xxx.xxx (where xxx.xxx.xxx.xxx is the IP of the non working remote IKE Peer)
    This had no effect.
    Looking at the two tunnels.  The working tunnel is using IKE IPSEC and the nonworking tunnel is using IKE IPsecOverNatT.  What have I entered that tells the VPN to use IPsecOverNatT?

  • Just bought a brand new Airport Extreme and having trouble with it being recognized. I have a Mac version 10.5.8. Is my computer compatible?  I have the Airport Express now and it works fine.

    Just bought a brand new airport extreme and having trouble with it being recognized.  My mac is version 10.5.8.  What should I do?

    The new AirPort Extreme needs the 6.x version of AirPort Utility, which comes packed in with Lion 10.7.5 or Mountain Lion 10.8.x......or......you can also configure the device using an iPhone or iPad running a recent iOS.
    From Apple's Specifications:
    Setup and Administration
    iPhone, iPad, or iPod touch with iOS 5 or later and AirPort Utility 1.3
    Mac with OS X Lion v10.7.5 or later and AirPort Utility 6.3
    A few options.....
    Borrow another Mac running Lion or Mountain Lion for 10-15 minutes and set it up. The Mac running 10.5.8 will be able to connect to the wireless....but it will not be able to make any changes to the configuration of the Extreme.
    Update to Lion or Mountain Lion.....but check first to make sure that your Mac will support the operating system first.
    Use....or borrow an iPhone or iPad to set up the Extreme

  • AD query -- trouble with group.member list

    Hello,
    I'm attempting to create an AD query that filters for certain groups and all the members of those groups. I start with the groups table and filter to get the groups of interest. No problems so far.
    When I expand the group column to pick up the "member" column, I get group.member and the cell values have changed from "Record" to "List."  When I expand "List" I can tell I'm at the right level of granularity,
    because the number of rows has increased, and the group names are repeated for the number of members in a group. The problem is that the group.member field now shows "Record" again. I can't expand on it. And when I click on any of the "Record"
    links, I can see the individual's name.
    Any ideas on how I'm to get the name to show up in the full result set rather than needing to click on the "Record" link? Searching for "Power Query" with "record" has been...unhelpful (expectedly so).
    Thanks

    Gil,
    Thanks for the reply. I notice that in my query, displayName is null for all the records returned. I have been able to get the group name information from the sAMAccountName field, although I wonder if that is what is causing the issue when I attempt to
    expand. 
    Here are more details on my query stages:
    The first stage is with the following query (I left the "GL" filter visible since by itself it's not confidential):
    let
        Source = ActiveDirectory.Domains(<domain>),
        <domain> = Source{[Domain=<domain>]}[#"Object Categories"],
        group1 = <domain>{[Category="group"]}[Objects],
        #"Expand securityPrincipal" = Table.ExpandRecordColumn(group1, "securityPrincipal", {"sAMAccountName"}, {"securityPrincipal.sAMAccountName"}),
        #"Filtered Rows" = Table.SelectRows(#"Expand securityPrincipal", each Text.StartsWith([securityPrincipal.sAMAccountName], "GL"))
    in
        #"Filtered Rows"
    The second stage (1st screenshot) is immediately after I expand the group column and select "member." I show the bottom view, too, which shows the three records associated with this list (the correct number of users in that AD group).
    When I "expand" group.member, it changes from List to Record and there is now one row for each user in a group. However, when I go to pick the displayName column from group.member, it gives me the message "No columns were found." Yet,
    when I select the group.member value, I can see in the view below that there is a displayName. (See 2nd screenshot.) Note that I filtered the records in the third screenshot to just a single group -- 3 records.
    Does this additional information help isolate what I might be experiencing?
    Here is the query to match the final screenshot:
    let
        Source = ActiveDirectory.Domains(<domain>),
        <domain> = Source{[Domain=<domain>]}[#"Object Categories"],
        group1 = <domain>{[Category="group"]}[Objects],
        #"Expand securityPrincipal" = Table.ExpandRecordColumn(group1, "securityPrincipal", {"sAMAccountName"}, {"securityPrincipal.sAMAccountName"}),
        #"Filtered Rows" = Table.SelectRows(#"Expand securityPrincipal", each Text.StartsWith([securityPrincipal.sAMAccountName], "GL")),
        #"Expand group" = Table.ExpandRecordColumn(#"Filtered Rows", "group", {"member"}, {"group.member"}),
        #"Expand group.member" = Table.ExpandListColumn(#"Expand group", "group.member"),
        #"Expand top" = Table.ExpandRecordColumn(#"Expand group.member", "top", {"name"}, {"top.name"}),
        #"Removed Columns" = Table.RemoveColumns(#"Expand top",{"msExchIMRecipient", "ciscoEcsbuUMAttributes", "posixGroup", "top.name", "msExchBaseClass",
    "msExchCustomAttributes", "mailRecipient"})
    in
        #"Removed Columns"
    Scott C.

  • I have been having a lot of trouble with the latest itunes update and my ipod classic 80Gb i.e. being unable to sync songs, but now i have no files at all on my ipod, it is completely blank when i view it from my computer. I need help, please, anybody.

    As it says above, i have been having a lot f trouble with my ipod classic and the latest itunes update, i was unable to sync songs or anything to it and have tried every conceivable 'fix' i could find. i have run an itunes diagnostic and the results are posted below. a major problem is that when i try and view my ipod through my computer it displays nothing at all on the ipod, no files or anything, this may be the problem but i have no idea how it has happened or how i could resolve it.
    This ipod holds huge sentimental value and i am loathe to buy a new one! If anybody can help it is greatly appreciated, than kyou in advanced.
    Microsoft Windows 7 x64 Home Premium Edition Service Pack 1 (Build 7601)
    ASUSTeK Computer Inc. K50IJ
    iTunes 11.1.5.5
    QuickTime not available
    FairPlay 2.5.16
    Apple Application Support 3.0.1
    iPod Updater Library 11.1f5
    CD Driver 2.2.3.0
    CD Driver DLL 2.1.3.1
    Apple Mobile Device 7.1.1.3
    Apple Mobile Device Driver 1.64.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.6.502
    Gracenote MusicID 1.9.6.115
    Gracenote Submit 1.9.6.143
    Gracenote DSP 1.9.6.45
    iTunes Serial Number 0038B8600B98D1E0
    Current user is not an administrator.
    The current local date and time is 2014-03-21 16:52:39.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is not supported.
    Core Media is supported.
    Video Display Information
    Intel Corporation, Mobile Intel(R) 4 Series Express Chipset Family
    Intel Corporation, Mobile Intel(R) 4 Series Express Chipset Family
    **** External Plug-ins Information ****
    No external plug-ins installed.
    Genius ID: 2fd81a1f13cf3ff25a8b4f0e8e725116
    **** Device Connectivity Tests ****
    iPodService 11.1.5.5 (x64) is currently running.
    iTunesHelper 11.1.5.5 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    Universal Serial Bus Controllers:
    Intel(R) ICH9 Family USB Universal Host Controller - 2934.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2935.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2936.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2937.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2938.  Device is working properly.
    Intel(R) ICH9 Family USB Universal Host Controller - 2939.  Device is working properly.
    Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293A.  Device is working properly.
    Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293C.  Device is working properly.
    No FireWire (IEEE 1394) Host Controller found.

    Here is what worked for me:
      My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.

Maybe you are looking for

  • Duplicate a Text Field on Every Page of a Document?

    Today I wrote my first vb.net/adobe app.  I managed to open the pdf doc in adobe and create a named text field.  I managed to insert a java script that gets the current date when the document is open and updates the text field.  I would like to dupli

  • Why won't my Mac Pro sleep after Lion is installed?

    Why won't my Mac Pro sleep after Lion is installed?

  • Imposible to downgrade?!

    Ok, by attempting to downgrade from the recent 7.0.0.102, to 6.16, it worked, at least until I turned my computer on the next day. Skype had automatically updated 7,0 again, then after uninstalling and stopping the automatic updater twice, I attempte

  • Setting up LDAP Server to lookup Connection Factories using JNDI

    Can someone let me know how to setup LDAP server within 10G to lookup connection factories using JNDI? I read through the Advanced Queuing User Guide and Reference document where this is mentioned and it says use the Database Configuration Assistant

  • Problem with starting OEM-agent on NT (clustered)

    We have problem with starting the OEM-agent (9i) on Windows 2000. The Nt-server is clustered. I have started the OracleAgent by the service screen. Everyting looks ok. But, from the server where the OEM-console is installed I can't contact the agent.