Auto retry of select statements on failure

I have a IBM Message Broker message flow that accesses the database to fetch some data. following are the steps in a message flow. (similar pattern is there in other flows as well)
1) Parse the input message
2) Invoke a ESQL compute node that accesses the database. This uses DataDirect ODBC drivers to access the database.
3) process the data
4) Invoke an external Java class that also accesses the database. This Java class uses Spring/Hibernate and uses the Oracle UCP library.
Steps 2 and 4 access an Oracle database on which failover features are NOT enabled. Following is our observation.
If the database fails when executing step 2, then the message flow pauses until a valid connection is available and then proceeds with the execution, the point to note is that the message flow does not experience a failure. It simply pauses until it gets a connection and continues once it gets a connection.
If the database fails when executing step 4, the message flow gets an error.
What we want is for step 2 and 4 to execute the same way, meaning that we want the message flows to wait until a valid connection is available and then continue without any errors.
I feel that there is some feature in DataDirect driver that cause step 2 to pause the message flow and prevent an error. We want the same behaviour in step 4 as well.
So, is there some way (via configuration or any other means) to get this behaviour using oracle UCP library.
One thing to note is that we are not in position to change the Java code since it has been developed by a third party.
To achieve this I have written a test and the following are details.
For this I have created a service with the following properties. Point to note is that we run the service on only one instance at a time, if it goes down then it is started on the second instance.
Service name: LDL_TEST02
Service is enabled
Server pool: CSAHEDA_LDL_TEST02
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: true
Failover type: SELECT
Failover method: NONE
TAF failover retries: 180
TAF failover delay: 5
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: CSAHEDA1
Available instances: CSAHEDA2
Following is in my tnsnames.ora file and I am using the oracle oci driver.
TESTA =
(DESCRIPTION =
(ENABLE = BROKEN)
(LOAD_BALANCE = off)
(FAILOVER = on)
     (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = vip.host1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip.host2)(PORT = 1521)))
(CONNECT_DATA =
(SERVICE_NAME = LDL_TEST02)
(FAILOVER_MODE =
(BACKUP = TESTA2)
(TYPE = SELECT)
(METHOD = PRECONNECT)
(RETRIES = 120)
(DELAY = 5)
This is how I run my test.
1)I have a simple test that simply loops through a list of select statements.
2)each time it takes a connection from the connection pool, executes the statement and returns the connection to the connection pool.
3)I keep this running for around 10 minutes.
4) once the test has started I bring down the service wait for 3 minutes and the start the service on the second instance.
5) what I expect is for the test to pause for 3 minutes and then get the correct value from executing the select statement. and continue without pause.
Following is the config for the connection pool.
     <bean id="dd_Datasource" class="oracle.ucp.jdbc.PoolDataSourceFactory" factory-method="getPoolDataSource">
          <property name="connectionFactoryClassName" value="oracle.jdbc.xa.client.OracleXADataSource"/>
          <!-- property name="connectionFactoryClassName" value="oracle.jdbc.pool.OracleDataSource"/ -->
          <!-- <property name="connectionFactoryClassName" value="sun.jdbc.odbc.ee.DataSource"/-->
          <!-- <property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host2)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=LDL_TEST02)))" /> -->
          <!-- <property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host2)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=LDL_TEST02)))" />-->
          <!-- property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host1) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host2) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=LDL_TEST02)(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY = 5))))" /-->
          <!-- <property name="URL" value="jdbc:oracle:oci:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS_LIST=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host1) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip.host2) (PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=LDL_TEST01)(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY = 5))))" /> -->
          <property name="URL" value="jdbc:oracle:oci:/@TESTA" />
          <!-- JDBC ODBC Bridge Driver -->
          <!-- property name="URL" value="jdbc:odbc:LT_Test_DB"/-->
          <!-- DataDirect URLs -->
          <!-- property name="URL" value="datadirect:oracle://vip.host1:1521;SID=LDL_TEST01"/-->
          <property name="user" value="user" />
          <property name="password" value="user" />     
          <property name="connectionPoolName" value="dd_connectionpool" />
          <property name="minPoolSize" value="2" />
          <property name="maxPoolSize" value="4" />                     
          <property name="initialPoolSize" value="2" />
          <property name="connectionWaitTimeout" value="10000" />
          <!-- Note:
               The setSQLForValidateConnection property is not recommended when using an Oracle JDBC driver.
               UCP for JDBC performs an internal ping when using an Oracle JDBC driver.
               The mechanism is faster than executing an SQL statement and is overridden if this property is set.
               Instead, set the setValidateConnectionOnBorrow property to true and do not
               include the setSQLForValidateConnection property. -->
          <property name="validateConnectionOnBorrow" value="true"/>
          <!-- FCF stuff -->
          <!-- property name="connectionCachingEnabled" value="true"/-->
          <!-- property name="fastConnectionFailoverEnabled" value="true"/-->
          <!-- <property name="ONSConfiguration" value="nodes=vip.host1:1521,vip.host2:1521"/>-->
     </bean>     
As you can see I have tried many combinations.
Sometimes I see the thread pause for 3 minutes without error and then continue.
Sometime I start seeing 'oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource' as soon as the servic is down.
Sometime the first error above is seen after 30 seconds (always the first one).
Can you guys shed any light on this? And how can I get the desired behaviour?
Edited by: user12181209 on 30-May-2012 02:22
reworded.
Edited by: user12181209 on May 30, 2012 6:28 AM
reworded the title for clarity.
Edited by: user12181209 on Jun 1, 2012 6:01 AM

Hi,
Yesterday, a similar question on running slow view was post :
View is tooo slow....
You can read different questions to try to help you.
Nicolas.

Similar Messages

  • Autocommit and select statements

    Hi,
    Does auto-commit affect select statements (in the performance aspect) or does it apply only for insert/update/delete statements?
    thanks,
    Yael

    SELECTS participate in DB transactionality just as much as INSERT/UPDATE/DELETE statements do. The only way I know to demonstrate this is using SERIALIZABLE isolation level.
    Using an Oracle database and 2 SQL*Plus windows (the translation into Java/JDBC is left as an exercise for the reader).
    Setup:
    SQL> create table foo (n number);
    Table created.
    SQL> insert into foo (n) values (3);
    1 row created.
    SQL> c/3/4/
      1* insert into foo (n) values (4)
    SQL> /
    1 row created.
    SQL> commit;Now the demo...
    Window A:
    SQL> alter session set isolation_level = serializable;
    Session altered.
    SQL> select sum(n) from foo;
        SUM(N)
             7Window B:
    SQL> insert into foo (n) values (6);
    1 row created.
    SQL> commit;And Window A again:
    SQL> select sum(n) from foo;
        SUM(N)
             72 minutes or 2 years later, Window A must either produce the same answer or an error. Once a commit or rollback occurs in Window A, then and only then can the connection in Window A can see the changed sum. Therefore, the DB has to be maintaining a transaction boundary for the connection in Window A, even though only SELECTS have occured.
    The dreaded Oracle "Snapshot too old" error would be a common error, indicating that Oracle has reused the space that stored whatever was need to reconstruct the old state of the table - this is a bad example in that I don't think the additional row added by B can cause that error, it could if it were a row deletion though. As I understand it, Postgres can't have an error because the old state is lost, instead, Postgres will refuse to reuse changed storage until it can guarantee that the changed storage will never be needed to reconstruct the old state. In other words, if we ran this on Postgres and waited long enough before committing or rolling back, the DB storage would fill up with every changed value going back to the moment of the first select in Window A.
    But back to the main point; SELECTs can participate in DB transactionality. How a DB manages that is up to the implementation. That management has a small (teeny tiny) cost, at least some of the time, and COMMITs interact with that cost; just how is up to the implementation (and in a good implementation it probably also depends on the isolation level).
    At the practical level, we can generally totally ignore the transactionality of SELECTs; most of us use READ COMITTED instead of SERIALIZABLE, and we don't keep connections open for days or months, so it hardly matters in our day-to-day...

  • Video in button Selected state?

    I'm rusty in DVDSP - been a couple of years since my last DVD menu project, but I have one now and the client has provided the menu art and description of what they want - but there are 2 items I'm not sure if I can include the way they want, and before I re-prep their art for Studio Pro (because, of course, it was prepped as if for print), I want to determine the best course to take, and reset their expectations, if necessary.
    1) They want video to play in a button, but only when it is selected - I can drop video in using shapes, but it's playing in all states. I can't use a layered menu, because the background also is motion (subtle looping, but motion just the same). Thought maybe I'd build the motion in the buttons and mask over with a still in normal state, reveal in selected, but can't seem to get there. So any ideas, or am I spinning my wheels trying to accomplish?
    2) They've prepped the buttons as if rollovers in a Flash presentation - the normal state has an image with a white border around it and title underneath - but the selected state has those as black PLUS a small arrow pointing at the title. I can't do a straight shape with text, because the arrow element will be present in all states. I can't do a layered menu because of the motion background. So what I've come up with is embedding the normal states of the button (white, without the arrow) into the motion background, and then create a shape with the text (black, with the arrow) but with only the highlight layer and no shape layer so that only the black highlight layer shows up over it when selected. This works, but I have to position it PRECISELY over the background normal button, or else white edges show and it gets ugly. So, is there a better way to do this that I'm overlooking?
    Thanks very much to anyone who has taken the time to read this novel, and even more thanks to anyone who has some insight into any possible solutions (or lack thereof).

    There is another way, but it's tricky.
    You create a series of menus that are almost identical. In the first, all buttons show still images, and the button auto activates to a copy of the menu where the appropriate button shows a video. If you have four buttons, you'll need five menus all exactly the same except in the last four, single buttons have video, others are stills. Every button that is a still auto activates to go to the appropriate menu where that button has video. Every video based button links to the relevant track.
    In practice, the user will see a still image, and when they select it (or roll over with a mouse if on a computer) the menu will jump to the associated sub menu where that button now has video and the others show stills.
    The problem here is that on some (most) players there will be a pause between the menus, and it won't be a slick and quick change.
    Using the masking technique is better in lots of ways, however as Drew said it will be hard to match the colours. Also, the mask shape will need to be your 'still' image (which might help obscure the colour differences) and this can only have four colours.
    A further consideration is that the mask shape will be part of the button highlight (well.... it will BE the button highlight) and as such will exist in the subpicture stream. It is impossible to guarantee that this will stay in place or be in place when leaving or entering a menu. In effect, when you click a button the first thing to disappear is the sub picture stream, which means all of your videos will be visible for a fraction of a second, or perhaps slightly longer. Secondly, when entering a menu, the last thing to be created is the subpicture stream, which means that all of your button videos will be showing for a fraction of a second until they get covered.
    The amount of delay in each case will depend on the player. For some it'll be tiny. For others it'll be seconds and will ruin the effect you are looking for.
    I would probably prefer the delay as you change menus to the revelation of all the button videos, but you'll have to decide for yourself which is better!

  • Is it possible to nest SELECT statements?

    Greetings community,
    Another newbie’s question it is. Looking tutorials and some posts here I’ve been advised not to pull entire table through the local network, and torture client machines’ processors and memory. It’s been said that better solution is to
    pull just one part of the table.
    So, imagine this: you want to make a part of your app that would allow your user to view list of orders. So you put one data grid view on the form, pull last 20 headers from the table into it and leave to user to choose one to be opened
    in another form. If user doesn’t find header they want, they press page up for example and previous 20 headers are loaded into data grid view. Of course, user could filter headers list by customer, or by distribution lane (having all customers residing in
    one part of the town), or whatever more, but let’s not complicate things at this moment, because I’m practically in the beginning.
    I’m trying to make a stored procedure that would load penultimate 20 headers when user presses page up. So, not knowing any better, I created table variable that has the same structure as Orders table with one difference: OrderID column,
    which is identity (auto incremented) in Orders table, here is simply defined as bigint not null. Community member Visakh16 warned me few months ago it’s the bad practice to put self-incrementing columns in table variables.
    At this moment there’s a query on my screen, which waits to become store procedure. After boring part with table variable definition, it goes like this:
    INSERT INTO @OrdersTemp SELECT TOP 40 * FROM dbo.Orders ORDER BY OrderID DESC
    SELECT TOP 20 * FROM @OrdersTemp ORDER BY OrderID ASC
    To put that simply, I pull last 40 headers into table variable, and then pull first 20 from there. This thing works, and I just have to replace 40 with parameter, for every page up or down.
    Now I have few questions.
    -Is there some better way (considering performance) to achieve that? Here is the place where I wanted to ask the question from the title of the post. I don’t know much about T-SQL, and I’m not sure about the proper syntax to nest SELECT
    statements, if something like that is even possible
    -Is there any better way (some built-in function) to find about the count of the rows in one table than
    SELECT COUNT(OrdersID) FROM dbo.Orders
    Thanks for any suggestions.

    Hi Erland,
    Sorry for the very late reply, but I said that I would start another thread when I find more free time to dedicate it to this, so I didn’t really expected you to reply anymore. I didn’t really check here for more than a week, and I glanced
    at mail accidentally.
    As for the negative result I got, its measurement unit is microsecond, so it doesn’t go out of margins you had experienced.
    As for the number of cores, you got me surprised there. I use express edition of SQL server. Last time I checked was SQL server 2012 express, and in specifications it said that express edition is limited to 1 processor core, 1GB of RAM
    and creates up to 10GB database file. I don’t believe they changed any of those specifications. It was generous enough when they doubled size of DB file few editions ago. Still, it appears that “one processor core for express edition” statement has some gray
    areas in it.
    However, at this moment I’m just learning, and I just wanted some way to test how efficient my queries are. I don’t have a real biz problem to solve. I don’t expect that any real performance problem should rise in years of everyday work
    of populating database. What I expect is performance impact when it comes to creating reports, but after all, I don’t think that my boss would create reports by himself. I believe that creating reports would be my task, and I will be doing it after hours,
    being the only user at the moment. Or maybe I could make de-normalized copy of database that would be populated after hours to make it possible for my boss to get his reports faster by himself, as I’ve heard that was the way of making BI in older non-express
    editions.
    So, I do suggest that we finally close this thread for sake of other readers. I’ll start another one with this subject when I find the time to do it.
    Again, thanks for being with me along this journey.

  • Selected state issue with Menu Module V2

    OK so I am getting an issue with Menu Module V2. I have used this before with success but this time I have hit a wall. I possed this question to BC live chat and they bugged out real quick.
    The site in construction is http://www.urbanista.com.au
    What is happening is that in the top right tools nav with the headings Home, Services, People, Contact Us using Menu Module V2. The Heading Services has a drop down and this is where the issue resides. Roll over any of these nav devices and you will see they will highlight orange. Home is already auto activating its Selcted state. Click on Contact Us and it will do the same.  Roll over and click on Services and it appears to have worked. While in Services roll over the drop down again and you will see all links have activated the Selected state. This is the issue. If you view the code of the Services UL you will see only the Services state has been alocated the Slected state. See below:
    <li id="Services" class="selected">
    <a href="/services.htm">Services</a>
    <ul>
    <li id="tools-panningdev">
    <li id="tools-housing">
    <li id="tools-urban-renewal">
    <li id="tools-project-management">
    <li id="tools-feasibility-tools">
    <li id="tools-governance-systems">
    <li id="tools-communications">
    <li id="tools-projects">
    </ul>
    </li>
    The CSS that runs the nav is as follows:
    ul.dropdown {
        font-weight: normal;
        font-family: Arial, Helvetica, sans-serif;
        font-style: normal;
        text-decoration: none;
        ul.dropdown li {
        background-color: transparent;
        color: #999;
        padding-top: 5px;
        padding-right: 10px;
        padding-bottom: 5px;
        padding-left: 10px;
        font-size: 12px;
        ul.dropdown li.hover,
        ul.dropdown li:hover {
        background-color: transparent;
        color: #FFF;
        ul.dropdown a:link,
        ul.dropdown a:visited    {
        color: #FFF;
        text-decoration: none;
        ul.dropdown a:hover        { color: #ff871f; }
        ul.dropdown a:active    {
        color: #b33b00;
        /* -- level mark -- */
        ul.dropdown ul {
        width: 150px;
        margin-top: 1px;
        background-image: url(/images/nav-transparency.png);
        background-repeat: repeat;
        color: #FFF;
        ul.dropdown ul li {
        font-weight: normal;
    ul.dropdown li.selected a {
        color: #ff871f;
    The last entry 'ul.dropdown li.selected a {color: #ff871f;}' is required in order to allocate a Slected State. Without it not Selected state is active and the links al remian white.
    I have tried all manner of combinations and additonal tags with no success. Any suggestions greatly appreciated. I have not modified the default Javascript provided by BC in the system apart from allocating the required ulTagClass as specified. The Javascript in the supplied 'container.html' is as follows:
    <script type="text/javascript" >
        // ids need to be unique per page, use different ones if you are including multiple menus in the same page
        // id of the nav tag, used above
        var divTagId = "myMenu1";
        // desired id for 1st <ul> tag
        var ulTagId = "myMenu1List";
        // desired class for 1st <ul> tag
        var ulTagClass = "dropdown dropdown-vertical";
        if ((null !== ulTagId) && ("" !== ulTagId)) {
            document.getElementById(divTagId).getElementsByTagName("ul")[0].setAttribute("id",ulTagId );
        if ((null !== ulTagClass) && ("" !== ulTagClass)) {
            document.getElementById(divTagId).getElementsByTagName("ul")[0].className = ulTagClass;
        // this will set the selected state
        if ((null !== ulTagId) && ("" !== ulTagId)) {
            catSetSelectedCSSItem(ulTagId);
    </script>
    Lastly this is one of the recomended navs by BC at the following address: http://lwis.net/free-css-drop-down-menu/
    I have used these before with success but for the life of me this has stumped me big time.

    Hi Matthew,
    Having a super quick look at the code I'd say it's because of:
    ul.dropdown li.selected a {
        color: #ff871f;
    This affects all the child elements.
    To override this down the line you could do something like:
    ul.dropdown li.selected ul li a {
        color: #fff;
    This would override the parent link color when selected.
    You could probably then also add:
    ul.dropdown li.selected ul li.selected a {
        color: #ff871f;
    For the dropdown selected states.
    That's a quick look though so don't quote me too much

  • Button animation in selected state.

    Can I have a video or animation playing on a button only in the selected state(and still in the the other state)?
    atm I can have a video looping in in a normal menu but this dosen't work in a layered menu?

    I replied in the other thread you posted to.
    Since layered menus are effectively a series of normal menus linked by auto-activating buttons, you can have a "selected" version of your menu that has each button animating by itself. Then when you navigate to that button, it can auto-activate and jump to the appropriate animated menu with the correct button animating.
    As I said in the other thread, the drawback is that navigation from button to button is slow.

  • Select statement is slow

    Hi Folks,
    I thought maybe you could help me here -
    Oracle version is 9.2.0.7
    I am running a select statement against a table. There are no filter conditions
    The statement is
    SELECT * from Table1
    This statement takes 500 sec to execute before I see any data. The table has around 1 million records.
    There is no VPD on the table; there are no locks or latches on the table when the query is executed.
    Other issues with the table are:
    1. SQL*Loader takes 2-3 hours to load data
    2. A simple delete of 1 record takes 1 hour (there are no constraints on this table).
    I monitored the WAIT events: I see db file scattered read and a lot of time is spent on db_single_file_read.
    This happens in production. The server has 8 CPUs and I am the only user logged in.
    These issues are not observed in UAT environment.
    In production, workarea_size_policy is set to AUTO and db_cache_advice is ON.
    The same parameters are set to MANUAL and READY, respectively, in UAT.
    Any suggestions on why getting the first record using a straight SELECT statement would take 500 sec?
    Thanks

    Justin here are the Trace details:
    The wait is on db_file_scattered_read: 700+sec
    The SELECT statement executed is
    SELECT * from tmpfeedsettlement where rownum < 10
    Used 10046 events with level 12
    TKPROF: Release 9.2.0.1.0 - Production on Thu May 24 12:44:19 2007
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Trace file: v:\shakti\o01scb3_ora_14197.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
    alter session set sql_trace=true
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer goal: CHOOSE
    Parsing user id: 296  (P468707)
    alter session set events '10046 trace name context forever,level 12'
    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        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 296  (P468707)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       1        0.00          0.00
      SQL*Net message from client                     1       22.45         22.45
    select *
    from
    tmpfeedsettlement where rownum < 10
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2    102.42     765.63     977140     977202          0           9
    total        4    102.43     765.63     977140     977202          0           9
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 296  (P468707)
    Rows     Row Source Operation
          9  COUNT STOPKEY
          9   TABLE ACCESS FULL TMPFEEDSETTLEMENT
    Rows     Execution Plan
          0  SELECT STATEMENT   GOAL: CHOOSE
          9   COUNT (STOPKEY)
          9    TABLE ACCESS   GOAL: ANALYZED (FULL) OF 'TMPFEEDSETTLEMENT'
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net more data to client                     2        0.00          0.00
      db file scattered read                      61181        5.62        719.27
      db file sequential read                         7        0.00          0.00
      SQL*Net message from client                     2      336.11        336.12
    alter session set sql_trace=false
    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        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 296  (P468707)
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        3      0.01       0.00          0          0          0           0
    Execute      4      0.00       0.00          0          0          0           0
    Fetch        2    102.42     765.63     977140     977202          0           9
    total        9    102.43     765.64     977140     977202          0           9
    Misses in library cache during parse: 3
    Misses in library cache during execute: 1
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       3        0.00          0.00
      SQL*Net message from client                     3      336.11        358.57
      SQL*Net more data to client                     2        0.00          0.00
      db file scattered read                      61181        5.62        719.27
      db file sequential read                         7        0.00          0.00
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      0      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        0      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
        4  user  SQL statements in session.
        0  internal SQL statements in session.
        4  SQL statements in session.
        1  statement EXPLAINed in this session.
    Trace file: v:\shakti\o01scb3_ora_14197.trc
    Trace file compatibility: 9.00.01
    Sort options: default
           1  session in tracefile.
           4  user  SQL statements in trace file.
           0  internal SQL statements in trace file.
           4  SQL statements in trace file.
           4  unique SQL statements in trace file.
           1  SQL statements EXPLAINed using schema:
               P468707.prof$plan_table
                 Default table was used.
                 Table was created.
                 Table was dropped.
       61246  lines in trace file.

  • Javascript and sql select statement

    I am working in html db in the 10 g environment. I'm trying to create an "auto suggestion function" that predicts values as the user enters characters into a text field. I've gotten it to work by hard coding the values in the function, ie: states. btw: there are several external javascript files at work here.
    What I want is to create a dynamic link to the database to gather, say, all names of providers at the time the page is built to use in the auto suggest format. I want to put this into a javascript routine and I'm having problems finding out how to mix the sql select statement into the javascript function.
    For the states example, I'm using:
    function StateSuggestions() {
    this.states = [
    "Alabama", "Alaska", "Arizona", "Arkansas",
    "California", "Colorado", "Connecticut",..."Wyoming" ];
    Can I substitute the hard coded data (states) with a sql select statement such
    as:
    select name from <dbtable> ???
    How does this need to be "wrapped" or containerized?
    Thank you. You have a great product in html db and your site is very useful. I appreciate everything you have done to assist us. Again, thank you.

    Hi,
    You can use TRUNC with 2 arguments to get the first DATE in a month, year, quarter, week, hour, minute, ISO year, ...
    SELECT  TRUNC ( ADD_MONTHS ( SYSDATE
                               , 12
                  , 'MONTH'
                  )     AS first_of_month
    FROM    dual
    ;The DATE returned will be in the same month, year, quearter, ... as the first argument.
    \We convered the last day of the month in [your previous question|http://forums.oracle.com/forums/message.jspa?messageID=3942939#3942939].
    At that time, I warded about using LAST_DAY as a cutoff point; TRUNC is a much better way.
    For example, to find all appointment_dates in the current month next year:
    SELECT  *
    FROM    appointments
    WHERE   appointment_date >= TRUNC (ADD_MONTHS (SYSDATE, 12), 'MONTH')
    AND     appointment_date <  TRUNC (ADD_MONTHS (SYSDATE, 13), 'MONTH')Note that
    the first part of the WHERE clause calls for dates on or equal to the beginning of the 12th month in the future, but
    the second part of the WHERE clause calls for dates before, not equal to , the beginning of the 13th month in the future.

  • How do you set auto retry on sending email?

    I have a problem that sometimes when sending an email from iphone4 that it won`t send if out of signal but doesn`t seem to then automatically send when signal strong enough. Is this normal and is there anyway settings can be changed to auto retry on sending?

    It is my understanding with a message that cannot be sent for whatever reason and remains in the Outbox mailbox, the message will be sent automatically when an internet connection is re-established when selecting the Mail app. There is no setting for this.

  • If statement in select statement alias

    I have the following select statement. It has the alias Survivors, Deaths and "All Cases". Is it posible to use :P_LANGUAGE variable to say that -- IF :P_LANGUAGE = FRENCH THEN alias are Survivants for survivors, Décès for Deaths, Tous_les_cas for All Cases. Please advise
    SELECT ALL T_NTR_MULTIBAR.CAT, T_NTR_MULTIBAR.NUM_CASES_LEFTBAR AS Survivors,
    T_NTR_MULTIBAR.NUM_CASES_MIDDLEBAR AS Deaths, T_NTR_MULTIBAR.NUM_CASES_RIGHTBAR AS "All Cases"
    FROM T_NTR_MULTIBAR
    WHERE INSTANCE_NUM = :P_INSTANCENUM
    order by ORDERS

    You may not be able to add this condition inside the SQL Statement. But you can add this condition outside the statement, if you're using PL/SQL...
    IF :p_language = french THEN
    SELECT ALL t_ntr_multibar.cat,
      t_ntr_multibar.num_cases_leftbar AS survivors,
      t_ntr_multibar.num_cases_middlebar AS deaths,
      t_ntr_multibar.num_cases_rightbar AS "All Cases"
    ELSE
    END IF;

  • How to get all values from an interval using select statement

    Hi,
    Is it possible to write a select statement that returns all values from an interval? Interval boundaries are variable.
    something like this:
    select (for x in 1,1024 loop x end loop) from dual
    (this, of course, doesn't work)
    The result in this example should be 1024 rows of numbers from 1 to 1024. These numbers are parameters, so it is not possible to create a table with predefined values.
    Thanks in advance for your help,
    Mia.

    For your simple case, with a lower boundary of 1, you can use:
    SELECT rownum
    FROM all_objects
    WHERE rownum <= 1024For a set of number between say 50 - 100, you can use something like:
    SELECT rownum + (50 - 1)
    FROM all_objects
    WHERE rownum <= (100 - 50 + 1)Note, that all_objects was used only because it generally has a lot of rows. Any table with at least the number of rows in your range will work.
    TTFN
    John

  • Select statement operators in ecc 6.

    Hi Experts,
    I have a small doubt about the '>=' ( greater than or equal to ) operator usage in select statement. Is this operator by any chance perform not as desired in ECC 6.0. Is it a good option to use 'GE' instead of '>='. ?
    It may sound a bit awkward, but still I would like to know. I am facing a situation, which could be related to this. An early response would be highly appreciated.
    I would request,you NOT TO REPLY with links/explanations which says how to use select statement. Only answer if you have the  answers related to this query.
    Regards,
    Sandipan

    >
    Jaideep Sharma wrote:
    > Hi,
    > The only difference is GE will take a little more time than >= as system need to convert the keyword into actual operator when fetching data from Database.
    >
    > KR Jaideep,
    ????? Every Open SQL statements is translated to the SQL slang the underlying database is talking regardless if you type GE or >=
    If the result differs using >= or GE i would open a call at SAP instead of asking in SDN.

  • How to find the number of fetched lines from select statement

    Hi Experts,
    Can you tell me how to find the number of fetched lines from select statements..
    and one more thing is can you tell me how to check the written select statement or written statement is correct or not????
    Thanks in advance
    santosh

    Hi,
    Look for the system field SY_TABIX. That will contain the number of records which have been put into an internal table through a select statement.
    For ex:
    data: itab type mara occurs 0 with header line.
    Select * from mara into table itab.
    Write: Sy-tabix.
    This will give you the number of entries that has been selected.
    I am not sure what you mean by the second question. If you can let me know what you need then we might have a solution.
    Hope this helps,
    Sudhi
    Message was edited by:
            Sudhindra Chandrashekar

  • Use of LIKE in where clause of select statement for multiple records

    Hi Experts,
    I have a account number field which is uploaded from a file. Now this account numbers uploaded does not match fully with sap table account numbers but it contains all of the numbers provided in the file mostly in the upright positions.
    For example in file we have account number as 2ARS1 while in sap table the value is 002ARS1.
    And i want to fetch data from sap table based on account number uploaded. So, i am trying to use LIKE with for all entries but its not working as mentioned below but LIKE is not working with FOR ALL ENTRIES.
    data : begin of t_dda occurs 0,
            dda(19) type c,
           end of t_dda.
    data : begin of t_bukrs occurs 0,
            bukrs type t012k-bukrs,
           end of t_bukrs.
    data : dda type t012k-bankn,
           w_dda type t012k-bankn.
    CONCATENATE '%'
                             '2ARS1'
                     INTO  W_DDA.
    MOVE W_DDA TO T_DDA-DDA.
    APPEND T_DDA.
    CLEAR T_DDA.
    free t_bukrs.
    SELECT BUKRS
      FROM T012K
      into TABLE t_bukrs
        for all entries in t_dda
    WHERE BANKN like t_dda-dda.
    Can anybody suggest what should i use to get the data for multiple account numbers using one select statement only instead on using SELECT UP TO 1 ROWS in LOOP....ENDLOOP ?
    Thanks in advance,
    Akash

    Hi,
    yes, For All entries won't work for LIKE with '%  '.
    I think the other alternative is go for Native SQL by writing sub-query
    sample code is here:
    data: begin of i_mara occurs 0,
              matnr like mara-matnr,
              matkl like mara-matkl,
           end of i_mara.
    exec sql.
    select matnr, matkl from mara where matnr in (select matnr from marc) and matnr like '%ma' into :i_mara
    endexec.
    loop at i_mara.
    write:/ i_mara-matnr, i_mara-matkl.
    endloop.
    hope u got it.
    regards
    Mahesh
    Edited by: Mahesh Reddy on Jan 21, 2009 2:32 PM

  • What is the use of additon in up to 1 rows in SELECT statement

    Hi All,
             What is the use of up to 1 rows in select statement.
    for example
    SELECT kostl
          FROM pa0001
          INTO y_lv_kostl UP TO 1 ROWS
          WHERE pernr EQ pernr
          AND endda GE sy-datum.
        ENDSELECT.
    I'm unable to get in wat situations we hav to add up to 1 rows
    please help me out...
    Thanks,
    santosh.

    Hi,
    Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
    The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Regards,
    Bhaskar

Maybe you are looking for

  • Toshiba TV 2998ASU - sound but no image

    Hello friends I need you help I have a television toshiba 2998asu The sound of the DvD functions but the image does not appear in the screen. Please can I have an opinion, a tip. Please it sends the manual for me?

  • Widescreen has black bars top and bottom

    Imported a widescreen DV file into FCP5, rendered it, looks widescreen in the canvas but has black bars which are always exported. But I want to end up with a DVD that is full screen/widescreen when viewed on a widescreen TV or LCD monitor. How to ge

  • Duplex Printing for Officejet 5740

    I recently purchased an Officejet All-In-One 5740 printer. I did not realize that automatic duplex was a default and not an option. I can't find a way to change to 1-sided print (there is no selection in Properties). Is there an allowance for 1-sided

  • Disk Utility won't run with Snow Leopard

    I updated to Snow Leopard 10.6.2 and now when I run Disk Utility.app it says that it is version 11.1 and will not run. I'm not sure why this app didn't update at the same time. Where can I download 11.5 Disk Utility? Thanks!

  • Accessing shared pictures from a NAS

    Hello, I have read many topics of this support before asking this question. I didn't find the answer but I found that many users are very helpful. _So, my problem is:_ I have a NAS (network attached storage) connected to the airport extreme, and I ha