Return first n rows with skip locked.

Timesten is used from Java using client-server access. We have to replicate rows from TimesTen to another database.
We have parallel job processing rows. While processing, rows are locked:
SELECT FIRST N * FROM TABLE_X FOR UPDATE
The problem is that the first job selects and locks first n rows and other job have to wait until locks are released. Is it possible to skip locked rows, so other jobs would select another set of rows.
With Oracle this can be accomplished using SKIP LOCKED clause. With SQL Server using WHERE Locked IS NULL clause.
Is possible to have this kind of behavior in TimesTen?
Is there some other alternative for replicating rows? XLA API seems to be for this, but it seems a little bit complicated and we have to use direct-access, which is not suitable for our setup.
Thanks

Unfortunately, TimesTen does not have any option to skip locked rows. I'm guessing that the 'other database' isn't Oracle? If it is you could use an AWT cache group. XLA (or JMS/XLA for Java) is really the best option for 'replicating' in terms of performance etc. It is true that to use it the component that does the 'replication' would have to run on the machine where TimesTen is running but the rest of the app would not have to do so. Mind you direct mode does give much better performance :-)
If you really need to do this through SQL then you'll have to figure out a way to get the different jobs to look at different sets of rows without locking them. Exactly how you might do this of course depends a lot on the application and exactly what it is trying to do. One approach would be to have a column in the table to identify which 'replicator' is currently processing the row. You could use NULL to mean it is not being processed and some id value (could just be a number) to indicate that replicator 1 (or 2 or 3 or ...) is processing it. Replicator 'n' would 'reserve' a set of rows by updating he column to 'n' and committing. Then it would do its work and afterwards update the column again to some other value that means 'replication done'. This may work okay or may not depending on what else the application needs to do concurrently with those rows etc.
Chris

Similar Messages

  • Return to selected row with refresh after update in edit  form

    Hi,
    I created a database view.When selected a single row and click on button i can edit the row in a form for update.What i want, when doing some update and click on the commit button i return back on the initial row with a refresh to see the update done on this row.I succeeded to modify the form and commit.But when i return on the selected row my update is not visible.How can i return to the same selected row with a refresh.In oracle form i can do a go record with execute_query, but how to do this in ADF.Please someone can help so that i do not spend many days on it.
    Thanks
    Soodesh

    [click for the tutorial|http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0CFQQFjAF&url=http%3A%2F%2Fandrejusb.blogspot.com%2F2013%2F03%2Fadf-rollback-and-keep-current-row.html&ei=Tnl3Ucn3BoXIrQeemICQAw&usg=AFQjCNHdYcJL8kJKymqbWBT9XDGTWmeUvQ&bvm=bv.45580626,d.bmk&cad=rja]
    here you go :)

  • Selecting the first n rows with Oracle

    Please help,I am very confused with this.
    For example,lets take a table called "items" which has
    ID    NAME    PRICE
    1    cup              1.2
    2    book         49.99
    3    mobile        89.99
    20    bike        1250
    19    egg            0.8
    18    bun           2.5
    17    color          2.22
    16    tv             310
    15    air            0
    14    laptop         999.5
    13    pack         21.53
    12    cd/r           1.2
    11    table         198
    10    apple         1.05
    9    carpet         122.4
    8    oracle         19999
    7    door           150
    6    dollar         1
    5    pencil        1.35
    Next,say, we want to retrieve the five cheapest items.
    select name, price
    from items
    where rownum < 6
    order by price;
    NAME                      PRICE
    coke                        .78
    cup                         1.2
    pencil                     1.35
    book                      49.99
    mobile                    89.99
    This is wrong. In the result set above, the item with id no 19 (egg) is missing which only  costs 0.80 (currency units). We get this because
    Oracle first retrieves the first five  rows and then orders them by price. This is because of the fact  that we didn't explicitly enough state what we meant with first.
    This problem can be solved by using row_number with a option--->below
    select name, price
    from (
    _*select name, price, row_number() over (order by price) r*_
    _*from items*_
    where r between 1 and 5;
    NAME                      PRICE
    air                           0
    coke                        .78
    egg                          .8
    dollar                        1
    apple                      1.05
    **Question is in the above select if i ADD the clause "WHERE rownum <= 6"---The above result set goes wrong again.I dont get the correct order as above.
    Please help.Can we have the order by done first and then take 5 records of them.
    select name, price
      from (
        select name, price, row_number() over (order by price) r
          *from items WHERE rownum <= 6*
    where r between 1 and 5

    wrote:user_7000011
    Thanks.
    *But, what i wanted is  in the inner most select where we select from item --I need to add a where qualification as below.*
    select * from
    (select name, price, dense_rank() over (ORDER by price desc ) rank from item where rownum &lt;=6
    ) a
    where a.rank&lt;6
    Well, the rank limitation is having the same effect in that query, so there's no need to try and put "rownum &lt;=6" in that case.What you need to understand is that "rownum" is a pseudo column that is generated when the results of a query are already determined, but it is applied before any ordering takes place (as the where clause is evaluated before the order by clause).
    So if you try and say "where rownum &lt;= 6 order by x", you are under the misunderstanding that it will order the data first and then take the first 6 rows. This isn't the case. It will take the first 6 rows (whatever they may be) and then order those.
    In order to order first and then take 6 rows you have to order your data without restriction and then wrap that in a query to restrict it.
    Hence...
    select x
    from tableX
    where rownum &lt;= 6
    order by xbecomes
    select x
    from (select x
          from   tableX
          order by x)
    where rownum &lt;= 6This ensures that the data is selected and ordered first and then the first 6 rows are taken from that.

  • Power Query occassionally connects, seems to load, but returns only 200 rows with 1 error

    I have a Power Query that i have used for few weeks, successfully, but occasionally requires being run a few times to return records.  Just lately it seems to require run more than a few times to make it work. 
    When it doesn't return records , it seems to connects and start retrieving data, but returns only randomly like 100 - 200 rows with 1 error.  The error doesn't have any message. So its hard to troubleshoot from that perspective.
    Query appends two other large and merges in a few others. The data sources are either csv files, Sharepoint Lists and tables in workbook.
    I haven't identified anything in terms of environment or query changes that might cause this.
    When it finally does retrieve all records,  it might be after i have done the following things, but i can't say for certain exactly what did the trick:
    * to run query multiple times
    *maybe simply changing anything in query resolves issue
    * making upstream queries (that are merged or appended into this query)  to Not Load to worksheet or model, eg just have connection
    I'd think this type of error and situation while not common is encountered by others.
    Does this ring a bell for anyone, and if so, can you please shed some light on the reasons and resolutions for this?
    Thanks!

    If you click on "1 error" it should show the editor with a query that will select the rows with errors. This unfortunately might not show all errors for various reasons, but you should try it.
    If that doesn't work, here's an example of how to retrieve error details.
    Suppose the following query:
    = Table.FromRecords({[A="B", B="C" + 1]})
    Notice how we're using the + operator with a string and number. This will result in an error.
    I can create a custom column that uses the 'try' operator over the B column. This returns a record with details which I then expand to retrieve the message.
    let
    Source = Table.FromRecords({[A="B", B="C" + 1]}),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each try [B]),
    #"Expand Custom" = Table.ExpandRecordColumn(#"Added Custom", "Custom", {"HasError", "Error"}, {"Custom.HasError", "Custom.Error"}),
    #"Expand Custom.Error" = Table.ExpandRecordColumn(#"Expand Custom", "Custom.Error", {"Message"}, {"Custom.Error.Message"})
    in
    #"Expand Custom.Error"
    Let me know how this works for you.
    Tristan

  • How to display first 5 rows with a specific filter

    Hi All,
    Please do have a look at the below mentioned query.
    select * from emp where empnm like 'B%';Now suppose it will display 10 rows. But I want to display first 5 rows out of them.
    How can I do that? I tried this with rownum and rowid. It worked because the records are in order,
    but if those records are in arbitrary order, now what? What should be done here?
    Regards,
    BS2012.

    BS2012 wrote:
    Hi All,
    Please do have a look at the below mentioned query.
    select * from emp where empnm like 'B%';Now suppose it will display 10 rows. But I want to display first 5 rows out of them.
    How can I do that? I tried this with rownum and rowid. It worked because the records are in order,
    but if those records are in arbitrary order, now what? What should be done here?
    Regards,
    BS2012.This will display the first 5 records no matter of the order
    select * from emp where empnm like 'B%'
    and rownum <=5;This will display the first 5 records after ordering them
    select * from (select * from emp where empnm like 'B%' order by empnm) where rownum <=5 ;Regards.
    Al
    Edited by: Alberto Faenza on Oct 11, 2012 5:49 PM
    Edited by: Alberto Faenza on Oct 11, 2012 5:50 PM

  • SQL subquery returning too many rows with Max function

    Hello, I hope someone can help me, I been working on this all day. I need to get max value, and the date and id where that max value is associated with between specific date ranges. Here is my code , and I have tried many different version but it still returning
    more than one ID and date
    Thanks in advance
    SELECT
      distinctbw_s.id, 
    avs.carProd,cd_s.RecordDate,
    cd_s.milkProductionasMilkProd,
    cd_s.WaterProductionasWaterProd
    FROMtblTestbw_s
    INNERJOINtblTestCpcd_sWITH(NOLOCK)
    ONbw_s.id=cd_s.id   
    ANDcd_s.recorddateBETWEEN'08/06/2014'AND'10/05/2014'
    InnerJoin
    (selectid,max(CarVol)ascarProd
    fromtblTestCp
    whererecorddateBETWEEN'08/06/2014'AND'10/05/2014'
     groupby 
    id)avs
    onavs.id=bw_s.id
    id RecordDate carProd       MilkProd WaterProd
    47790 2014-10-05   132155   0 225
    47790 2014-10-01   13444    0 0
    47790 2014-08-06   132111    10 100
    47790 2014-09-05   10000    500 145
    47790 2014-09-20   10000    800 500
    47791 2014-09-20   10000    300 500
    47791 2014-09-21   10001    400 500
    47791 2014-08-21   20001    600 500
    And the result should be ( max carprod)
    id RecordDate carProd       MilkProd WaterProd
    47790 2014-10-05   132155  0 225
    47791 2014-08-21   20001    600 500

    Help your readers help you.  Remember that we cannot see your screen, do not know your data, do not understand your schema, and cannot test a query without a complete script.  So - remove the derived table (to which you gave the alias "avs")
    and the associated columns from your query.  Does that generate the correct results?  I have my doubts since you say "too many" and the derived table will generate a single row per ID.  That suggests that your join between the first
    2 tables is the source of the problem.  In addition, the use of DISTINCT is generally a sign that the query logic is incorrect, that there is a schema issue, or that there is a misunderstanding of the schema. 

  • Problem reading a xmlType column (return only 999 rows) with XMLTable

    Hello,
    I'm new in the forum.
    Sorry for my english.
    I have a problem reading an xmltype column.
    My oracle's version is 11.1.0.6.0
    I have a table like this:
    Create Table TestXml (idProg number, xmldata XmlType)
    XMLTYPE COLUMN xmldata
    STORE AS BINARY XML;
    I have a xml file containing the equivalent of 10000 record (like a csv).
    my schema xsd is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="applicazione">
              <xs:annotation>
                   <xs:documentation>Flusso Monitoraggi</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="periodo" maxOccurs="unbounded">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="segmento" maxOccurs="unbounded">
                                            <xs:complexType>
                                                 <xs:sequence>
                                                      <xs:element name="progressivo" maxOccurs="unbounded">
                                                           <xs:complexType>
                                                                <xs:sequence>
                                                                     <xs:element name="stato" type="xs:string"/>
                                                                     <xs:element name="ts_start" type="xs:string"/>
                                                                     <xs:element name="ts_stop" type="xs:string"/>
                                                                     <xs:element name="nota_esecuzione" type="xs:string"/>
                                                                     <xs:element name="ts_esecuzione" type="xs:string"/>
                                                                </xs:sequence>
                                                                <xs:attribute name="valore" type="xs:integer" use="required"/>
                                                           </xs:complexType>
                                                      </xs:element>
                                                 </xs:sequence>
                                                 <xs:attribute name="nome" type="xs:string" use="required"/>
                                            </xs:complexType>
                                       </xs:element>
                                  </xs:sequence>
                                  <xs:attribute name="nome" type="xs:string" use="required"/>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
                   <xs:attribute name="nome" type="xs:string"/>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    When I try to read my xmltype column with this select :
    SELECT ap.desc_applicazione,pe.seq_periodo, pe.desc_elem_temp_ist,
    sg.desc_segmento_elab,pg.seq_progressivo,
    pg.desc_stato,pg.ts_start,pg.ts_stop,pg.nota_esecuzione,pg.ts_esecuzione,
    pg.valore_prog,sg.seq_segmento,idProg
    FROM testXML p,
    XMLTable('/applicazione' PASSING p.xmlData
    COLUMNS
    seq_applicazione for ordinality,
    desc_applicazione VARCHAR2(50) PATH '@nome',
    periodo XMLType PATH 'periodo') ap,
    XMLTable('periodo' PASSING ap.periodo
    COLUMNS
    seq_periodo for ordinality,
    desc_elem_temp_ist VARCHAR2(50) PATH '@nome',
    segmento XMLType PATH 'segmento') pe,
    XMLTable('segmento' PASSING pe.segmento
    COLUMNS
    seq_segmento for ordinality,
    desc_segmento_elab VARCHAR2(50) PATH '@nome',
    progressivo XMLTYPE PATH 'progressivo') sg,
    XMLTable('progressivo' PASSING sg.progressivo
    COLUMNS
    seq_progressivo for ordinality,
    valore_prog NUMBER PATH '@valore',
    desc_stato VARCHAR(10) PATH 'stato',
    ts_start VARCHAR2(50) PATH 'ts_start',
    ts_stop VARCHAR2(50) PATH 'ts_stop',
    nota_esecuzione VARCHAR2(50) PATH 'nota_esecuzione',
    ts_esecuzione VARCHAR2(50) PATH 'ts_esecuzione'
    ) pg
    where idProg = 1
    I obtained only 999 rows.
    I tried with two file xml, one containing 10000 repetition of progressivo, the other containing 10000 repetition of segmento.
    Anybody know why? Where is my error?
    Thank you in advance for any response.
    Maurizio

    Hello,
    I'm new in the forum.
    Sorry for my english.
    I have a problem reading an xmltype column.
    My oracle's version is 11.1.0.6.0
    I have a table like this:
    Create Table TestXml (idProg number, xmldata XmlType)
    XMLTYPE COLUMN xmldata
    STORE AS BINARY XML;
    I have a xml file containing the equivalent of 10000 record (like a csv).
    my schema xsd is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="applicazione">
              <xs:annotation>
                   <xs:documentation>Flusso Monitoraggi</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="periodo" maxOccurs="unbounded">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="segmento" maxOccurs="unbounded">
                                            <xs:complexType>
                                                 <xs:sequence>
                                                      <xs:element name="progressivo" maxOccurs="unbounded">
                                                           <xs:complexType>
                                                                <xs:sequence>
                                                                     <xs:element name="stato" type="xs:string"/>
                                                                     <xs:element name="ts_start" type="xs:string"/>
                                                                     <xs:element name="ts_stop" type="xs:string"/>
                                                                     <xs:element name="nota_esecuzione" type="xs:string"/>
                                                                     <xs:element name="ts_esecuzione" type="xs:string"/>
                                                                </xs:sequence>
                                                                <xs:attribute name="valore" type="xs:integer" use="required"/>
                                                           </xs:complexType>
                                                      </xs:element>
                                                 </xs:sequence>
                                                 <xs:attribute name="nome" type="xs:string" use="required"/>
                                            </xs:complexType>
                                       </xs:element>
                                  </xs:sequence>
                                  <xs:attribute name="nome" type="xs:string" use="required"/>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
                   <xs:attribute name="nome" type="xs:string"/>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    When I try to read my xmltype column with this select :
    SELECT ap.desc_applicazione,pe.seq_periodo, pe.desc_elem_temp_ist,
    sg.desc_segmento_elab,pg.seq_progressivo,
    pg.desc_stato,pg.ts_start,pg.ts_stop,pg.nota_esecuzione,pg.ts_esecuzione,
    pg.valore_prog,sg.seq_segmento,idProg
    FROM testXML p,
    XMLTable('/applicazione' PASSING p.xmlData
    COLUMNS
    seq_applicazione for ordinality,
    desc_applicazione VARCHAR2(50) PATH '@nome',
    periodo XMLType PATH 'periodo') ap,
    XMLTable('periodo' PASSING ap.periodo
    COLUMNS
    seq_periodo for ordinality,
    desc_elem_temp_ist VARCHAR2(50) PATH '@nome',
    segmento XMLType PATH 'segmento') pe,
    XMLTable('segmento' PASSING pe.segmento
    COLUMNS
    seq_segmento for ordinality,
    desc_segmento_elab VARCHAR2(50) PATH '@nome',
    progressivo XMLTYPE PATH 'progressivo') sg,
    XMLTable('progressivo' PASSING sg.progressivo
    COLUMNS
    seq_progressivo for ordinality,
    valore_prog NUMBER PATH '@valore',
    desc_stato VARCHAR(10) PATH 'stato',
    ts_start VARCHAR2(50) PATH 'ts_start',
    ts_stop VARCHAR2(50) PATH 'ts_stop',
    nota_esecuzione VARCHAR2(50) PATH 'nota_esecuzione',
    ts_esecuzione VARCHAR2(50) PATH 'ts_esecuzione'
    ) pg
    where idProg = 1
    I obtained only 999 rows.
    I tried with two file xml, one containing 10000 repetition of progressivo, the other containing 10000 repetition of segmento.
    Anybody know why? Where is my error?
    Thank you in advance for any response.
    Maurizio

  • Af:commandButton only works for the first 10 rows returned in the af:table

    Using JDeveloper 10.1.3.2.0.
    I am new to ADF programming. I have attempted to create an ADF page that contains a search and return table in the same page. The search appears to work fine but the return table displays odd behavior. If the search returns more than 10 rows such that it is possible to page forward through the rows returned the command button associated with the return table that allows the user to pick a particular row and navigate to another page does not work. If the user finds what he/she is looking for in the first ten rows then the command button works fine and the user is taken to the next page. The command button is actually defined to have an af:setActionListener to set a value in a backing bean and then command button has an action to invoke a backing bean. Both of these fire just fine if the selection is made from the first 10 rows. However once the user pages forward to another set of rows then neither seem to happen. Any advice on where to figure out what I did wrong?

    When I get a component that seems to do nothing under certain circumstances, the first thing I usually check for is Javascript errors. Sometimes errors on page load can keep a component's Javascript from firing properly.
    Try reproducing your problem in Firefox (or another browser with a decent Javascript error console; IE doesn't have one, although I think you can get extensions that provide JS debugging). Check the error console:
    # Before scrolling off the first 10 rows.
    # Right after scrolling off the first 10 rows.
    # After unsuccessfully clicking the command button.
    Do any interesting errors show up in steps 2 or 3?

  • Return first row entered based on date column

    I'm trying to select the first entered row in a table, as judged by the datetime column. If more than one row has the same date and time, then only one row should be returned (any row having that datetime is fine). Some processing will occur on that row and then it will be deleted. The select statement is used thereafter to select the next (first) entered row in the table, etc. This way, the rows are processed first-in first-out (FIFO) style. Here's my example table:
    create table my_table
    datetime date,
    firstname varchar2(50)
    insert into my_table(datetime, firstname) values(to_date('2012-04-02 11:00:00', 'YYYY-MM-DD HH24:MI:SS'),'ken');
    insert into my_table(datetime, firstname) values(to_date('2012-04-02 11:00:00', 'YYYY-MM-DD HH24:MI:SS'),'john');
    insert into my_table(datetime, firstname) values(to_date('2012-04-02 11:00:00', 'YYYY-MM-DD HH24:MI:SS'),'sue');
    commit;
    Here's my example select statement, which returns simply one row of the above, since all are the same date and time:
    SELECT *
    FROM my_table
    WHERE datetime = ( select min(datetime) from my_table )
    AND rownum = 1;
    My question is, if I use the following
    SELECT *
    FROM my_table
    WHERE datetime = ( select min(datetime) from my_table );
    It returns all 3 rows:
    DATETIME FIRSTNAME
    02-APR-12 11:00:00 ken
    02-APR-12 11:00:00 john
    02-APR-12 11:00:00 sue
    So, wouldn't setting rownum = 2 return john, and rownum = 3 return sue? For example,
    SELECT *
    FROM my_table
    WHERE datetime = ( select min(datetime) from my_table )
    AND rownum = 2;
    return no rows. I just want to make sure I'm understanding how the select statement above works. It seems to work fine for returning one row having the minimum date and time. If this is always the case, then everything is fine. But I wouldn't have expected it not to return one of the other rows when rownum is 2 or 3, which makes me question why? Maybe I can learn something here. Any comments much appreciated.
    Edited by: tem on Apr 2, 2012 2:06 PM

    Hi,
    tem wrote:
    ... So, wouldn't setting rownum = 2 return john, and rownum = 3 return sue? For example,, ROWNUM
    SELECT *
    FROM my_table
    WHERE datetime = ( select min(datetime) from my_table )
    AND rownum = 2;
    return no rows. I just want to make sure I'm understanding how the select statement above works. It seems to work fine for returning one row having the minimum date and time. If this is always the case, then everything is fine. But I wouldn't have expected it not to return one of the other rows when rownum is 2 or 3, which makes me question why? Maybe I can learn something here. Any comments much appreciated.ROWNUM is assigned as rows are fetched and considered for inclusion in the result set. If the row is not chosen for any reason, the same ROWNUM will be reused with the next row fetched. ROWNUM=2 will not be assigned until a row with ROWNUM=1 has been included in hte result set.
    So, in your example:
    SELECT  *
    FROM    my_table
    WHERE   datetime = ( select min(datetime) from my_table )
    AND     rownum = 2;Say the first row that happens to be fetched has firstname='ken'. It is assigned ROWNUM=1, and fails the WHERE clause condition "WHERE rownum = 2".
    Say the next row fetched has firstname='john'. ROWNUM=1 hasn't been used yet, so this row is also assigned ROWNUM=1, and it fails the WHERE clause for the same reason. Likewise with the next row; it also is assigned ROWNUM=1, and it also fails.
    When using ROWNUM in a WHERE clause, you almost always want to say "ROWNUM = 1" or "ROWNUM <= n".
    You could also use the analytic ROW_NUMBER function:
    WITH     got_r_num     AS
         SELECT     datetime, firstname
         ,     ROW_NUMBER () OVER (ORDER BY  datetime)     AS r_num
         FROM     my_table
    SELECT     datetime, firstname
    FROM     got_r_num
    WHERE     r_num     = 1
    ;Here, all values of r_num are available, so it would make sense to say things like "WHERE r_num = 2" or "WHERE r_num >= 2".
    Edited by: Frank Kulash on Apr 2, 2012 5:31 PM
    Added to explanation.

  • Returning two rows with one column containing only one place

    Dear all;
    I have a query that returns two rows similar to this below
    ID      PLACE            PROGRAM
    A       NEWYORK      PROGRAM A
    A       NEWYORK      PROGRAM B
    I would like this instead
    ID      PLACE             PROGRAM
    A       NEWYORK       PROGRAM A
                                   PROGRAM  B
    All help is appreciated. Thank you.Edited by: user13328581 on Mar 22, 2011 11:52 AM

    user13328581 wrote:
    WOW...THanks a lot Solomon, I have never used partitions and row_number in such a manner...can you please explain your logic.Sure:
    row_number() over(partition by id order by place,program)This will take all rows returned by the query andsplit them into buckets (partitions) by id. Inside each bucket it will order rows by place and program and assign them row numbers. So for each ID row number 1 will be row with first (alphabetically) place first programt. And this is the row where we want ID to show up. That is why we wrap the above analytic function in CASE statement which will do exactly that. Now:
    row_number() over(partition by id,place order by program)does pretty much the same just bucket is ID and PLACE combination. So for each such combination we want to show only for the first (alphabetically) programt.
    Now notice in ORDER BY clause I prefix ID and PLACE with table alias. You must do it since otherwise query alias ID and PLACE will take precedence resulting in wrong sort order (remember we nulled all ID and PLACE except for row number 1).
    SY.

  • Call tranasaction with skip first screen in ecc6

    Hi,
    We are doing upgrade from 4.7 to ecc 6. We are getting an error while running a report( The addition "AND SKIP FIRST SCREEN" can't be used with "CALL TRANSACTION .. USING".  ) in ecc6. This is not showing error in 4.7. Call transaction with skip first screen is fine in 4.7. But it is throwing an error in ecc6.
    Could anybody provide me the pointers to rectify this error.
    Regards,
    Ramesh

    Hi
    Did you pass all the mandatory field values to the calling transaction , Because when you use this addition you need to pass all the mandatory field values then only it works fine. Check out whether you are passing all the mandatory field values.
    Regards
    Pavan

  • How to return one ROW with Multiple value seperated by Colon in a SQL Query

    Hi,
    I have a SQL query as mentioned.
    select deptno
      from deptI want to mofidfy this query, so that this should return me department list with colon delimeted in one ROW.
    10:20:30:40.......Thanks,
    Deepak

    In 10g:
    select rtrim(xmlagg(xmlparse(content deptno || ':')).getstringval(), ':') data
    from   dept;
    DATA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    10:20:30:40with apologies for the abuse of XML...

  • Cascading LOV always returns first row in af:query

    HI
    JDEV 11.1.1.3.0
    A strange thing is happening with my cascading LOV which is input text with LOV.
    I have a read only table with a query section. I then also bring up any of the tables rows in a popup with single record view where the row is then in an af:form for inserting and updating.
    Both the af:query and af:form have the cascaing LOV in them.
    When testing the cascading LOV in the BC Browser it works fine. When I use it in the popup in the af:form record it works fine. But in the af:query section, no matter which row I choose in the LOV, it always returns the 1st row of the LOV back to my input text component.
    Has anyone experienced this...any ideas?
    Thanks,
    Mario

    Aha...and the above log message lead me to the solution!! :-)
    The VO is based on an Oracle data dictionary view, DBA_TAB_COLUMNS. When you create the read only VO, by default it does not create any of the attributes as "key" attributes, because the oracle view has no primary key.
    Setting owner, tableName and columnName as key attributes solved this issue, now my cascading LOV works in the BC Tester, af:query component and my af:form component.
    Regards,
    Mario

  • SELECT FOR UPDATE with the SKIP LOCK clause

    Hi,
    I have a query regarding the SELECT FOR UPDATE with the SKIP LOCK clause.
    Whether this will be really good for parallel processing.
    Also if we are selecting a set of records in a cursor whether the lock will be done at the records level once we fetch the records?
    Also do we have any known issues with this one?
    We are trying to figure out whether this will fit for business requirement, we are trying to do a implement a threading kind of thing for our stored procedure invocation in background using shell script.
    Any suggestion or feedback on this will be helpful for us.
    Thanks a lot for the support given....
    Regards,
    Basil Abraham.

    http://www.oracle.com/technology/oramag/oracle/08-mar/o28plsql.html
    Please read the above thread for few information...Thanks!

  • Sharepoint Export API - Returning rows with a starting row beyond 5000

    Until this last week I have been using looping REST connector logic to extract all of our customers Sharepoint data through the Export API. I was doing this by incrementing the starting row for each call by 500 with a row limit of 500 for each call. I kept
    doing this until the greatest returned row was equal to the total rows with duplicates. This ran in a deployed/automated fashion for the last two weeks. At the start of this week our customer noticed that we were only receiving roughly the number of unique
    customers (~4.9k) rather than the entire dataset (~27k). When I attempt to manually pull data from any point beyond a row count of 5000 I receive zero rows back. 
    Has something changed with the API recently that would cause this to happen? If not with the API, could a change in permission levels/setting cause this?
    Thank you for your time,
    Bryan

    Hi Martin,
    Sorry for the late...very late reply, no I didn´t solved it and now we really need to get this issue sorted out. Since last time I have installed a new DPM 2012 R2 server for the customer, and the exact same error still occurs :(
    So my question in return, have you solved it yet ?
    If so, it would be great if you can reply with the solution.
    If not, MS please advise A.S.A.P
    Thx /Tony

Maybe you are looking for

  • HT3325 Link keynote remote to iphone 5: not working

    I'm trying to link my iphone 5 to Keynote on MBA via the keynote remote app, but my phone isn't showing up in the 'available remotes' menu in keynote preferences. I've tried doing this via wifi and I created my own network like others have sugested.

  • DVD-R blanks - problems

    I bought a pack of 50 hp DVD-R disks and it seems there are a few bad ones.  Some don't register in my DVD burner (DVD/VCR Combo) or in my HP TouchSmart...I will get a message stating disk cannot be read.  I am positive the disks are unused.  What ca

  • Update clause

    Hello, I have an update clause, like: update persc           set nume = decode(r.id_tipperscon, 11, pnume),           ...That 'pnume' comes from a parameter. I want include this column('nume = ...') in the update clause only if pnume parameter is not

  • MapMessage and JMS Event Generator

    Hello I need to set up a WLI JMS event generator that will consume a JMS MapMessage. It appears that the only message types supported by a JMS event generator are xml, rawData, string and none. I've already tried each of these and for each I get a me

  • Can hp ENVY 15 J 126TX GRAPHIC CARD BE UPGRADED

    can hp ENVY 15 J 126TX GRAPHIC CARD BE UPGRADED?it has a nvidia gt740 and i want to maybe upgrade it to something better like GeForce GTX 780M or gtx770.help pls