Sort order of german characters in SQL statements

I've a problem concerning the sort order of the german characters 'd'. 'v'. '|' in SQL statements.
Environment : Oracle Server 7.3.4
SINIX 5.43
The statement comes from an Windows application over OCI to the database.
The result of setting the NLS_SORT param to 'German' is that these characters are treated the same as 'a', 'e' and 'u', and not like 'ae', 'oe' and 'ue', as it is expected.
e.g. ascending sort order :
Bube, Bulut, B|schgens, Butza
but expected is: (| = ue)
Bube, B|schgens, Bulut, Butza
Any idea ?
Thanks for any help in advance.

If two single quotes don't work, try backslash single quote, like \'
The backslash is often used as an escape character, meaning to treat the next character literally.
- tbob
Inventor of the WORM Global

Similar Messages

  • How to handle special characters in SQL statements

    How do you handle special charactes in a SQL statement? Here is an example:
    update table
    set notefield = 'This is Waldo's note'
    where keyfield = 7;
    Because the database connectivity vi accepts a string datatype wire, the ' in Waldo's note is seen as the end of string and an error is generated.
    Is there a way to tell labview that the ' is part of the string and not the string delimiter?
    Waldo

    If two single quotes don't work, try backslash single quote, like \'
    The backslash is often used as an escape character, meaning to treat the next character literally.
    - tbob
    Inventor of the WORM Global

  • Sort order in Paragraph Catalog inconsistent / incorrect

    b Problem Description:
    Sort order of paragraph styles INCONSISTENT/INCORRECT when compared to standard alphabetical sort. From the Paragraph Catalog, or when I select F9, styles starting with "1a_" sort before styles starting with "1_". If a table with the style names is sorted, "1_" comes before "1a_".
    This sort order worked correctly in FM7.2. In FM8.x, it started sorting incorrectly. Our template was designed based on the standard sort order for characters, which somehow changed starting in FM8.x.
    b Steps to Reproduce:
    Generated a list of para styles in our template, converted to table, sorted, and compared to the Paragraph Catalog.
    b Actual Result:
    1a_Heading1_NoTOC
    b out of order
    1k_Title_Kit
    b out of order
    1_Heading1
    1_Heading1TOC
    2a_Heading2_NoTOC
    b out of order
    2_Heading2
    2_Heading2TOC
    3_Heading3
    4_Heading4
    5_Heading_RunIn
    6_Heading_Subtopic
    7a_Heading_SGD_Command
    b out of order
    7a_Heading_SGD_CommandTOC
    b out of order
    7b_Heading_ZBI_CommandTOC
    b out of order
    7b_SGD_Cmnd_Hdg_narrowTOC
    b out of order
    7_Heading_ZPL_Command
    7_Heading_ZPL_CommandLOP
    7_Heading_ZPL_CommandTOC
    8_ZPL_Function
    8_ZPL_FunctionTOC
    b Expected Result:
    Styles should sort (and used to) as follows:
    1_Heading1
    1_Heading1TOC
    1a_Heading1_NoTOC
    1k_Title_Kit
    2_Heading2
    2_Heading2TOC
    2a_Heading2_NoTOC
    3_Heading3
    4_Heading4
    5_Heading_RunIn
    6_Heading_Subtopic
    7_Heading_ZPL_Command
    7_Heading_ZPL_CommandLOP
    7_Heading_ZPL_CommandTOC
    7a_Heading_SGD_Command
    7a_Heading_SGD_CommandTOC
    7b_Heading_ZBI_CommandTOC
    7b_SGD_Cmnd_Hdg_narrowTOC
    8_ZPL_Function
    8_ZPL_FunctionTOC

    I have the same problem. I've lost track now of the number of times where I've assigned the wrong paragraph style to something since switching to FM8. The styles are no longer in the same order, so my level 1 heading is no longer the first tag that comes up when I press F9. Now I have to dig for it through other tags that start with the number 1 in our catalog.
    Our paragraph tags were developed years ago, and it wasn't until FM8 that there was a problem with the sort order. The characters no longer sort the same as Windows sorts. An underscore is supposed to come before all letters and numbers. Adobe, please fix this annoying bug!!!
    Donna Jones
    Mikado, Michigan

  • Sort order in Photo Browser

    The sort order of photos appearing in Photo Browser while in Mail has been, until recently, showing the most recent photos first.
    Today, it started showing the oldest photos first.
    Any ideas about what I did to change the order, and how I can reverse the current sort order to return to the prior state?
    I'd like to have the newest photos appear first, as they have for some time.
    Running Mail in Snow Leopard 10.6. 8.
    Many thanks for help!

    Glitchdog wrote:
    Thanks Steven,
    Ok I was only half wrong so they are in alphabetical order, but not numerical order. In the Mac finder window in list or icon view it sorts automatically in alphabetical and numerical. Question 1: Is there no way to change the sorting order in Premiere?
    I'm still living with a few projects that were shot on tape and where the previous video editor auto numbered digitized clips. Question 2: I'm not going to redigitize this project in Premiere, but for another tape based project would I be able to set up this numbering scheme you mention?
    The mac finder sorts them correctly due to an update they did to the OS a long time ago that means it recognizes 10 as coming after 9 rather than needing to put 09 for it to work. Most systems don't work that way.
    You could always download a simple batch renaming app, I think there's a few around, and just rename them with zeros in front. Would probably take you about ten minutes tops, including downloading the app.
    As for sorting them within Premiere, in list mode you just click the header of the column you want to sort by. But if you're sorting by name it will display them in the order they're currently in, because that is technically correct.

  • Not able to View generated SQL statement

    Hi,
    In order to view the generated SQL statement in Receiver JDBC Adapter,
    i have done logSQLStatement as true in  CC still not able to view in RWB,
    also mesg protocol i m using in CC is "xml sql format", is it bcos of this i am not able to ?
    If yes, then how can i see that sql string?
    Regards,
    Pratibha

    Pratibha,
    In our JDBC scenario the message protocol is also set to XML SQL Format
    The Integration Process has a mapping step of type XSL that uses an Imported Archive to create the SQL select statement.  Then there is a synchronous Send step for the JDBC component
    Both this SQL statement and the returned SQL result are available in the XML message monitor SXMB_MONI
    Regards,
    Mike

  • Group by sql statement is not sorted.

    execut sql statement include group by clause in a oci program, the result is not sorted.
    I don't know why..
    in SqlPlus, same sql statement return sorted data.
    SELECT A.SHOP_ID,A.RESALE_TYPE,
    SUM(A.DEAL_AMT,0) DEAL_AMT
    FROM SHOP_ACC A, CD_TAB C
    WHERE A.RESALE_TYPE = C.CD(+)
    AND C.GB = 'AB'
    AND A.ACC_M = :s_AccMonth
    AND DEAL_GB='FOD'
    GROUP BY A.SHOP_ID,A.RESALE_TYPE
    But, RESALE_TYPE is outer join on CD_TAB..
    if remove outer join between CD_TAB and SHOP_ACC,
    sql statement is return sorted result.
    and if modify the column RESALE_TYPE like
    RESALE_TYPE||']' or NVL(RESALE_TYPE,'AAA')
    return sorted result..
    please help..
    thanks for your kind.

    thank you.. for reply..
    I knew that order by clause make to sort.
    but, using group by clause alone in SQL statement, that return sorted results too.
    I was found a fault that outer join table CD_TAB column of one is not symbloc "(+)" in SQL statement
    SELECT A.SHOP_ID,A.RESALE_TYPE,
    SUM(A.DEAL_AMT,0) DEAL_AMT
    FROM SHOP_ACC A, CD_TAB C
    WHERE A.RESALE_TYPE = C.CD(+)
    AND C.GB = 'AB' <----------- AND C.GB(+) = 'AB'
    AND A.ACC_M = :s_AccMonth
    AND DEAL_GB='FOD'
    GROUP BY A.SHOP_ID,A.RESALE_TYPE
    I want to know that why in other application - such as SqlPlus or SqlGate and ..etc. - this fault was ignore.. but OCI application such as my application programs is not ignore.. and is not sorted..
    thank you..

  • TestStand Open SQL Statement does not support SQL's ORDER BY clause???

    TestStand 1.0.3
    Windows 2000 SP1
    SQL Server 2000 Personal
    You've got to be kidding me...
    It appears that the built-in TestStand Open SQL Step does NOT support the
    "ORDER BY" clause in the SELECT statement, even though the documentation
    says it does. Is this true?
    I have an Open SQL Statement query:
    "SELECT * FROM [MyTable] WHERE ([Batch ID]=1234)"
    it works fine, returning a correct record count 120 records. If I change
    the Open SQL Statement query simply by adding an ORDER BY clause, such as:
    "SELECT * FROM [MyTable] WHERE ([Batch ID]=1234) ORDER BY [MyField] ASC"
    it returns a record count of zero. I know that "MyField" exists in the
    MyTable table and contains valid data. The
    second query works fine in SQL
    Server Enterprise Manager.
    Am I missing something? Is it true that the TestStand Open SQL Step does
    NOT support the "ORDER BY" clause? If not, what &#$!ing good is it and why
    does the manual state it is supported? Is there any other way using just
    the TestStand steps to order a database recordset on one or more fields?
    Any help would be appreciated.
    Grrrrr....
    Bob Rafuse
    Etec Inc.

    > Bob -
    > The database step types do not do anything special to the SQL command
    > that you give it. The step just passes the command to the ADO
    > provider. I tried a simple query using the step types with the
    > following command,
    >
    > "SELECT UUT_RESULT.* FROM UUT_RESULT WHERE ([UUT_SERIAL_NUMBER] =
    > 12345) ORDER BY [EXECUTION_TIME] ASC"
    >
    > and this return the expected results and the record count parameter
    > was as expected. I tried this on TS 1.0.2 and TS 2.0 with MS Access
    > 2000 and MS SQL Server 7.0. I do not have MS SQL Server 2000 at this
    > time.
    >
    > It would be surprised if the step types are messing something up.
    I've been doing some experimenting over the past couple of days. Simple,
    one-table queries seem to handle the ORDER BY clause fine. Th
    ings seem to
    get messed up when I try multi-table queries with ORDER BY clause with the
    TestStand database steps. I get no errors but the returned record counts
    are always 0 with the ORDER BY and positive without the ORDER BY. The exact
    same queries work fine in Visual Basic/ADO and the SQL Server Query
    Analyzer.
    > Questions:
    > 1. Have you verified whether the data is actually returned even though
    > the record count is zero?
    Hmmm... yes data IS getting returned (at least on the two instances I just
    checked), but the record count is always zero. I was not proceeding with
    processing if the record count was 0.
    Still... I don't know how to loop through the recordset without knowing how
    many records there are an not eventually generate an error by passing EOF.
    Is there another way using the TestStand database steps to determine a) the
    number of records in the recordset or b) when I'm at EOF?
    > 2. Are you using any advanced options on the Opend SQL Statement step
    > type, specifically
    the cursor type set to forward only? Forward only
    > cursors do not allow for record counts.
    Everything on the Advanced tab of the Open SQL Statement step is set to "Use
    Default".
    Bob.

  • XmlAgg Order By in SQL Statement vs Stored Procedure - 9.2.0.3.0

    Hi All,
    I'm having a problem with the XMLAgg function's ORDER BY clause after upgrading to 9.2.0.3.0.
    I'm finding that I can succesfully execute a SQL statement with the XMLAgg ORDER BY clause, but cannot compile a stored procedure using ORDER BY. Below are two examples executing against the SCOTT Schema. They use the same code, except one is contained in a procedure.
    I'm running 9.2.0.3.0 on Windows XP Pro, SP1
    Plain SQL Statement (executes correctly):
    SELECT
    XMLElement("test",
    XMLAgg(
    XMLElement("element",
    XMLAttributes(Scott.Emp.Ename as "ename", Scott.Emp.Empno as "enum")
    ) --xmlElement element
    ORDER BY Scott.Emp.Ename desc
    ) --XmlAgg
    ).getClobVal() --xmlElement test
    as TestXML
    from Scott.Emp;
    Stored Procedure:
    create or replace procedure zorder(TestXML OUT clob) is
    begin
    SELECT
    XMLElement("test",
    XMLAgg(
    XMLElement("element",
    XMLAttributes(Scott.Emp.Ename as "ename", Scott.Emp.Empno as "enum")
    ) --xmlElement element
    ORDER BY Scott.Emp.Ename desc
    ) --XmlAgg
    ).getClobVal() --xmlElement test
    into TestXML
    from Scott.Emp;
    end zorder;
    I get the following errors when attempting to compile the stored procedure:
    7 PLS-00306: wrong number of types or arguments in call to 'XMLAGG'
    7 PL/SQL: ORA-00904: "XMLAGG": invalid identifier
    5 PL/SQL: SQL Statement ignored
    Does anybody know why this code executes correctly in a SQL statement, but fails in a procedure? Is the Order By clause not available in a procedure? I need to get this functionality working in the procedure.
    Thanks,
    Brian

    A good simple workaround (that doesn't require runtime parsing) is to simply sub-query:
    SELECT
    XMLElement("test",
        XMLAgg(
            XMLElement(
                "element",
                XMLAttributes(Scott.Emp.Ename as "ename", Scott.Emp.Empno as "enum")
            ) --xmlElement element
        ) --XmlAgg
    ).getClobVal() --xmlElement test
    into TestXML
    from (
        SELECT Ename,Empno
        FROM Scott.Emp
        ORDER BY Scott.Emp.Ename desc

  • 30EA2 - SQL-Developer 3.0.02 Another Table Data Sort Order Bug

    Although the "30EA1 - SQL-Developer 3.0.02 Table Data Sort Order Bug" still exists in 30EA2, there is a new substantial mistake.
    How to see it:
    Open table1 (Preference "Automatically Freeze Object Viewer Windows" is set). Click data.
    Open table2. Click data.
    Go back to table1. Click Sort. => You see the columns of table2. The is no way to sort table1, before you close the table2 window (tab).
    Edited by: oestreicher1 on 01.12.2010 04:54

    Logged Bug 10358797 - ea2: grid sorter shows wrong columns
    -Raghu

  • Urgent!  Details of english sort orders in SQL databases

    I need (for reasons that would take too long to explain and probably breach company security) to duplicate in Java (preferably a Comparator) the sorting order used by a SQL database.
    I can find lots of things telling me how to tell a database to use a sort order, but nothing will tell me exactly what that order is.
    Does anybody have a clue? And yes, we are prepared to buy books for this.

    It is probably different for each database. It can even be different for different installations of the same database if the charset can be custom set. You would need to know the specifics for the database you are working with, which the dba should know.

  • Official documents on escaping characters in SQL Server query statements

    Hi,
    Are there any official documents on how to escaping special characters in SQL Server query statements? I find a lot of online resources discussing about this, but there are no definitive conclusions on:
    Which characters should be escaped? (Some only said single-quote needs to be escaped, double-quote does not need. While others said both need to be escaped)
    How to escape characters? (Some said using two single-quote to escape a single-quote. Others said using a backslash, etc.)
    So I just wonder if there is an official document from Microsoft regarding this?
    Thanks
    Alan

    Depends on where you're using them
    If its string values then single quotes(') should be escaped by putting one more single quote before it.
    If its LIKE operator you can use ESCAPE keyword or use [] to escapre special characters 
    see
    http://visakhm.blogspot.in/2013/01/wildcard-character-based-pattern-search.html
    If inside SSIS expression you can escape characters like \ " etc by adding an extra \ before the characters
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • OCI How getting get back german characters in PM order?

    Hello,
    we are using external catalogs from  PM orders.
    It is working fine except for the german characters that are turned into # when users return to the plant maintenance orders coponent tab.
    We are using a SAP ECC 5.0, SAP Kernal 640 patch 18 (non unicode).
    Do we need to insert a line with a parameter http_content_charset?
    How do we exactly insert this line in the catalog call structure? I mean where? does it need to spelt in capitals? etc...
    I've made several tries without success.
    I would appreciate any idea.
    Thank you,
    Marie Lapierre
    AIR LIQUIDE

    Thank you Atul for your answer.
    I had read before OSS note 831959 but not yet the other one regarding MDM.
    By the way, we are using the same external catalog for both SRM and SAP ECC.
    German characters are ok in SRM, and we could face case 3 of OSS note 831959 when catalog was set to iso-8859-1.
    Now we set the catalog view only for SAP ECC to iso-8859-1 (customizing done on ctalog side) and I am wondering if I should set a parameter in the catalog call structure on ECC side to make it work....
    I've tried a parameter :
    Name : http_content_charset
    value : iso-8859-1
    But it didn't work.
    Do you have any example of a call structure with this parameter?
    Thank you.
    Regards,
    Marie Lapierre

  • Sort order in Java application (oc4j container) -- ear file deployment

    I have a Java application deploy in Oracle OC4J container (EAR file).
    In my Java application (jsp), I have a SQL statement who return data but the
    sort order is wrong. The letters "é" and all characters with accents
    appears at the end of the result.
    I tried many things to change the sort order (NLS parameters in database
    and OAS10g parameter files).
    When I use SQL*plus on database server, that's working.
    The sort order is wrong when I use the java application.
    Somebody can tell me what and where is the NLS parameters to change ?
    Thanks
    Robin

    Robin,
    I'm only guessing, but it could either be related to the java locale or the CHARSET attribute of the HTML header -- and nothing to do with the NLS parameters.
    Maybe you should try the Globalization Support forum?
    Good Luck,
    Avi.

  • Sort order in Java Application (deploy in Oracle oc4j container)

    I have a Java application deploy in Oracle OC4J container (EAR file).
    In my Java application (jsp), I have a SQL statement who return data but the
    sort order is wrong. The letters "é" and all characters with accents
    appears at the end of the result.
    I tried many things to change the sort order (NLS parameters in database
    and OAS10g parameter files).
    When I use SQL*plus on database server, that's working.
    The sort order is wrong when I use the java application.
    Somebody can tell me what and where is the NLS parameters to change ?
    Thanks
    Robin

    Robin,
    I'm only guessing, but it could either be related to the java locale or the CHARSET attribute of the HTML header -- and nothing to do with the NLS parameters.
    Maybe you should try the Globalization Support forum?
    Good Luck,
    Avi.

  • HOW TO: Post a SQL statement tuning request - template posting

    This post is not a question, but similar to Rob van Wijk's "When your query takes too long ..." post should help to improve the quality of the requests for SQL statement tuning here on OTN.
    On the OTN forum very often tuning requests about single SQL statements are posted, but the information provided is rather limited, and therefore it's not that simple to provide a meaningful advice. Instead of writing the same requests for additional information over and over again I thought I put together a post that describes how a "useful" post for such a request should look like and what information it should cover.
    I've also prepared very detailed step-by-step instructions how to obtain that information on my blog, which can be used to easily gather the required information. It also covers again the details how to post the information properly here, in particular how to use the \ tag to preserve formatting and get a fixed font output:
    http://oracle-randolf.blogspot.com/2009/02/basic-sql-statement-performance.html
    So again: This post here describes how a "useful" post should look like and what information it ideally covers. The blog post explains in detail how to obtain that information.
    In the future, rather than requesting the same additional information and explaining how to obtain it, I'll simply refer to this HOW TO post and the corresponding blog post which describes in detail how to get that information.
    *Very important:*
    Use the \ tag to enclose any output that should have its formatting preserved as shown below.
    So if you want to use fixed font formatting that preserves the spaces etc., do the following:
    \   This preserves formatting
    \And it will look like this:
       This preserves formatting
       . . .Your post should cover the following information:
    1. The SQL and a short description of its purpose
    2. The version of your database with 4-digits (e.g. 10.2.0.4)
    3. Optimizer related parameters
    4. The TIMING and AUTOTRACE output
    5. The EXPLAIN PLAN output
    6. The TKPROF output snippet that corresponds to your statement
    7. If you're on 10g or later, the DBMS_XPLAN.DISPLAY_CURSOR output
    The above mentioned blog post describes in detail how to obtain that information.
    Your post should have a meaningful subject, e.g. "SQL statement tuning request", and the message body should look similar to the following:
    *-- Start of template body --*
    The following SQL statement has been identified to perform poorly. It currently takes up to 10 seconds to execute, but it's supposed to take a second at most.
    This is the statement:
    select
    from
             t_demo
    where
             type = 'VIEW'
    order by
             id;It should return data from a table in a specific order.
    The version of the database is 11.1.0.7.
    These are the parameters relevant to the optimizer:
    SQL>
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_capture_sql_plan_baselines boolean     FALSE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      11.1.0.7
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    optimizer_use_invisible_indexes      boolean     FALSE
    optimizer_use_pending_statistics     boolean     FALSE
    optimizer_use_sql_plan_baselines     boolean     TRUE
    SQL>
    SQL> show parameter db_file_multi
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     8
    SQL>
    SQL> show parameter db_block_size
    NAME                                 TYPE        VALUE
    db_block_size                        integer     8192
    SQL>
    SQL> show parameter cursor_sharing
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACT
    SQL>
    SQL> column sname format a20
    SQL> column pname format a20
    SQL> column pval2 format a20
    SQL>
    SQL> select
      2             sname
      3           , pname
      4           , pval1
      5           , pval2
      6  from
      7           sys.aux_stats$;
    SNAME                PNAME                     PVAL1 PVAL2
    SYSSTATS_INFO        STATUS                          COMPLETED
    SYSSTATS_INFO        DSTART                          01-30-2009 16:25
    SYSSTATS_INFO        DSTOP                           01-30-2009 16:25
    SYSSTATS_INFO        FLAGS                         0
    SYSSTATS_MAIN        CPUSPEEDNW              494,397
    SYSSTATS_MAIN        IOSEEKTIM                    10
    SYSSTATS_MAIN        IOTFRSPEED                 4096
    SYSSTATS_MAIN        SREADTIM
    SYSSTATS_MAIN        MREADTIM
    SYSSTATS_MAIN        CPUSPEED
    SYSSTATS_MAIN        MBRC
    SYSSTATS_MAIN        MAXTHR
    SYSSTATS_MAIN        SLAVETHR
    13 rows selected.Here is the output of EXPLAIN PLAN:
    SQL> explain plan for
      2  -- put your statement here
      3  select
      4             *
      5  from
      6             t_demo
      7  where
      8             type = 'VIEW'
      9  order by
    10             id;
    Explained.
    Elapsed: 00:00:00.01
    SQL>
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    60 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |     1 |    60 |     0   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    14 rows selected.Here is the output of SQL*Plus AUTOTRACE including the TIMING information:
    SQL> rem Set the ARRAYSIZE according to your application
    SQL> set autotrace traceonly arraysize 100
    SQL> select
      2             *
      3  from
      4             t_demo
      5  where
      6             type = 'VIEW'
      7  order by
      8             id;
    149938 rows selected.
    Elapsed: 00:00:02.21
    Execution Plan
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    60 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |     1 |    60 |     0   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    Statistics
              0  recursive calls
              0  db block gets
         149101  consistent gets
            800  physical reads
            196  redo size
        1077830  bytes sent via SQL*Net to client
          16905  bytes received via SQL*Net from client
           1501  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
         149938  rows processed
    SQL>
    SQL> disconnect
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsThe TKPROF output for this statement looks like the following:
    TKPROF: Release 11.1.0.7.0 - Production on Mo Feb 23 10:23:08 2009
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: orcl11_ora_3376_mytrace1.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    select
    from
             t_demo
    where
             type = 'VIEW'
    order by
             id
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch     1501      0.53       1.36        800     149101          0      149938
    total     1503      0.53       1.36        800     149101          0      149938
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 88 
    Rows     Row Source Operation
    149938  TABLE ACCESS BY INDEX ROWID T_DEMO (cr=149101 pr=800 pw=0 time=60042 us cost=0 size=60 card=1)
    149938   INDEX RANGE SCAN IDX_DEMO (cr=1881 pr=1 pw=0 time=0 us cost=0 size=0 card=1)(object id 74895)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                    1501        0.00          0.00
      db file sequential read                       800        0.05          0.80
      SQL*Net message from client                  1501        0.00          0.69
    ********************************************************************************The DBMS_XPLAN.DISPLAY_CURSOR output:
    SQL> -- put your statement here
    SQL> -- use the GATHER_PLAN_STATISTICS hint
    SQL> -- if you're not using STATISTICS_LEVEL = ALL
    SQL> select /*+ gather_plan_statistics */
      2  *
      3  from
      4  t_demo
      5  where
      6  type = 'VIEW'
      7  order by
      8  id;
    149938 rows selected.
    Elapsed: 00:00:02.21
    SQL>
    SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  d4k5acu783vu8, child number 0
    select   /*+ gather_plan_statistics */          * from          t_demo
    where          type = 'VIEW' order by          id
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT            |          |      1 |        |    149K|00:00:00.02 |     149K|   1183 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |      1 |      1 |    149K|00:00:00.02 |     149K|   1183 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |      1 |      1 |    149K|00:00:00.02 |    1880 |    383 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    20 rows selected.I'm looking forward for suggestions how to improve the performance of this statement.
    *-- End of template body --*
    I'm sure that if you follow these instructions and obtain the information described, post them using a proper formatting (don't forget about the \ tag) you'll receive meaningful advice very soon.
    So, just to make sure you didn't miss this point:Use proper formatting!
    If you think I missed something important in this sample post let me know so that I can improve it.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Alex Nuijten wrote:
    ...you missed the proper formatting of the Autotrace section ;-)Alex,
    can't reproduce, does it still look unformatted? Or are you simply kidding? :-)
    Randolf
    PS: Just noticed that it actually sometimes doesn't show the proper formatting although the code tags are there. Changing to the \ tag helped in this case, but it seems to be odd.
    Edited by: Randolf Geist on Feb 23, 2009 11:28 AM
    Odd behaviour of forum software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for