XMLTABLE returns only first line

I now XML inserted in the column named as TEXT in the MASTERTB table.

* <? XML version = "1.0" encoding = "utf-8"? > *.
"< * Rowsets DateCreated =" "2010-11 - 30 T 11: 12:10" EndDate = "2010-06 - 05 T 16: 52:23 ' StartDate =" "2010-06 - 05 T 16: 52:23" Version = "Build 12.0.10 (18)" > * "
* < Rowset > *.
* < columns > *.
* < Description = "Material number" column MaxRange = '1' MinRange = '0' Name = 'MATERIAL' = '1' = 'MATERIAL' SourceColumn SQLDataType / > *.
* < column Description = "" MaxRange = '1' MinRange = '0' Name = 'TANK' = '1' = 'TANK' SourceColumn SQLDataType / > * "
* < / columns > *.
* < row >. *
* < MATERIAL > 1000000144 < / EQUIPMENT > *.
* < T1000 TANK > < / TANK > *.
* < / row > *.
* < row >. *
* < MATERIAL > 2000000008 < / EQUIPMENT > *.
* < T1000 TANK > < / TANK > *.
* < / row > *.
* < row >. *
* < MATERIAL > 2000000009 < / EQUIPMENT > *.
* < T1000 TANK > < / TANK > *.
* < / row > *.
* < row >. *
* < MATERIAL > 2000000016 < / EQUIPMENT > *.
* < T1000 TANK > < / TANK > *.
* < / row > *.
* < row >. *
* < MATERIAL > 3000000036 < / EQUIPMENT > *.
* < T1000 TANK > < / TANK > *.
* < / row > *.
* < / lines > *.
* < / sets of lines > *.

Now my requirement is to get all material values, so when I run the following question in Oracle,.

SELECT RW. MATERIAL
OF MASTERTB TM,.
XMLTable ('/ / row ' PASSAGE TM.) TEXT
COLUMNS "MATERIAL" CHAR (30) PATH 'MATERIAL') AS RW

He returned only 1000000144 (RAW material). How can I read all the MATERIAL? In addition, how to read the XML all in text format if I want to check what has been inserted?

Any help will be appreciated!

Edited by: 967327 October 27, 2012 12:28

Do you know how I can see that XML is stored in the TEXT column in the MASTERTB, because when I d select * from MASTERTB, it just gives me "-" in the column of TEXT. Somehow the statement select is not capable of converting XMLTYPE chain. So can you help me to retrieve the whole XML stored in the column of TEXT.

You have access to another customer tool Oracle like SQL * Plus or SQL Developer?
It would be useful to test your queries on one of those to the first rule of any problem in the database.

Regarding your question on the extraction of all the XML content, the answer depends on the version of database, that you don't mention.

Before 11 g, use the getClobVal (or getStringVal):

SELECT tm.text.getClobVal()
FROM MASTERTB tm

The foregoing is deprecated in 11.2, so if you're on 11g:

SELECT XMLSerialize(document tm.text)
FROM MASTERTB tm

http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb13gen.htm#ADXDB5033

Tags: Oracle Development

Similar Questions

  • Dynamic table returns only a line

    Hello world

    I try to use a Recordset:

    "SOME concerts. EventDate, concerts. Location, concerts. Notes

    CONCERTS

    WHERE the concerts. "EventDate > = CURRENT_DATE.

    When I test the Recordset, I get 3 of the 5 records returned, which is exactly as it should.

    However, when I try to create a dynamic table to display the results - if I choose to show all records, or the default of 10 at a time, it shows the first line results from the Recordset.

    When I try to create a master-detail table and ask him to show one record at a time, it's there for that, but using the next/back navigation links, it takes me to other records, though one at a time.  That tells me that he doesn't know that there should be three records, but it only shows one.

    What am I doing wrong with the dynamic table, here?

    Thank you!

    I suggest that you start the page completely from scratch, because it seems that you made the rookie mistake classic to remove a dynamic object in Design view without realizing that any other PHP code is connected with it. When you work with dynamic objects, keep an eye on what is listed in the server behaviors panel. To remove a server behavior, select the referencing in the Panel and click the button "-" to remove it properly.

    In fact, you have two sets of records on the same page, that do the same thing. One is called to come, the other is called UpcomingShows. You get only a line showing in your table is because you use the recordset "to come". The Dreamweaver recordset code automatically retrieves the first record and then uses a do... while loop to create the region repeated in the table. What has happened is that your changes to the page have resulted in this line who appear before the repeat region:

    mysql_free_result($upcoming);
    

    This destroys the rest of the result of database before using it again. Therefore, only trace never appears.

    Dreamweaver always puts mysql_free_result() after the closing tag. Thus, it seems that your changes caused Dreamweaver to lose track of all the relevant parts of the server behavior. If you move this line to the bottom of the page, your table should work. However, as I said before, I think that it is better to start from scratch.

    One last thing: your SQL query contains the following WHERE clause:

    WHERE gigs.EventDate >= CURRENT_DATE
    

    It is an incorrect syntax for MySQL. It should be like this:

    WHERE gigs.EventDate >= CURRENT_DATE()
    

    CURRENT_DATE() is a MySQL function, not a constant.

    If all goes well, a little less head banging.

  • Retrieve only first line that satisfy the condition

    Hello

    I have the following table

    create the table authabs as

    (

    Select 1 empid, 100 absmins, would be "type of Union double all the"

    Select 1 empid, 200 absmins, type 'P' of all the double union

    Select 2 empid, 300 absmins, would be "type of Union double all the"

    Select 3 empid, 400 absmins, would be "the double type

    );

    The following query returns two rows.

    Select * from authabs where empid = 1;

    But I want to just go back to a row (in top or one of the lines).

    I use oracle 10 g

    Help, please

    Using rownum...

    Select * from authabs where empid = 1 and rownum = 1;

    For reference the Rownum!

    https://docs.Oracle.com/CD/B28359_01/server.111/b28286/pseudocolumns009.htm#SQLRF00255

  • Return the first line with a non-null value in a column

    Hey there, gurus. Can someone give me a hand with this?

    I have a table with six columns: Class_ID, Course_ID, start_date, Last_Name, First_Name, company. When our students take a class and will fill in an evaluation form, they fill in the Class_ID Last_Name First_Name, and Company. The Course_ID and Start_Date are filled automatically based on the Class_ID.

    I am trying to generate a report that contains Class_ID, Course_ID and Start_Date, PLUS the value of the first not null in the column of company for a combination given to the three first columns. Here is my SQL that does not quite do the trick:

    Select distinct c.class_id, c.course_id, c.start_date, p.company
    class c, person p, student s
    where substr (c.course_id, 1, 3) = "OBI".
    and c.start_date > = SYSDATE-30
    and c.class_id = s.class_id
    and s.pid = p.pid
    order start_date, company, class_id, course_id

    At present, if in a given class, a student entered "CCCC" under the name of the company and another entry "Collin Co Comm Coll" and another between "Collin College", I would get three rows of this class when you use the SQL above. I want just one line. I don't really like which company names gets selected - one of them will be great for our needs. I just need to see a line for each class_id and single value that some students entered the area of the company. And I guess I have to say that if no student fills in the name of the company I need to see the value null, because I need to see the line no matter what.

    Looks like some sort of funky outer join or a coalesce, but it is beyond my ability to understand.

    Now I get this:
    During class 1234 SQL271 Date 22/07/2013 company XYZ Inc.
    Made up of class 1234 SQL271 Date 22/07/2013 company XYZ
    1234 SQL271 Date 22/07/2013 company XYZ, class

    What I want:
    Class 1234 SQL271 22/07/2013 Date course XYZ Inc. or one of the other 2

    Thanks in advance!
    select c.class_id, c.course_id, c.start_date, max(p.company) company
    from class c, person p, student s
    where substr(c.course_id,1,3) = 'OBI'
    and c.start_date >= SYSDATE-30
    and c.class_id = s.class_id
    and s.pid = p.pid
    group by c.class_id, c.course_id, c.start_date
    order by class_id, start_date, course_id
    

    Or if you want to list all businesses, you can use LISTAGG if you're on the latest version of ORACLE

  • SQL to return the first line

    Hello guys,.

    I use a sql to sort a single column of a specific sort order, I need just the first returned row based on ID (doc_no) here is an example:
    SQL> WITH 
      2  table_a AS (
      3  SELECT 1 doc_no, 'Description of 1' doc_desc FROM DUAL UNION ALL
      4  SELECT 2, 'Description of 2' FROM DUAL),
      5  table_b AS (
      6  SELECT 1 fk_doc_no, 'A' client_rev, TO_DATE ('10/10/2008', 'dd/mm/yyyy') due_date, 
      7   TO_DATE ('10/10/2008', 'dd/mm/yyyy') trans_date FROM DUAL UNION ALL
      8  SELECT 1, 'B', TO_DATE ('05/11/2008', 'dd/mm/yyyy'), TO_DATE ('05/11/2008', 'dd/mm/yyyy') FROM DUAL UNION ALL
      9  SELECT 1, '0', NULL, TO_DATE ('21/11/2008', 'dd/mm/yyyy') FROM DUAL UNION ALL
     10  SELECT 2, 'A', TO_DATE ('25/11/2008', 'dd/mm/yyyy'), TO_DATE ('25/11/2008', 'dd/mm/yyyy') FROM DUAL UNION ALL
     11  SELECT 2, '0', NULL, TO_DATE ('25/11/2008', 'dd/mm/yyyy') FROM DUAL)
     12  SELECT x.doc_no, x.doc_desc, y.last_client_rev, y.due_date, y.trans_date
     13  FROM (SELECT   fk_doc_no,
     14                 MAX (client_rev) KEEP
     15                   (DENSE_RANK LAST ORDER BY TRANSLATE(client_rev
     16                                                       ,'ABCD012' -- Desired sort order
     17                                                       ,'012ABCD' -- Actual sort order
     18                                                      )) AS last_client_rev,
     19                 due_date, trans_date
     20            FROM table_b
     21        GROUP BY fk_doc_no, due_date, trans_date) y,
     22       table_a x
     23  WHERE x.doc_no = y.fk_doc_no;
    The result is:
        DOC_NO DOC_DESC         L DUE_DATE TRANS_DA
    ---------- ---------------- - -------- --------
             1 Description of 1 0          21/11/08
             1 Description of 1 A 10/10/08 10/10/08
             1 Description of 1 B 05/11/08 05/11/08
             2 Description of 2 0          25/11/08
             2 Description of 2 A 25/11/08 25/11/08
    The required data will be:
        DOC_NO DOC_DESC         L DUE_DATE TRANS_DA
    ---------- ---------------- - -------- --------
             1 Description of 1 0          21/11/08
             2 Description of 2 0          25/11/08
    Can you help me with this?

    Best regards.
    BTW: I use Oracle 10 g

    Hello
    You don't need a subquery

    SELECT   fk_doc_no, doc_desc,
             MAX (client_rev)KEEP (DENSE_RANK LAST ORDER BY TRANSLATE
                                                  (client_rev,
                                                   'ABCD012' -- Desired sort order
                                                            ,
                                                   '012ABCD'  -- Actual sort order
                                                  )) AS last_client_rev,
             MAX (due_date)KEEP (DENSE_RANK LAST ORDER BY TRANSLATE
                                                  (client_rev,
                                                   'ABCD012' -- Desired sort order
                                                            ,
                                                   '012ABCD'  -- Actual sort order
                                                  ),
              trans_date) due_date,
             MAX (trans_date)KEEP (DENSE_RANK LAST ORDER BY TRANSLATE
                                                  (client_rev,
                                                   'ABCD012' -- Desired sort order
                                                            ,
                                                   '012ABCD'  -- Actual sort order
                                                  )) trans_date
        FROM table_a x, table_b y
       WHERE x.doc_no = y.fk_doc_no
    GROUP BY y.fk_doc_no, doc_desc
    
    SQL> WITH table_a AS
      2       (SELECT 1 doc_no, 'Description of 1' doc_desc
      3          FROM DUAL
      4        UNION ALL
      5        SELECT 2, 'Description of 2'
      6          FROM DUAL),
      7       table_b AS
      8       (SELECT 1 fk_doc_no, 'A' client_rev,
      9               TO_DATE ('10/10/2008', 'dd/mm/yyyy') due_date,
     10               TO_DATE ('10/10/2008', 'dd/mm/yyyy') trans_date
     11          FROM DUAL
     12        UNION ALL
     13        SELECT 1, 'B', TO_DATE ('05/11/2008', 'dd/mm/yyyy'),
     14               TO_DATE ('05/11/2008', 'dd/mm/yyyy')
     15          FROM DUAL
     16        UNION ALL
     17        SELECT 1, '0', NULL, TO_DATE ('21/11/2008', 'dd/mm/yyyy')
     18          FROM DUAL
     19        UNION ALL
     20        SELECT 2, 'A', TO_DATE ('25/11/2008', 'dd/mm/yyyy'),
     21               TO_DATE ('25/11/2008', 'dd/mm/yyyy')
     22          FROM DUAL
     23        UNION ALL
     24        SELECT 2, '0', NULL, TO_DATE ('25/11/2008', 'dd/mm/yyyy')
     25          FROM DUAL)
     26  SELECT   fk_doc_no, doc_desc,
     27           MAX (client_rev)KEEP (DENSE_RANK LAST ORDER BY TRANSLATE
     28                                                (client_rev,
     29                                                 'ABCD012' -- Desired sort order
     30                                                          ,
     31                                                 '012ABCD'  -- Actual sort order
     32                                                )) AS last_client_rev,
     33           MAX (due_date)KEEP (DENSE_RANK LAST ORDER BY TRANSLATE
     34                                                (client_rev,
     35                                                 'ABCD012' -- Desired sort order
     36                                                          ,
     37                                                 '012ABCD'  -- Actual sort order
     38                                                ),
     39            trans_date) due_date,
     40           MAX (trans_date)KEEP (DENSE_RANK LAST ORDER BY TRANSLATE
     41                                                (client_rev,
     42                                                 'ABCD012' -- Desired sort order
     43                                                          ,
     44                                                 '012ABCD'  -- Actual sort order
     45                                                )) trans_date
     46      FROM table_a x, table_b y
     47     WHERE x.doc_no = y.fk_doc_no
     48  GROUP BY y.fk_doc_no, doc_desc
     49  /
    
     FK_DOC_NO DOC_DESC         L DUE_DATE   TRANS_DATE
    ---------- ---------------- - ---------- ----------
             1 Description of 1 0            2008-11-21
             2 Description of 2 0            2008-11-25
    
    SQL> 
    

    Published by: Salim champion 2009-01-26 06:47

  • First line is repeting while accessing several lines by database fits

    Hello

    IAM using the card database in the BPEL process to recover data from a remote database. Database adapter, I chose select operation and passing the input parameter.

    In fact this adapter should return 10 lines although variable output of this card.

    Its lines with 10, but the first line is repeting 10 times.


    IAM not able to get 10 rows.only first line is repeting.

    Please help me in this.

    Thanks in advance

    Hello

    In the DbAdapter Assistant you can see the SQL query with the parameter that you added.
    Can you run on your DB and see if you get the required results?
    In addition, you defined a primery key?

    Arik

  • Discover with function as datasource returns only the first line.

    Hello

    I created the following function to get the status of all the rules for the instances of SQL Server.

    The data type of the function output has been configured as 'List of SQLInstanceRuleStatuss', where SQLInstanceRuleStatuss is the custom type, I created in the same module.

    When I tested the function, it returns all instances of SQL Server with two other columns.

    But when I try to create a view with the Rows property that is configured to use the feature, it returns only the first line:

    sqlRules = new ArrayList();

    queryStatement = server. QueryService.createStatement ("(DBSS_Instance)");

    queryResult = server. QueryService.executeStatement (queryStatement);

    for (it in queryResult.topologyObjects)

    {

    sqlRule is functionHelper.createDataObject ("westjet_mark_dev:SQLInstanceRuleStatus", "none", "test");.

    sqlRule.instance = it;

    sqlRule.ruleName = 'test rule name';

    sqlRule.status = false;

    sqlRules.add (sqlRule);

    }

    Return sqlRules;

    Did I miss something?

    Thank you

    Mark

    Mark,

    I think I forgot something

    sqlRule=functionHelper.createDataObject("westjet_mark_dev:SQLInstanceRuleStatus","none","test");

    you create the test id

    change your line of

    sqlRule=functionHelper.createDataObject("westjet_mark_dev:SQLInstanceRuleStatus","none",null);

    This should allow the creation of a single object in your loop for

  • Foreach returns only the first line of a dataset object

    Hello, guys.

    I am having trouble with a procedure in Oracle 9.2.0.1.0.

    I have a query that returns the number of lines, but whenever I try to browse by using a foreach loop, I only get the first line and then the loop is completed.

    For example, here's the query:

    select 
          (
            CASE
              WHEN
                TO_DATE(
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'dd') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'mm') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'yyyy'),'DD/MM/YYYY') < DATE '2009-01-01'
              THEN DATE '2009-01-01'
              ELSE
                TO_DATE(
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'dd') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'mm') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'yyyy'), 'DD/MM/YYYY')
              END
          ) startdate,
    
    
          (
            CASE
              WHEN
              TO_DATE(
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level) -1,'dd') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'mm') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'yyyy'),'DD/MM/YYYY') > DATE '2009-06-08'
              THEN DATE '2009-06-08'
              ELSE 
              TO_DATE(
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level) -1,'dd') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'mm') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'yyyy'), 'DD/MM/YYYY')
              END
          ) enddate
         
        FROM dual
        CONNECT by trunc(DATE '2009-06-08','dd') >= add_months(trunc(DATE '2009-01-01','dd'),level - 1)
    

    Who shows me this output:

    STARTDATEENDDATE
    01/01/20092009-01-31
    02/01/200928/02/2009
    03/01/200931/03/2009
    04/01/200930/04/2009
    05/01/200931/05/2009
    06/01/200906/08/2009

    But whenever I run this code:

      for rec in
      (
        select 
          (
            CASE
              WHEN
                TO_DATE(
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'dd') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'mm') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'yyyy'),'DD/MM/YYYY') < DATE '2009-01-01'
              THEN DATE '2009-01-01'
              ELSE
                TO_DATE(
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'dd') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'mm') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'yyyy'), 'DD/MM/YYYY')
              END
          ) startdate,
          (
            CASE
              WHEN
              TO_DATE(
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level) -1,'dd') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'mm') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'yyyy'),'DD/MM/YYYY') > DATE '2009-06-08'
              THEN DATE '2009-06-08'
              ELSE 
              TO_DATE(
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level) -1,'dd') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'mm') || '/' ||
                to_char(add_months(trunc(DATE '2009-01-01','mm'),level - 1),'yyyy'), 'DD/MM/YYYY')
              END
          ) enddate
         
        FROM dual
        CONNECT by trunc(DATE '2009-06-08','dd') >= add_months(trunc(DATE '2009-01-01','dd'),level - 1)    
      )
      loop
        DBMS_OUTPUT.put_line(TO_CHAR(rec.startdate, 'YYYYMMDD') || '-' || TO_CHAR(rec.enddate, 'YYYYMMDD'));
      end loop;
    

    I get this result:

    20090131 20090101

    I tried debugging and I checked that the loop runs that once, and then passes the end of loop. I'm doing something wrong?

    Thank you!

    Best regards

    Vinicius

    Try:

    for rec in

    (

    Select * from (select

    (

    CASE

    WHEN

    TO_DATE)

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), "jj"). '/' ||

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), "mm"). '/' ||

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), 'yyyy'), "DD/MM/YYYY")< date="">

    THEN DAY ' 2009-01-01'

    ON THE OTHER

    TO_DATE)

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), "jj"). '/' ||

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), "mm"). '/' ||

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), 'yyyy'), "DD/MM/YYYY")

    END

    ) startdate.

    (

    CASE

    WHEN

    TO_DATE)

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm') and level)-1, "dd"). '/' ||

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), "mm"). '/' ||

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), 'yyyy'), ' DD/MM/YYYY') > DATE '' 2009-06-08

    THEN DAY '' 2009-06-08

    ON THE OTHER

    TO_DATE)

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm') and level)-1, "dd"). '/' ||

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), "mm"). '/' ||

    TO_CHAR (add_months (trunc (DATE ' 2009-01-01', 'mm'), level - 1), 'yyyy'), "DD/MM/YYYY")

    END

    ) enddate

    OF the double

    CONNECT by trunc (DATE 2009-06 - 08 ',' dd') > = add_months (trunc (DATE 2009-01 - 01 ',' dd'), level - 1)

    )   )

    loop

    Dbms_output.put_line (TO_CHAR (rec.startdate, 'YYYYMMDD') |) '-' || To_char (rec.enddate, 'YYYYMMDD'));

    end loop;

    SY.

  • Scan of a file only works on the first line

    Hello

    I'm new to Labview (see 8.6) and I'm running on this problem.

    I use the Scan of a file to get a certain amount of information for the installation of test.txt.  The data of the file looks like this:

    AAA 1

    BBB 2

    REC 3

    I noticed that the Scan of the file works for only the first line.  Trying to get data that are not in the first line results in an error 85.

    Any ideas? Thank you

    It's all in what the scan of the file reads, and what is the next cgaracter in the file.

    Your first analysis of the file reads up to but NOT including the first newline in the file.

    The second read readings where the first reading was arrested and is expected to see 'B' as the next character, but sees the new line instead, and if the analysis fails. You must specify second reading formatted to await the return line.

    You can do this by making the FIRST character of the format string space, that will tell it to expect a number any of charaters 'white space '.

    Yo can indeed put a space at the beginning of the format string in your first analysis of the file and it will match with zero white space characters before you see the AAA. By doing this he also tolerate to see the spaces and tabs before your AAA or BBB identifiers.

    Rod.

  • Using of "get the N first lines only" does / * + FIRST_ROWS ([N]) * / redundant index?

    I know FIRST_ROWS indicator shows the optimizer to minimize the time of the first row.  I know that the new feature of 12 c for "fetch [FIRST |]» [NEXT] [N] LINES [ONLY |] WITH LINKS] "get first/next N lines only / with ties" will implement the query using ROW_NUMBER().  Should I leave hint in case it improves performance, or the clause FETCH FIRST made this redundant suspicion?

    Hi Wes and Hoek,

    Oracle said on the indicators in the 12 c setting guide. Each version of this statement becomes stronger.

    The disadvantage of the advice is additional code that you must manage, audit and control. Tips have been introduced in Oracle7, when users have little recourse if the optimizer generated suboptimal plans. Because changes in the database and host environment can make obsolete tips or negative consequences, it is a good practice to test the use of indicators, but use other techniques to manage the execution plans.

    Oracle provides several tools, including how to set up SQL, SQL plan management and SQL Performance Analyzer to solve performance problems unresolved by the optimizer. Oracle strongly recommends that you use these tools instead of advice because they provide new solutions like the change of environment data and database.

    Oracle presents advice in V7, basically as an admission that its optimizer based on CSSTidy based cost did not get things right all the time and tried to get rid of them since. In addition, the preferred method of setting when you are browsing the major updates was to review advice to remove them. It will be interesting to what extent can it be pushed in V12.

    In what concerns the first lines index and ROWNUM limiting, unless you just try to get the garbage data, it's meaningless without the presence of an ORDER BY. Once you have an ORDER BY, the query must retrieve all the data before it can return anything. The exception to this rule is if there is an index that the database can use to retrieve already ordered data, that is to say on the order of columns. Therefore, the essence of the indication of FIRST LINES. It will be aggressive looking in the index in favor if the index is in line with the order of. (Try the setting of a SIEBEL instance if you need proof)

    I don't have a 12 c to test at the moment, but looking at the examples of Martin, it appears the optimizer is aware of the new windowing function in the new FETCH FIRST/NEXT structure and selects a plan that gives the best answer. If you go through the effort to review suggested rownum limited requests to remove the tips if possible, maybe you should just rewrite with new windowing function.

    Concerning

    André

  • My indicator shows only the first line of the string

    Hi all

    I'm having some trouble with chains, could you help me?

    I use a device connected to my computer in a RS-232 port.

    I configured the VISA series correctly. When I write a command to my device, the answer is something like this:

    "XXXXX."

    YYYYYY

    2222

    44444

    WWWW.

    The problem is when I try to read this response. The channel indicator shows only one line at a time every single loop. And the other orders received are stored in the buffer until their time to be displayed to come. I mean:

    In the first loop device XXXXX responses.

    In the second loop the device responds YYYYYY but now I stored what must appear:

    2222

    44444

    WWWW

    XXXXX

    YYYYYY

    2222

    44444

    WWWW

    In the third loop, the device responds 2222 and stores again:

    44444

    WWWW

    XXXXX

    YYYYYY

    2222

    44444

    WWWW

    XXXXX

    YYYYYY

    2222

    44444

    WWWW

    How can I configure my blocks to display the full string?

    Thank you

    Murilo

    Post your code and we can better understand what is happening.

    My first is however you spend only the corrent, reading of the indicator.

    You use a chain shift reg with a knot to concatenate a String?

    Your zip code and we'll have a glance.

  • sent letter drafts in hotmail, went back to send and only the first line of the text was visible, have been if the rest went, and how do I get that back

    typed a letter and drafts in hotmail, whent sent to retrieve to send and only got the first line of text back.

    Hotmail forums:

    http://www.windowslivehelp.com/forums.aspx?ProductID=1

    They will help you when repost you your question in the Forums above for Hotmail.

    See you soon

    Mick Murphy - Microsoft partner

  • Mr President, how can I enter two rows at the same time with different default values that only the first line to use see?

    Mr President.

    My worm jdev is 12.2.1

    How to enter two rows at the same time with different default values that only the first line to use see?

    Suppose I have a table with four fields as below

    "DEBIT" VARCHAR2(7) , 
      "DRNAME" VARCHAR2(50),
      "CREDIT" VARCHAR2(7) , 
      "CRNAME" VARCHAR2(50),
    

    Now I want that when I click on a button (create an insert) to create the first line with the default values below

    firstrow.png

    So if I click on the button and then validate the second row with different values is also inserted on commit.

    The value of the second row are like the picture below

    tworows.png

    But the second row should be invisible. It could be achieved by adding vc in the vo.

    The difficult part in my question is therefore, to add the second row with the new default values.

    Because I already added default values in the first row.

    Now how to add second time default values.

    Concerning

    Mr President

    I change the code given by expensive Sameh Nassar and get my results.

    Thanks once again dear Sameh Nassar .

    My code to get my goal is

    First line of code is

        protected void doDML(int operation, TransactionEvent e) {    
    
            if(operation != DML_DELETE)
                 {
                     setAmount(getPurqty().multiply(getUnitpurprice()));
                 } 
    
            if (operation == DML_INSERT )
                       {
                               System.out.println("I am in Insert with vid= " + getVid());
                           insertSecondRowInDatabase(getVid(),getLineitem(),"6010010","SALES TAX PAYABLE",
                            (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                           }
    
            if(operation == DML_UPDATE)
                              {                                                    
    
                                 System.out.println("I am in Update with vid= " + getVid());
                             updateSecondRowInDatabase(getVid(),
                                 (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                              }                      
    
            super.doDML(operation, e);
        }
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "Insert into vdet (VID,LINEITEM,DEBIT,DRNAME,AMOUNT) values " +
                 "('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "','" + value5 + "')";  
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }
                  }  
    
                  private void updateSecondRowInDatabase(Object value1, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "update vdet set  AMOUNT='"+ value5+"' where VID='" + value1 + "'";                     
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
    
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }                  
    
                  }
    

    Second line code is inside a bean method

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");
                   RowSetIterator rsi = dciter.getRowSetIterator();
                   Row lastRow = rsi.last();
                   int lastRowIndex = rsi.getRangeIndexOf(lastRow);
                   Row newRow = rsi.createRow();
                   newRow.setNewRowState(Row.STATUS_NEW);
                   rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
                   rsi.setCurrentRow(newRow);
    
                   BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");
                   RowSetIterator rsi1 = dciter1.getRowSetIterator();
                   Row lastRow1 = rsi1.last();
                   int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);
                   Row newRow1 = rsi1.createRow();
                   newRow1.setNewRowState(Row.STATUS_NEW);
                   rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);
                   rsi1.setCurrentRow(newRow1);
        }
    

    And final saveUpdate method is

        public void saveUpdateButton(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindingsBC = BindingContext.getCurrent().getCurrentBindingsEntry();      
    
                   OperationBinding commit = bindingsBC.getOperationBinding("Commit");
                   commit.execute(); 
    
            OperationBinding operationBinding = BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit");
            operationBinding.execute();
            DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("VdetView1Iterator");// write iterator name from pageDef.
            iter.getViewObject().executeQuery();  
    
        }
    

    Thanks for all the cooperation to obtain the desired results.

    Concerning

  • Object type returning still only 31 lines instead of more lines.

    Hi all

    My type of object is not more than 31 lines.

    When I run the query below, I got only 31 lines (DataSet). but actually 107 lines must return.

    SELECT CAST (MULTISET (SELECT ROWNUM, HANO TTRENEWAL WHERE))
    VN_STATUS = 'Y' AND PM_STATUS IS NULL) AS REC_RET_TABLE2) FROM DUAL;

    Used collection:_

    CREATE OR REPLACE TYPE 'REC_RET2' AS AN OBJECT
    (NUMBER (10) ID,)
    HASSIBA VARCHAR2 (20)
    )
    /

    CREATE OR REPLACE TYPE 'REC_RET_TABLE2' IN THE TABLE 'REC_RET2 ';
    /

    Thanks in advance.

    Works for me (11.1.0.7):

    SQL> CREATE OR REPLACE TYPE "REC_RET2" AS OBJECT
      2  ( ID NUMBER(10)
      3  )
      4  /
    
    Type created.
    
    SQL>
    SQL> CREATE OR REPLACE TYPE "REC_RET_TABLE2" AS TABLE OF "REC_RET2";
      2  /
    
    Type created.
    
    SQL>
    SQL>
    SQL> SELECT CAST (MULTISET (SELECT rownum from all_objects where rownum<200) AS REC_RET_TABLE2)
      2  FROM DUAL
      3  /
    More...
    
    CAST(MULTISET(SELECTROWNUMFROMALL_OBJECTSWHEREROWNUM<200)ASREC_RET_TABLE2)(ID)
    ----------------------------------------------------------------------------------------------------------------------------------
    REC_RET_TABLE2(REC_RET2(1), REC_RET2(2), REC_RET2(3), REC_RET2(4), REC_RET2(5), REC_RET2(6), REC_RET2(7), REC_RET2(8), REC_RET2(9)
    , REC_RET2(10), REC_RET2(11), REC_RET2(12), REC_RET2(13), REC_RET2(14), REC_RET2(15), REC_RET2(16), REC_RET2(17), REC_RET2(18), RE
    C_RET2(19), REC_RET2(20), REC_RET2(21), REC_RET2(22), REC_RET2(23), REC_RET2(24), REC_RET2(25), REC_RET2(26), REC_RET2(27), REC_RE
    T2(28), REC_RET2(29), REC_RET2(30), REC_RET2(31), REC_RET2(32), REC_RET2(33), REC_RET2(34), REC_RET2(35), REC_RET2(36), REC_RET2(3
    7), REC_RET2(38), REC_RET2(39), REC_RET2(40), REC_RET2(41), REC_RET2(42), REC_RET2(43), REC_RET2(44), REC_RET2(45), REC_RET2(46),
    REC_RET2(47), REC_RET2(48), REC_RET2(49), REC_RET2(50), REC_RET2(51), REC_RET2(52), REC_RET2(53), REC_RET2(54), REC_RET2(55), REC_
    RET2(56), REC_RET2(57), REC_RET2(58), REC_RET2(59), REC_RET2(60), REC_RET2(61), REC_RET2(62), REC_RET2(63), REC_RET2(64), REC_RET2
    (65), REC_RET2(66), REC_RET2(67), REC_RET2(68), REC_RET2(69), REC_RET2(70), REC_RET2(71), REC_RET2(72), REC_RET2(73), REC_RET2(74)
    , REC_RET2(75), REC_RET2(76), REC_RET2(77), REC_RET2(78), REC_RET2(79), REC_RET2(80), REC_RET2(81), REC_RET2(82), REC_RET2(83), RE
    C_RET2(84), REC_RET2(85), REC_RET2(86), REC_RET2(87), REC_RET2(88), REC_RET2(89), REC_RET2(90), REC_RET2(91), REC_RET2(92), REC_RE
    T2(93), REC_RET2(94), REC_RET2(95), REC_RET2(96), REC_RET2(97), REC_RET2(98), REC_RET2(99), REC_RET2(100), REC_RET2(101), REC_RET2
    (102), REC_RET2(103), REC_RET2(104), REC_RET2(105), REC_RET2(106), REC_RET2(107), REC_RET2(108), REC_RET2(109), REC_RET2(110), REC
    _RET2(111), REC_RET2(112), REC_RET2(113), REC_RET2(114), REC_RET2(115), REC_RET2(116), REC_RET2(117), REC_RET2(118), REC_RET2(119)
    , REC_RET2(120), REC_RET2(121), REC_RET2(122), REC_RET2(123), REC_RET2(124), REC_RET2(125), REC_RET2(126), REC_RET2(127), REC_RET2
    (128), REC_RET2(129), REC_RET2(130), REC_RET2(131), REC_RET2(132), REC_RET2(133), REC_RET2(134), REC_RET2(135), REC_RET2(136), REC
    _RET2(137), REC_RET2(138), REC_RET2(139), REC_RET2(140), REC_RET2(141), REC_RET2(142), REC_RET2(143), REC_RET2(144), REC_RET2(145)
    , REC_RET2(146), REC_RET2(147), REC_RET2(148), REC_RET2(149), REC_RET2(150), REC_RET2(151), REC_RET2(152), REC_RET2(153), REC_RET2
    (154), REC_RET2(155), REC_RET2(156), REC_RET2(157), REC_RET2(158), REC_RET2(159), REC_RET2(160), REC_RET2(161), REC_RET2(162), REC
    _RET2(163), REC_RET2(164), REC_RET2(165), REC_RET2(166), REC_RET2(167), REC_RET2(168), REC_RET2(169), REC_RET2(170), REC_RET2(171)
    , REC_RET2(172), REC_RET2(173), REC_RET2(174), REC_RET2(175), REC_RET2(176), REC_RET2(177), REC_RET2(178), REC_RET2(179), REC_RET2
    (180), REC_RET2(181), REC_RET2(182), REC_RET2(183), REC_RET2(184), REC_RET2(185), REC_RET2(186), REC_RET2(187), REC_RET2(188), REC
    _RET2(189), REC_RET2(190), REC_RET2(191), REC_RET2(192), REC_RET2(193), REC_RET2(194), REC_RET2(195), REC_RET2(196), REC_RET2(197)
    , REC_RET2(198), REC_RET2(199))
    
    1 row selected.
    
    SQL>
    
  • How to set the alignment of the grid as "First line only" for any style of paragraph

    Hello.. Please help me.

    I have to set the alignment of the grid as "First line only" for any paragraph style.

    I use the code below to set the alignment of the grid as "all lines".

    *********************************************************************************

    TextAttributes InterfacePtr < ITextAttributes > (styleInfo, UseDefaultIID());

    AttrGridAlignment InterfacePtr < ITextAttrGridAlignment > (: CreateObject2 < ITextAttrGridAlignment > (kTextAttrGridAlignmentBoss));

    attrGridAlignment-> SetGridAlignment (Text::kGABaseline);

    textAttributes-> ApplyAttribute (attrGridAlignment);

    Here, I created the text attribute of the alignment of the grid and applied to the styleInfo of the style.

    Now, the problem is that I tried all available of Text::GridAlignmentMetric values, but none of them affect the 'first line only. Please tell me the solution of this problem. I'm short on time.

    Thanks in advance.

    You apply this attribute via kEditTextStyleCmdBoss or equivalent? If this is not the case, consider to do.

    kGABaseline is what you need. In addition (see dialogue change style to a "pipe") you will need kTAGridAlignOnlyFirstLineReportBoss - IID_ITEXTATTRBOOLEAN set to true...

    Dirk

Maybe you are looking for