Strange thing noticed with a view and group by

Hi all, Could anybody please tell me what could be the problem if you have come across it ever.
I am using a view which is fetching 4 million rows from another db thru a dblink. In the view query this data is joined with two other small temporary tables and the output is taken out.
The whole process is like this...
1.Create the two temporary tables..
2. Alter the view to compile;( as these temporary tables are dropped after the whole process)
3. insert into the target table using another query by taking the data from the VIEW
4. drop the temporary tables.
All these are in a single script.
In the insert statement I use a group by in the select statement to produce sum of three columns.
the ideal output is as giiven below:
total rows= 4.7 million.
after the group by i should get 293,356 rows( i tested it after taking all the rows from the view into my db and did a group by on it with the required columns)
Now the group by is done directly by taking the data from the view and inserting into the final table.
When i ran the script for the first time I got this 293,356 rows... The second time I ran it gave me only 73090 rows. But the sum total of those 3 columns are exctly same as that of 293,356 rows. I donot change the number of columns in group by or anything like that... what i am doing is just running it again....
Can anybody tell me why it gives different number of rows at different times when the same script is run without any changes...( There is no difference in the original number of rows too..)
Thanks
Edited by: user626688 on Oct 17, 2008 12:26 PM

Way not enough information.
Assume you have Oracle to Oracle connection here (with your DB link). What version are BOTH databases on. No idea what the view looks like, or how you use it, or what these 'temporary tables' you create on the fly do.
Can you put together a small example of this which recreates your problem? We don't have your tables, your script, your ability to run queries and check things, so there's really not much anyone can do to help you with this.
The simplest explanation is usually the correct one, so although it's possible you've hit an internal Oracle bug, i'd put my money in there being a flaw in your processing, it's where the safe money is. Though there could be a bug with view merging, or the DB link, or .....

Similar Messages

  • How can the info block be assigned with the view and assign view to users.

    Dear Friends,
    Anyone could plz tell me how can the info block be assigned with the view and assign view to users.  Also how can the info block in sale summary be assigned with a view and how to assign this view for user.
    Regards,
    Ashima

    Hi,
    To define view and to make it default
    Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Define Reporting Views (Tcode:OVCD).
    To assign default user to the view.
    Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Assign Default View To User (Tcode:OVCC).
    To assign Elements of SAPScript "SD-SALES-SUMMARY" to information Blocks To A View use
    Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Assign Information Blocks To A View (Tcode:OVCB).

  • How can i delete contacts completely so that they don´t mix up with new addresses and groups?

    how can i delete contacts completely so that they don´t mix up with new addresses and groups?
    Alle geänderten Adressen oder Gruppen erscheinen immer wieder bei der Adresseingabe von mails.
    Chaos!

  • Issue with materialized view and fast refresh between Oracle 10g and 11g

    Hi all,
    I've hit a problem when trying to create a fast-refreshable materialized view.
    I've got two databases, one 10.2.0.10, another 11.2.0.1.0, running on 32-bit Windows. Both are enterprise edition, and I'm trying to pull data from the 10g one into the 11g one. I can happily query across the database link from 11g to 10g, and can use complete refresh with no problem except the time it takes.
    On the 10g side, I've got tables with primary keys and m.v. logs created, the logs being of this form ...
    CREATE MATERIALIZED VIEW LOG ON table WITH PRIMARY KEY INCLUDING NEW VALUES
    On the 11g side, when I try to create an m.v. against that ...
    CREATE MATERIALIZED VIEW mv_table REFRESH FAST WITH PRIMARY KEY AS SELECT col1, col2 FROM table@dblink;
    ... I get an ORA-12028 error (materialized view type is not supported by master site).
    After running the EXPLAIN_MVIEW procedure it shows this;
    REFRESH_FAST_AFTER_INSERT not supported for this type mv by Oracle version at master site
    A colleague has managed to build a fast-refresh m.v. from the same source database, but pulling to a different one than I'm using; his target is also 10g, like the (common) source, so I've no idea why I'm getting the 'not supported' message whilst he isn't.
    I've been able, on previous projects, to do exactly what I'm trying to achieve but on those someone with more knowledge than me has configured the database!
    I'm now stumped. I'm also no DBA but despite that it's been left to me to install the new 11g database on the 32-bit Windows server from scratch, so there are probably a couple of things I'm missing. It's probably something really obvious but I don't really know where to look now.
    If anyone can give me any pointers at all, I'd be really grateful. This question is also duplicated in the Replication forum but hasn't had any replies as yet, so I'm reproducing it here in hope!
    Thanks in advance,
    Steve

    Hi Steve,
    You should have a look at metalink, Doc ID 1059547.1
    If that does not help, there may be something else in Mater note ID 1353040.1
    Best regards
    Peter

  • Project Pro 2013 Crashing - has something to do with Global Views and or Tables?

    I have 800 or so active project files in my 2013 PWA instance. I am just starting to get my head around this potential bug. I have not reproduced it yet but I have seen it a number of times. MS Project Pro randomly
    freezes after one of the following actions
    1) Attempting to change Gantt Chart Task text format
    2) Attempting to changing from one view to another
    3) Attempting to save the file
    In each case this behavior is corrected by going to the Organizer and removing any and all local Views and Tables that have the same name as the a View or Table in the Global.
    The fix is easy but users are pretty upset when they lost work from a multi-hour meeting.
    I imagine this is a conflict with the view or table name? ?
    Has anyone heard of this before? Clues?

    John,
    I have not seen this issue myself, nor have I found a reference to it in the fixes in the CU. Having said that, I am a little confused as to how users would have local views with the same name as the enterprise ones?
    May be one thing to try is to rename the enterprise views with the word 'Enterprise' at the beginning and see if it fixes the issue?
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • Can't see Manage Link to work with tables views and links

    I have an Azure account linked to Office365, and a Pay as you go subscription;  and have been working with SQL for a few months without any problem.    I wanted to move one of my databases to my own Azure account (not tied to our O365)
    so I get a free trial, and then converted that to paid with my credit card.   I had someone help me move the database, but now when I look at it in the new account there is no "Manage" link at the bottom to open and see the tables, fields,
    views, etc.     I don't understand why that isn't there.  I can copy, delete, all sorts of things.   But I can't "manage".    any ideas would be greatly appreciated.

    I checked with a college and he pointed me to another post on the same topic:
    Clicking the ‘Manage’ button in Azure Management portal launches the SQL Azure Management (SilverLight) Portal in a new tab in the browser. At this time, we do not plan to support this SilverLight-based SQL Azure Management Portal with V12 databases and
    servers.
    We are working hard on an HTML-based T-SQL editor experience that will deeply integrate with the preview Azure Management Portal. Until then, we encourage customers to use Visual Studio Community 2013 which is a full-featured free version of Visual Studio
    2013 to connect to Azure SQL databases for tasks such as running T-SQL, designing schema and for offline and online database development.
    You can click the the ‘Open in Visual Studio’ in the database page in the Azure Management portal to launch VS2013 on your computer and easily connect to your SQL Database.
    In addition, you can also use SQL Server Management Studio 2014 with CU6 to connect to Azure SQL Database. More details are on this blog post.
    This posting is provided "AS IS" with no warranties, and confers no rights
    I hope that helps,
    Jan

  • Strange new problem with external effects and latency compensation

    i'm currently facing a new , very strange problem with latency compensation for external effect devices. it alway worked fine for me but suddenly there are strange things going on. i'm suddenly running into problems when using sends which feed auxes going to external effect devices.
    latency compensation is set to ALL !!!
    easy setup :
    - open an empty project and create 2 audioinstrument tracks. on the first one load the exs with a drumkit and record f.e. a bassdrum pattern. leave the 2. instrument empty.
    - now on the first audio instrument create a send to bus 1 -> aux 1 and insert the i/o plug-in in the aux and route it to your external effect device. chose a temposynced delay.
    - press play = everything is fine when audioinstrument 1 is highlighted in the arrange.
    - press stop, click on the track with the 2. audioinstrument and press play = totaly weird timing problems. delay is only in sync when track 1 is highlighted.
    - create a send in the 2. audioinstrument and route it to bus 1 -> aux 1 too = still the same problem
    now insert ANY softwareinstrument in audioobject 2 and suddenly the timing for the delay is right.
    go ahead and create a 3. audioinstrument track but leave it empty first. chose it in the arrange = again weird timing problems with the external delay.
    insert any software instrument on audioinstrument 3 = still the same problem
    now create the send to bus 1 -> aux 1 in audioinstrument 3 and guess what, timing is right.
    *** is going on here ? can anyone reproduce that ?
    it works fine when using sends which feed auxes with software effects inserted.
    funny thing is, when i go to the environment and change aux object one to bus object 1 and insert the same i/o in it it works !!!
    very very strange, please tell me i'm not crasy and this is a bug !!!
    as said, latency compensation is set to all.
    i'm using the mac pro 3.2 8-core running os 10.5.4, logic 8.0.2 and a motu pci-e audio system.
    Message was edited by: Olaf Dieckmann

    Welcome to the Discussions.
    If you need it formatted FAT32, reformat it on your Mac. Use MS-DOS (FAT32) as the file system. If you don't need it for both PC and Mac, format it HFS+ and you'll be able to use the Retrospect Express software that came with it on your Mac.
    John

  • Strange things happening with fonts?!?

    Some strange things are happening with fonts. The following
    picture shows part of the problem. This is only occuring with IE 6.
    It doesn't happen in IE 7 or the current firefox. The information
    in the silver and white box is the problem. This is being pulled
    via spry and being displayed via a div tag. It shouldn't be bold
    faced. No code is telling it to bold face, yet it is.
    http://i211.photobucket.com/albums/bb305/silentbobsecret/fontissue.jpg

    Are you using a fade effect on it? If so, that's an IE bug,
    which has several workarounds which include setting the background
    color on whatever it is your are fading, or making sure that after
    the effect is done (via a finish function) making sure to remove
    any opacity related style on the element you just faded in.
    This sample also had that problem:
    http://labs.adobe.com/technologies/spry/samples/data_region/DetailRegionEffectsSample.html
    but we used the background color trick.
    --== Kin ==--

  • Need Help with Crystal viewer and ActiveX

    Hi !!
    I have a problem that i cant seem to be able to solve. I had alot of help from the forum but i think i got everything mixtup now...
    From my addon i can print with CrystalReport Viewer or i cant print a Crystal report directly to my default printer, so thats good and working well. The problem is with Crystal Viewer that drags on the SBO screen and stays on the task bar.
    It is strongly recommended to use an Activex to display my Crystal Viewer report. I tried so many differrent ways allways ending up with class id errors, or private class errors.
    My report is called c:\report.rpt
    My Working CrystalViewer form is called 'frmCRV'
    Can some one help me thru this last step...  I tried with the Activex sample in SDK but i think i dont have to use the Tree function ??? am i right ??
    I'm running on SBO 2005 SP1 PL3
    Crystal Report .net V10 and .net for code.
    Thanks you all for your patience.

    Hi Again !
    I can now open a form with an Activex part but i cant pass my CrystalViewer in it. Always says specified cast not valid.
    Thanks

  • Mount usb with fstab, users and groups.

    This is my fstab file.
    UUID=5d0339ca-83ab-4ce6-9dff-ed407fc3c5e0 / ext4 rw,relatime,data=ordered 0 1
    # /dev/sda2
    UUID=75552890-f5f6-4472-bef4-37965baf2dac /home ext4 rw,relatime,data=ordered 0 2
    # samsung1tb
    UUID=15957579-4fa5-4726-815c-d9762f584120 /home/spiritech-ext ext4 rw,relatime,data=ordered 0 2
    # corsair8gb
    UUID=75602c63-1935-4ed9-8401-6dd2a7853878 /home/corsair8gb ext4 rw,users,relatime,noauto 0 0
    my problem is when i mount the usb /home/corsair8gb the users and groups become root. is this normal for usb drives. it does not happen when the samsung1tb is mounted, so was wondering how i can mount the corsair8gb without changing the users and groups of the directory i mount it to???
    NOTE: /home/corsair8gb directory user is myusername and group is users when device is not mounted.

    rebootl wrote:
    Have you tried the option user instead of users? It's not exactly the same.
    Edit: To enforce it you can also set the user/group id by uid=<youruserid>,gid=<yourgroupid> .
    Note that these are numbers, to find them e.g. issue "id" in a terminal.
    ok i will try this way. i did try before. didnt realise it was with codes.

  • Rewrite the query with out joins and group by

    Hi,
    This was an interview question.
    Table Names: bookshelf_checkout
    bookshelf
    And the join condition between these two tables is title
    We need to rewrite below query without using join condition and group by clause ?
    SELECT b.title,max(bc.returned_date - bc.checkout_date) "Most Days Out"
               FROM bookshelf_checkout bc,bookshelf b
               WHERE bc.title(+)=b.title
               GROUP BY b.title;When I was in college, I read that most of the SELECT statements can be replaced by basic SQL operations (SET OPERATORS). Now I am trying to rewrite the query with SET operators but not able to get the exact result.
    Kindly help me on this.
    Thanks,
    Suri

    Something like this?
      1  WITH books AS (
      2  SELECT 'title 1' title FROM dual UNION ALL
      3  SELECT 'title 2' FROM dual UNION ALL
      4  SELECT 'title 3' FROM dual ),
      5  bookshelf AS (
      6  SELECT 'title 1' title, DATE '2012-05-01' checkout_date, DATE '2012-05-15' returned_date FROM dual UNION ALL
      7  SELECT 'title 1' title, DATE '2012-05-16' checkout_date, DATE '2012-05-20' returned_date FROM dual UNION ALL
      8  SELECT 'title 2' title, DATE '2012-04-01' checkout_date, DATE '2012-05-15' returned_date FROM dual )
      9  SELECT bs.title, MAX(bs.returned_date - bs.checkout_date) OVER (PARTITION BY title) FROM bookshelf bs
    10  UNION
    11  (SELECT b.title, NULL FROM books b
    12  MINUS
    13* SELECT bs.title, NULL FROM bookshelf bs)
    SQL> /
    TITLE   MAX(BS.RETURNED_DATE-BS.CHECKOUT_DATE)OVER(PARTITIONBYTITLE)
    title 1                                                           14
    title 2                                                           44
    title 3Lukasz

  • Differences between consolidation with Direct share and Group share?

    Dear all,
    I am new in consolidation of investments.
    Example illustrated from SAP help directory showed that the amount of goodwill arises from acquisition with direct shares will be more, Why?
    In what circumstances acquisitions with direct share is used instead of Group share?
    Thanks.
    Regards,
    Renee

    Direct shares and Group shares: 
    The group share and minority share of investments and equity in acquisitions of an investee unit are evaluated on the basis of the current percentages of ownership.
    ·       Acquisitions with direct shares (used in U.S. GAAP statements)
    ·       Acquisitions with groups shares (used in German HGB statements).
    If acquisitions are calculated on the basis of direct shares, only investment paths between the immediate upper units and the investee unit are taken into account; group shares of the remaining upper units are not taken into account.
    The entire ownership grid is taken into account when using acquisitions with group shares. The group share in the investee unit results from taking into account all investment paths that lead from the parent units of the consolidation group to the investee unit.

  • Adobe Reader 9.1.3 Issues with browser viewing and printing

    I have several users reporting issues after upgrading to Adobe Reader 9.1.3
    Issue #1:  User tries to open a PDF on a bank website using Adobe 9.1.3 but receives an error stating file could not be found.  Adobe 9 was uninstalled and Adobe 6 re-installed.  The file on the bank website was then viewable without issue.
    Issue #2:  Different user successfully opens pdf on a different bank website, but is unable to print while viewing in browser using Adobe 9.1.3.  User had to save file to desktop and reopen locally to print from Adobe 9.1.3.   Uninstalling 9.1.3 and re-installing Adobe 6 allowed them to print from the browser successfully.
    Issue #3:  turning off "View in Browser" causes the error "File cannot be found" when trying to view a PDF on a website.  This appears to be happening on sites external to our network, but not on internal sites.  Turning on "View in Browser" corrects the problem.
    Any assistance that can be provided would be greatly appreciated!

    To clarify my previous post, I had already seen http://forums.adobe.com/message/1770581 .  I mentioned in my post that I get the message "Preview not supported" when I click the Preview button from the print dialog in Adobe Reader, and thus concluded that the "Preview" workaround discussed in that thread wasn't helping me.
    However, re-reading that post, they were talking about using the Mac "Preview" application to print the pdf file.  Like every other application (other than Reader) I have tried, the Mac's Preview application prints just fine, and is another workaround.
    The only program that doesn't print for me is Adobe Reader.
    BTW, I also have an Intel chip in my MacBook Pro.
    Re-installing Leopard, as suggested by one post in that thread, is not a reasonable option for this problem.
    In fact, since Preview allows me to view and print .pdf's , my solution is probably just going to be not to use Adobe Reader.  In fact, had I not been new to the Mac, I would have known that I didn't need Adobe Reader at all.
    However, I'm glad this happened, in the sense that I use CS3 on the PC, and had considered moving to CS4 on the Mac.  However, since Adobe apparently hasn't figured out how to get printing to work on a Mac from their flagship product (!), I will be sure to do a lot of testing of CS4 before considering buying the upgrade.

  • Connectivity Problem with WPF Viewer and Oracle based imbedded reports

    I've been using code to modify the Database, Username and Password in imbedded reports for quite a few years.  Whether I was using C++ V6 or C# in VS2008, the process has been basically the same.  Now I am trying to use the WPF Viewer in VS2010 and am getting an "ORA-00942: table or view does not exist" error.  I perform a successful Connectivity Test and receive the error when I'm trying to view the report. 
    If I comment out all of the code that sets the source of the data and performs the connectivity test, the report shows up in the viewer and I'm presented a logon window similar to what I see when i design the RPT file in Crystal Reports. i.e the "Server Name:" shows the name of the Oracle Database I used when I designed the report; the "Database: " is empty; the "Login ID:" displays an edit box and contains the User ID I used when designing the report; and the "Password: " displays an edit box in which I type the password.  Once I click on the OK button, the report is displayed in the WPF viewer.
    Here is the code starting after I have loaded the report into a ReportDocument:
    if(report.IsLoaded)
      CrystalDecisions.Shared.TableLogOnInfo crTableLogonInfo;
      CrystalDecisions.CrystalReports.Engine.Tables crTables = report.Database.Tables;
      foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
        crTableLogonInfo = crTable.LogOnInfo;
        crTableLogonInfo.ConnectionInfo.LogonProperties.Clear( );
        crTableLogonInfo.ConnectionInfo.Attributes.Collection.Clear( );
        crTableLogonInfo.ConnectionInfo.DatabaseName = null;
        crTableLogonInfo.ConnectionInfo.ServerName = MyDatabase;
        crTableLogonInfo.ConnectionInfo.UserID = MyUsername;
        crTableLogonInfo.ConnectionInfo.Password = MyPassword;
        crTable.ApplyLogOnInfo(crTableLogonInfo);
      report.SetParameterValue("StartingCPID", "AAAAAA");
      report.SetParameterValue("EndingCPID", "ZZZZZZ");
      if(report.Database.Tables[0].TestConnectivity())
        reportViewer.ViewerCore.ReportSource = report;
        reportViewer.ToggleSidePanel = SAPBusinessObjects.WPF.Viewer.Constants.SidePanelKind.None;
      else
        MessageBox.Show("Unable to Connect to Database in report.");
    Any idea what I'm doing wrong or what is different in this version?

    See if the KB [
    [1448013  - Connecting to Oracle database. Error; Failed to load database information|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333433343338333033313333%7D.do] helps.
    Also the following may not hurt to have a look at (if only for ideas):
    [1217021 - Err Msg: "Unable to connect invalid log on parameters" using Oracle in VS .NET|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313337333033323331%7D.do]
    [1471508 - Logon error when connecting to Oracle database in a VS .NET application|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333433373331333533303338%7D.do]
    [1196712 - Error: "Failed to load the oci.dll" in ASP.NET application against an Oracle database|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333133393336333733313332%7D.do]
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • One thing fixed with iOS 4 and one thing not quite working yet.

    Well, I was just outside after updating my 3GS to iOS4 and I noticed that my GPS lock-on was FIXED. It now locks on in mere seconds and shows a VERY accurate fix. Whether I have the Wi-Fi turned on or not, it just works now. I had all sorts of issues with this in 3.1.x but now it just works.
    Now to the thing that is not working. My bookmarks from MobileMe are not being downloaded and applied to Safari in iOS4.
    If anyone else has had this issue and knows of a fix, I would be most appreciative.

    This issue is now resolved for me. I stopped the sync for all the different MobileMe services and then re-enabled them. Now, it all works as intended.

Maybe you are looking for