Issue with "Select Distinct" query in Oracle 10g against Oracle 9i

Hi,
I would appreciate if some one help me here because it is really urgent.
We are upgrading our database from 9i to 10g.
There are the "Select distinct" queries in the code which populated the grid on the applications screens. We found a difference in 9i and 10g the way the result is populated for these queries. If "Select Distinct" query wihtout a order by clause is executed in 9i then the result is automatically sorted. But Oracle 10g does not do this.
We can change the queries adding order by clause but we are almost at the end of the testing and want to know if there is any way that we can do this from database settings. Would there be any impact of these settings change on overall operation of Oracle 10g?
I would appreciate if some one can help me here.
Thanks,
Dinesh

then the result is automatically sorted.No. Oracle may have done a sort operation to perform the distinct, but it still did not guarantee the order of your results.
In 10g and in 9i, if you want your results in a certain order you must use order by.

Similar Messages

  • OraException from Command.ExecuteReader with SELECT DISTINCT

    Hello
    I am trying to fill an OraDataReader object from a OraCommand object.
    It appears that whenever the statement includes a SELECT DISTINCT, the command fails (even though the SQL statement works fine when executed e.g. in TOAD)
    Dim Conn As OraConnection = New Oracle.DataAccess.Client.OraConnection("[Valid connection string]")
    Conn.Open()
    Dim Command As OraCommand = New OraCommand()
    Command.CommandType = CommandType.Text
    Command.CommandText = "select DISTINCT nvl(SUBFAMILY_COMPETENCY_ID, 0) SUBFAMILY_ID, nvl(NAME, ' ') NAME, FAMILY_COMPETENCY_ID FAMILY_ID " & _
    " from TAXONOMY_RELATIONAL, COMPETENCY " & _
    " where TAXONOMY_RELATIONAL.CL_ID = :1 " & _
    " AND COMPETENCY.cl_id (+) = TAXONOMY_RELATIONAL.cl_id and COMPETENCY.language_id (+) = :2 " & _
    " and COMPETENCY.COMPETENCY_ID (+) = TAXONOMY_RELATIONAL.SUBFAMILY_COMPETENCY_ID " & _
    " order by FAMILY_ID, SUBFAMILY_ID"
    Command.Parameters.Add("@CL_ID", context.Session!CLID)
    Command.Parameters.Add("@LANGUAGE_ID", context.Session!LANGUAGEID)
    Dim DataReader As OraDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)
    An Oracle.DataAccess.Client.OraException is raised when executing the last statement, but no further details are given in the error message. The stack trace begins as follows
    [OraException]()
    Oracle.DataAccess.Client.OraException.HandleErrorHelper(Int32 errCode, OraConnection conn, IntPtr opsErrCtx, IntPtr opsSqlCtx, Object src, String procedure) +639
    Oracle.DataAccess.Client.OraCommand.ExecuteReader(+737)
    Oracle.DataAccess.Client.OraCommand.ExecuteReader(CommandBehavior behavior) +8
    The exception disappears as soon as I remove the DISTINT keyword from my SQL statement.
    Is this a bug or am I doing something wrong?
    Thanks for help,
    Bernt Fischer

    This issue is same as the one mentioned in the thread with title "Problem with 'Select distinct'" and the fix would be available in the next release.

  • Oracle 10g vs Oracle 11g query performance

    Hi everyone,
    We are moving from Oracle 10g to Oracle 11g database.
    I have a query which in Oracle 1g takes 85 seconds to run, but when I run the same query in Oracle 11g database, it takes 635 seconds.
    I have confirmed that all indexes on tables involved are enabled.
    Does anyone have any pointers, what should I look into. I have compared explain plans and clearly they are different. Oracle 11g is taking a different approach than Oracle 1g.
    Thanks

    Pl post details of OS versions, exact database versions (to 4 digits) and init.ora parameters of the 10g and 11g databases. Have statistics been gathered after the upgrade ?
    For posting tuning requests, pl see these threads
    HOW TO: Post a SQL statement tuning request - template posting
    When your query takes too long ...
    Pl see if the SQL Performance Analyzer can help - MOS Doc 562899.1 (TESTING SQL PERFORMANCE IMPACT OF AN ORACLE 9i TO ORACLE DATABASE 10g RELEASE 2 UPGRADE WITH SQL PERFORMANCE ANALYZER)
    HTH
    Srini

  • Issue with Select options in select statement - ABAP Question

    Hi
    I am facing an issue with select options. Select statement is returning sy-subrc as 4.
    I wrote the program as below:
    SELECT-OPTIONS:
    s_kunnr FOR bsad-kunnr,
    s_lifnr FOR bsak-lifnr,
    s_gjahr FOR bsad-gjahr,
    s_bukrs FOR bsad-bukrs,
    s_saknr FOR bsad-saknr,
    s_budat FOR bsak-budat.
    In start of selection I have written the select statement as
    SELECT * FROM bsak INTO TABLE lt_bsak
    WHERE bukrs IN s_bukrs AND lifnr = s_lifnr AND gjahr IN s_gjahr AND budat IN s_budat AND saknr IN s_saknr.
    In selection screen I have not entered any values and executed the program. I am not getting any result. When I debug that, sy-subrc is 4 at above select statement. But table has records.
    If am removing the "lifnr = s_lifnr " condition in select then select is returning values.
    I am not getting where I made the mistake. Please suggest.
    Thank you
    Hanu

    Hi,
    The problem here with where condition select option lifnr = s_lifnr.
    Use below select query.
    SELECT * FROM bsak INTO TABLE lt_bsak
    WHERE bukrs IN s_bukrs
        AND lifnr     IN s_lifnr
        AND gjahr   IN s_gjahr
        AND budat  IN s_budat
        AND saknr  IN s_saknr.
    s_lifnr is a select option and you are passing it as parameter lifnr = s_lifnr.
    if you want to pass this s_lifnr as single vale then pass in below mentioned way.
    lifnr = s_lifnr-low
    BR,
    Vijay

  • OnChanger="get_ajax_select_xml(this);" with  select list (query named LOV)

    Hello,
    i used Vikas'example Re: cascading lov for tabular form
    i have a problem with Select list (query based LOV)
    when run tabular form i have the following error:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    the number of rows of the Lov are 900
    the display variable is 70 char
    is there any limit?
    Thank in advance
    Costanti

    Leo,
    Thanks for the response, but I don't think you quite understand my problem. If I go to the Column Attributes screen for the group_id field, I have the "Display As" drop down set to "Select List (query based LOV)", not "Select List (named LOV)". This requires that the sql query be written in the "List of values definition" text area below. Within that text area I have the following query:
    SELECT DISPLAY_NAME, GROUP_ID
    FROM APPLICATION_GROUPS
    WHERE APP_ID = ?????
    ORDER BY 1
    The APP_ID that I need to reference is for the current row of data that is being processed. Therefore, I can't use a :PNNN_APP_ID variable, because that field does not exist on the page.
    Hopefully this explains it a little better.
    Thanks,
    Kris

  • Issues with selection tools using PS CS6

    OK, I'm having issues with selections in Photoshop CC…   This video shows my issue (which I never had with CS3).  Basically, I go to select an area within an image, and then the selection area disappears, and when I go to move the selection area I am unable to get the selection to "drop".  This happens regardless of whether I'm using my wacom tablet or my trackpad.  My mac is a 2009 macbook pro running 10.8.5.  Updated my OS and wacom tablet with the latest drivers.  I've gone into preferences and disabled the GPU, but to not avail.  Haven't run into this issue at work using CS6 (but i'm on a windows box there) Any ideas?  Any help would be greatly appreciated ;-) http://www.youtube.com/watch?v=FGPla7V9QI8

    say, SAKNR is 10 character field and ur appending only 6 characters, then it will give such type of errors normally.
    before inserting the data to ur Z table use function module... CONVERSION_EXIT_ALPHA_INPUT

  • Upgrade steps needed - Oracle 10g to Oracle 11g in RHEL 4

    Hello,
    Am in the process of upgrading oracle 10g with 10.1.4.3 IDM,10.1.0.5 DB and 10.1.4.2 portal version to Oracle 11g. Now I see that there are some compatibilities in the OS. I have RHEL 4 and when I check the compatibility guide I see that it is possible to install/upgrade the oracle to 11g. But am worried on the kernel and packages which is needed for Oracle 11g. If there is any step by step assistance on this please guide me. Also I have an another query can I upgrade the OS RHEL 4 to RHEL 5 and then Oracle 10g to Oracle 11g. Will I be seeing any issue after the OS upgrade with product upgrade. Kindly advise me.
    R/Ganesh

    This is all about libraries, some libraries between RHEL 4 and 5 had change and this may lead to malfunction of some products, cause they have been copiled using old libraries that doesn't exist now, even I think in the upgradres there are compatibility modes where let you keep old libraries, anyway seems a difficult thing to do. If you plan to move RHEL 4 to 5, I think this is your first step and then install again the Portal in the old version, and then make the upgrade, If you make this step by step, as firts install RHEL 5, install db, install portal, upgrade DB and finaly upgrade portal, would be easier. You may want to read the Master note for this upgrades in oracle Support 873751.1
    Greetings.

  • Upgrade Oracle 10g RAC - Oracle 11g RAC on Linux Environment

    We are planning to Upgrade our databases to Oracle 10g RAC - Oracle 11g RAC which is Linux Environment. Kindly suggest me the best option for migration. Our production database size is 80GB.
    - Frest installation of oracle 11g using export/iimport dumps
    - Migration
    - Upgrade process
    Any information regarding this will be appreciated.

    Pl identify exact versions of "10g" and "11g", along with the exact OS versions.
    Pl see the upgrade doc - http://docs.oracle.com/cd/E11882_01/server.112/e23633/toc.htm
    HTH
    Srini

  • SQL performance slow -- oracle 10g to oracle 11g

    Hi,
    We are have two development server, here we can call server10 and server11.
    Server’s having same hardware and OS, but different oracle version, server 10 and server 11 having oracle 10g and oracle 11g respectively.
    Problem, when you run sql query in oracle 11g it’s very slow compare to oracle 10g server.
    Here I have checked
    1)     sga size – comparatively 11g size is big
    2)     no full table scan
    OS – SUN
    DB: 11.1.0.7.0, 10.2.0.4.0

    mmee wrote:
    Hi,
    We are have two development server, here we can call server10 and server11.
    Server’s having same hardware and OS, but different oracle version, server 10 and server 11 having oracle 10g and oracle 11g respectively.
    Problem, when you run sql query in oracle 11g it’s very slow compare to oracle 10g server.
    Here I have checked
    1)     sga size – comparatively 11g size is big
    2)     no full table scan
    OS – SUN
    DB: 11.1.0.7.0, 10.2.0.4.0If the query is running slow, the sga size should not be the first thing to check. PLease post the execution plans of the queries from both the servers. Please try to post the tkprof output of the trace of both. The reason for this that explain plan may lie to us about what has happened but trace would be the real picture only.
    HTH
    Aman....
    PS: Don't forget to use the code tag and using the Preview tab to see how the code looks. A better formatted post would most likely get better attention and response.

  • What are the major differences between oracle 10g and oracle express 10g

    Hi
    Can anyone tell, What are the major differences between[b] oracle 10g and oracle express 10g.
    Or if you know any URL, then please do let me know.
    Advance Thanks
    JC

    Dear sir,
    here it is.
    http://www.oracle.com/database/product_editions.html

  • Difference btween oracle 10G database & oracle 11G database

    Hi
    i have a web application have 10G database engine, now i will upload it on a host server witch supports oracle 11G database.
    can i export Dump file from my Oracle10g database and import it into oracle 11G database successful.
    what can i do?
    please suggest me
    thank you

    Hi,
    Difference btween oracle 10G database & oracle 11G database Here is a complete list:
    http://www.dba-oracle.com/oracle11g/oracle_11g_new_features.htm
    can i export Dump file from my Oracle10g database and import it into oracle 11G database successful.Yes. Oracle supports backward compatibility . . .
    You mght not, however do it the other way . . .
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference"
    http://www.rampant-books.com/t_oracle_tuning_book.htm
    "Time flies like an arrow; Fruit flies like a banana".

  • Need to download a tool to make reports from Oracle 10g or Oracle 11R1

    Hello,
    need to download a tool to make reports from Oracle 10g or Oracle 11Release 1,      
    but not too well from where to download it, my system is 32 bits
    thanks

    All Oracle product downloads are available from http://download.oracle.com or http://edelivery.oracle.com
    Before going to the download site, you may want to review the available tools. Go to http://otn.oracle.com and check out the white papers and info under Products : Developer Tools

  • Will Oracle 10g and Oracle XE happily co-exist on same machine?

    I can't seem to find anything specifically saying that Oracle 10g and Oracle XE can be installed on the same Windows machine. The only reason I'd want to do this is that I originally had the free version on my Windows machine. The uninstaller nevers seems to run a complete job and always leaves bits over. So I'd like to install Oracle 10g alongside Oracle XE.
    Wondered if anybody had done this already?

    to uninstall Oracle, do the following:
    1. Uninstall all Oracle components using the Oracle Universal Installer (OUI).
    2. Run regedit.exe and delete the HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE key. This contains registry entires for all Oracle products.
    Delete any references to Oracle services left behind in the following part of the registry:
    HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Ora*
    It should be pretty obvious which ones relate to Oracle.
    4. Reboot your machine.
    5. Delete the "C:\Oracle" directory, or whatever directory is your ORACLE_BASE.
    6. Delete the "C:\Program Files\Oracle" directory.
    7. Empty the contents of your "c:\temp" directory.
    8. Empty your recycle bin.
    At this point your machine will be as clean of Oracle components as it can be.
    Remember, manually editing your registry can be very destructive and force an OS reinstall so only do it as a last resort.

  • Something´s going wrong with select distinct (Oracle 10g)

    Our database is oracle 10g release 2 and the query statement is:
    select distinct last_name
    from students;
    and the query returns all of the last_names without an specific order..
    If I execute the same query in oracle 9i the query returns all of the last_name in alphabetic order.
    Why is it different on Oracle 10g?

    See also this blog entry from Mr. Kyte.
    C.

  • Issue with Select Query in the Delivery userexit USEREXIT_SAVE_DOCUMENT

    Hi All,
    I am facing a strang issue with delivery userexit
    1) I have a delivery user exit MV50AFZ1 - USEREXIT_SAVE_DOCUMENT.
    2) In this user exit. I have written a select query as shown below
    *Get the already delivered data
        SELECT vbeln
               vgbel
               vgpos
               erdat
               erzet
               lfimg
          FROM lips
          INTO TABLE t_lips
           FOR ALL ENTRIES IN t_xlips_reference
         WHERE vgbel EQ t_xlips_reference-vgbel
           AND vgpos EQ t_xlips_reference-vgpos.
        IF sy-subrc EQ 0.
        ENDIF.
    3) The use of the above select query is to find out if there is any delivery that has already been created for the reference slaes order for which the current delivery is being created.
    4) The issue here is that for the FIRST DELIVERY, this select query should fail becuase there is no delivery created earlier and LIPS table would not have data. But, I am seeing some data getting populated in the internal table. The data that I am seeing in the internal table is the data of XLIPS which is nothing but the one that is about to get saved in the database after finishing this userexit.
    5) STRANGE Point is that this is working fine in case if I create delivery using the transaction VL01N. But, if I create delivery using VL10A program I am facing this issue.
    << Removed >>
    Thanks,
    Babu Kilari
    Edited by: Rob Burbank on Jun 16, 2010 4:22 PM

    Then why don't you add
    AND vbeln NE likp-vbeln

Maybe you are looking for

  • Problem with Video going to Movie Section of iPod. Can't Remove.

    Here's the deal: I have an iPod-friendly video I want to store in my 60GB iPod Video. I create a new playlist in iTunes and put the video(s) in that new playlist. I play them under: Main Menu > Videos > Video Playlists > *Playlist Name* > *Video Clip

  • Everytime I start to install Windows into my bootcamp partition the screen goes completely black after installing.

    Hi All, I'm using an iMac late 2009 ( Processor 3.06 GHz Intel Core 2 Duo, $gb 1067 MHz DDR3, ATI Radeon HD 4670 256 MB) with OS X 10.8. I've Boot Camped my Mac Book pro so I'm familiar with the steps to do it. I've made a partition and downloaded th

  • IP address conflict - pls help...

    Hi I get on my iMac (and also on the MacBook) sometimes the message: *Another device on the network is using your computer's IP address (10.0.0.8).* After a view seconds (and evidently a change of the IP address) Ethernet connectivity works again. Wh

  • Submitting site maps for multiple sites to Google

    I sort of glommed on to the end of the thread "meta and google-ing...i give up," but I'll start a fresh post here with this: I have three sites in iWeb, all of which have their own registered Go Daddy domain names and are forwarded to .mac without ma

  • Why won't OS 10.4  remember printer after restart?

    Ever since I upgraded from 10.3 to 10.4, my desktop computer will not remember my printer or my DLink wireless system. I have to reset my printer settings each time, and reconfigure my network/wireless settings. This occurs only on my desktop G-4, no