Query the database;

Hello;
My application is running the following query:
SELECT NULL AS pktable_cat,
      p.owner as pktable_schem,
      p.table_name as pktable_name,
      pc.column_name as pkcolumn_name,
      NULL as fktable_cat,
      f.owner as fktable_schem,
      f.table_name as fktable_name,
      fc.column_name as fkcolumn_name,
      fc.position as key_seq,
      NULL as update_rule,
      decode (f.delete_rule, 'CASCADE', 0, 'SET NULL', 2, 1) as delete_rule,
      f.constraint_name as fk_name,
      p.constraint_name as pk_name,
      decode(f.deferrable, 'DEFERRABLE',5 ,'NOT DEFERRABLE',7 , 'DEFERRED', 6 ) deferrability
FROM all_cons_columns pc,
      all_constraints p,
      all_cons_columns fc,
      all_constraints f
WHERE 1 = 1 AND
      p.table_name = '?' /*Bind1*/ AND
      p.owner = '?' /*Bind2*/ AND
      f.constraint_type = 'R' AND
      p.owner = f.r_owner AND
      p.constraint_name = f.r_constraint_name AND
      p.constraint_type = 'P' AND
      pc.owner = p.owner AND
      pc.constraint_name = p.constraint_name AND
      pc.table_name = p.table_name AND
      fc.owner = f.owner AND
      fc.constraint_name = f.constraint_name AND
      fc.table_name = f.table_name AND
      fc.position = pc.position
ORDER BY fktable_schem, fktable_name, key_seq
We use the CF9 and the database is ORACLE 11G.
The same is performed several times a day and it's hurting the performance of queries in my system. How to fix it, or remove from the application;
It is executed by the same driver ?
thanks;
Jaider Fraga;

Hello
As Mr Dan mentioned, you can do move the condition mentioned in 'where' clause to Join statements .Something like below
SELECT NULL AS pktable_cat,
      p.owner as pktable_schem,
      p.table_name as pktable_name,
      pc.column_name as pkcolumn_name,
      NULL as fktable_cat,
      f.owner as fktable_schem,
      f.table_name as fktable_name,
      fc.column_name as fkcolumn_name,
      fc.position as key_seq,
      NULL as update_rule,
      decode (f.delete_rule, 'CASCADE', 0, 'SET NULL', 2, 1) as delete_rule,
      f.constraint_name as fk_name,
      p.constraint_name as pk_name,
      decode(f.deferrable, 'DEFERRABLE',5 ,'NOT DEFERRABLE',7 , 'DEFERRED', 6 ) deferrability
FROM all_cons_columns pc ,
      INNER JOIN all_constraints p ON
               p.table_name = '?' /*Bind1*/ AND
               p.owner = '?' /*Bind2*/ AND,
               p.constraint_type = 'P' AND,
               pc.owner = p.owner AND,
               pc.constraint_name = p.constraint_name AND,
               pc.table_name = p.table_name
      INNER JOIN all_cons_columns fc ON
               fc.position = pc.position
      INNER JOIN all_constraints f
               f.constraint_type = 'R' AND
               p.owner = f.r_owner AND
               p.constraint_name = f.r_constraint_name AND
               fc.owner = f.owner AND
               fc.constraint_name = f.constraint_name AND
               fc.table_name = f.table_name
WHERE 1 = 1
ORDER BY fktable_schem, fktable_name, key_seq
Advantage is that if you are using the conditions in join statement the query results are filtered on joinning tables itself rather than taking the whole data and gets filtered by where clause. This will improve the query performance and the results will also be correct ones
Hope this help
Regards
Sreekar

Similar Messages

  • Exception when querying the database

    Hi
    I'm using jtds driver to connect to the database, it's been working fine all along and now all of a sudden it's giving exceptions when I query the database and It requires me to logout and login to my application again.
    The exception is as follows
    javax.servlet.ServletException: Could not execute query
            at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
            at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
            at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
            at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
            at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
            at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
            at java.lang.Thread.run(Thread.java:534)
    root cause
    net.sf.hibernate.exception.GenericJDBCException: Could not execute query
            at net.sf.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:80)
            at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
            at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
            at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4131)
            at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1557)
            at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1531)
            at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1523)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
            at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
            at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
            at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
            at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
            at java.lang.Thread.run(Thread.java:534)
    Caused by: java.sql.SQLException: Invalid state, the Connection object is closed.
            at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1305)
            at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java:1978)
            at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:216)
            at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:323)
            at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:263)
            at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:236)
            at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:67)
            at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:784)
            at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
            at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
            at net.sf.hibernate.loader.Loader.doList(Loader.java:1063)
            at net.sf.hibernate.loader.Loader.list(Loader.java:1054)
            at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
            at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1554)
            ... 42 moreCan it maybe be the large size of the dabase?
    What can be wrong?

    java.sql.SQLException: Invalid state, the Connection object is closed
    It answers your question to an extent. Check if your connection or recordset object is closed
    cheers,
    Siddhs

  • How to query the database periodically???

    Hi,
    i would like to do a certain task ( like fetching the database, etc) in a particular interval time. For example, my program has to query the database in every 15 mins and display the record if any new record added in the table.
    Any one please help me in this and if possible, please give me a sample code.

    Hi,
    Yes, the delay is 1000 ms ( 1 sec) but the program runs only 12 secs because the main thread sleep only 12000 ms.
    public static void doMain()
    *throws Exception {*
    Timer t = new Timer(true);
    t.schedule(new Ping("Fixed delay")
    *, 0, 1000);*
    Thread.currentThread().sleep(12000);
    After 12000 ms, the program stops running.
    But my requirement is, my program runs continuously for a particular period of time without stops running. ( for example, if i give a period of time is 2 to 6, the program runs in every 1000 ms delay between 2pm to 6pm without stops running).
    Please help me in this.......

  • How to query the database in an Entity Object (EO)

    I am using JDeveloper 11.1.2.2.0
    I am Forms developer working in a new ADF project and need some help from the ADF gurus, I am just a ADF beginner.
    Maybe hits question has a easy solution, but I don't know how to implement this:
    I have simplified my scenario, but this is what I Need to do:
    One database table DBTABLE with 3 columns (C1,N1,D1) C1-varchar2; N1-Numeric; D1-Date.
    In the DBTABLE I have the following data:
    ONE; 10; 01/10/2012
    ONE; 20; 02/10/2012
    TWO; 15; 02/10/2012
    ONE; 15; 03/10/2012
    I have created an ADF EO for the DBTABLE with all 3 attributes, then I have created another transient numeric attribute T1.
    My requirement is when I create a new record and set attribute C1=ONE the transient attribute T1 should show sum(N1) from DBTABLE where D1>= 01/10/2012 and D1 < 03/10/2012.
    In this case when I create a new record should the shown in T1 a total of 10+20 = 30.
    I know how to use the EOImpl getters and setters, and how to set the T1 attribute when C1 is set. My problem is how to calculate the total T1.
    How can I implement this in ADF? It is possible to implement this in the EO? It is possible to make the query select sum(N1) from DBTABLE where D1>= 01/10/2012 and D1 < 03/10/2012 and return the value to the EO attribute?
    Thank you in advance

    Hi Peter
    Thank you for your suggestions, both of them are interesting but unfortunately they do not solve my problem, or at least I don’t know how.
    I will try to better explain my problem
    I have te table DBTABLE and another related table called DBDATES with colums(C1,DT1,DT2,TARGET) where I record periods of time and desired target. For instance my DBDATES table could have the following records
    ONE; 01/01/2012; 31/01/2012; 100
    ONE; 01/02/2012; 29/02/2012; 90
    ONE; 01/03/2012; 31/03/2012; 95
    TWO; 01/01/2012; 31/01/2012; 140
    Exist a FK between both tables in the C1 column.
    I have created an EO for the table DBTABLE with the tree persistent attributes (C1, N1, D1) an transient attribute (T1). The (C1,D1) is my DB primary key.
    When I create a new record in the DBTABLE and based in the actual date I need to query the DBDATES table to check which is my TARGET and the valid target dates. For Instance if a record for person ONE is created on February 12, my TARGET is 90 from 01/02/2012 to 29/02/2012.
    At the same moment I need to check the total amount of items record to the person ONE during the full target period.
    Select sum(N1)
    From DBTABLE
    Where D1 between V2 and V3
    And C1= V1;
    Bind variables:
    V1 = ‘ONE’;
    V2 = ‘01/10/2012’ – queried from DBDATES
    V3 = ‘03/10/201’ – queried from DBDATES
    In resume, for a determined person when I create a new record in the DBTABLE I need to know their target for the actual period and how much as been record until now.
    I don't know if is possible to solve this without using the View Objects, because I need to query the DBTABLE for a time frame and with bind variables.
    Thank you in advance for your help.

  • Is there a way to force a View Object to query the database always?

    Dear All,
    Is there a way to force a view object to always scan the database table to read the latest data?
    Here's my use case.
    I have a page that loads data then I have a button which executes the following code.
    viewObject.setApplyViewCriteriaName("SampleCriteria");
    viewObject.setNamedWhereClauseParam("arg1", "test");
    viewObject.executeQuery();
    RowSetIterator it = viewObject.createRowSetIterator(null); 
    while(it.hasNext()) {
         /* More Code */
    }Suppose after page load, I edited some row in the table and then I clicked the button. I notice that my edited row
    was not reflected in the query.
    I am not sure but is there some configuration to check so that when the viewobject executes it will always query the data
    from the table?
    I am thinking that there is some level of caching and I want to disable it. If I restart my application, I notice that it is able to read the latest data.
    JDEV 11.1.1.5

    By default a view object performs its query against the database to retrieve the rows in its resulting row set. However, you can also use view objects to perform in-memory searches and sorting to avoid unnecessary trips to the database.
    The view object's query mode controls the source used to retrieve rows to populate its row set. For more details please refer: http://docs.oracle.com/cd/B31017_01/web.1013/b25947/bcadvvo005.htm
    Also, see if this helps: setQueryMode for secondary rowSet not working

  • Do EntityManager queries actually query the database?

    When I write a method that returns object(s) based on an EntityManager query,
    return em.createQuery("select object(o) from Address as o").getResultList();Is that query actually looking at the database and getting the most recent data?
    For example, I manually change an address using SQL right in the database, not using the entity manager inside the application. Will the application see that change If I am getting addresses using an entity manager query? Or do I have to restart the server in order to refresh the entity data?

    Hi,
    It's not guaranteed that you get the data from the database, if the entities with the same PK has been loaded by an entity manager prior to the query. To solve the problem, you'll need to either call em.refresh() on each resulting object, or use persistence-provider specific query hints, or caching options.
    Regards,
    -marina

  • Need to query the database to get the last sequence number

    Hi all
    I am trying to get the last sequence number of the last row inserted into my Oracle database. Please could someone give me the SQL which would allow me to do this - using Oracle SQL Explorer I have confirmed that there is a sequence on the table which is called: XYZ_SEQ and the code for this is:
    CREATE SEQUENCE "MY_USER_NAME"."XYZ_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
    My Java application is inserting a row into my table and to insert a new row I need to have the last sequence inserted +1 so the new row can be added.
    Any help would be much appreciated.

    Hi,
    Welcome to the forum!
    If you are using a sequence just do (example):
    INSERT INTO TABLE_NAME
       (COL1,
        COL2)
    VALUES
       (SEQUENCE_NAME.NEXTVAL,
        OTHER_VALUE);to obtain (and use) the next number in the sequence when you are inserting.
    If you have a sequence to use for a specific table, you should use it when your insert new data (no matter your are doing that: java application, procedure, etc). Doing this you avoid some problems when you have the sequence 'out of date' about the associated data.
    Regards,
    Edited by: Walter Fernández on Sep 19, 2009 10:08 AM
    Edited by: Walter Fernández on Sep 19, 2009 10:10 AM

  • Subreport tabs are re-querying the database when changing tabs

    I've got a simple report with embedded subreports that open in a new tab in the viewer.  When I switch between tabs, the tab is re-running the query and rebuilding the report or subreport.  Is there a way to prevent this and just display the already-rendered report?

    start with storing the report in session so that it uses the session object on each postback (paging, drilling, etc all cause postbacks) instead of reopening the report each time.

  • Querying the MIB for estabilished database connectivity

    Hi
    Fairly new to the MIB and its internal workings.
    Can someone explain or provide an exampe ud script to determine database connections that are currently running.
    Configuration currently has the followin database connections:- Oracle 10g, DSM, Supra(IBM) and IDMSX(ICL)
    Take it the above should not make any difference.
    Need to understand what TA_CLASS, TA_OPERATION etc I need to query?
    Regards Sam

    Sam,
    The current state of the connection between a Tuxedo server and its
    asssociated resource manager is not part of the information offered by
    tmadmin or by the Tuxedo MIB, so the best way to obtain this information is
    by querying the database for active connections in its own specific way.
    Another way to obtain this information is to implement a simple service that
    makes one database call and to invoke this service to see if the database
    connection is active.
    It is also possible to perform a GET operation on the T_ULOG TM_MIB class
    and search for specific userlog messages that your application has seen when
    there is a database connection failure.
    Ed
    <Sam Dhooper> wrote in message news:[email protected]..
    Hi
    Fairly new to the MIB and its internal workings.
    Can someone explain or provide an exampe ud script to determine database
    connections that are currently running.
    Configuration currently has the followin database connections:- Oracle 10g,
    DSM, Supra(IBM) and IDMSX(ICL)
    Take it the above should not make any difference.
    Need to understand what TA_CLASS, TA_OPERATION etc I need to query?
    Regards Sam

  • How I can transfer data from the database into a variable (or array)?

    I made my application according to the example (http://corlan.org/2009/06/12/working-in-flash-builder-4-with-flex-and-php/). Everything works fine. I changed one function to query the database - add the two parameters and get the value of the table in String format. A test operation shows that all is ok. If I want to display this value in the text area, I simply drag and drop service to this element in the design mode
    (<s:TextArea x="153" y="435" id="nameText" text="{getDataMeanResult.lastResult[0].name}"  width="296" height="89"  />).
    It also works fine, just a warning and encouraged to use ArrayCollection.getItemAt().
    Now I want to send the value to a variable or array, but in both cases I get an error: TypeError: Error #1010: A term is undefined and has no properties..
    How can I pass a value from the database into a variable? Thank you.
    public var nameTemp:String;
    getDataMeanResult.token = authors.getDataMean(arrayOfNumber[0], dir_id);
    nameTemp = getDataMeanResult.lastResult[0].name;
    public var nameArray:Array = new Array();
    for (var i:uint=o; i<3; i++){
    getDataMeanResult.token = authors.getDataMean(arrayOfNumber[i], dir_id);
    nameArray[i] = getDataMeanResult.lastResult[0].name;
    And how i can use syntax highlighting in this forum?

    Astraport2012 wrote:
    I have to go back to the discussion. The above example works fine when i want to get a single value of the database. But i need to pass an array and get an array, because i want to get at once all the values for all pictures tooltips. I rewrote the proposed Matt PHP-script and it works. However, i can not display the resulting array.
    yep, it won't work for Arrays, you'll have to do something slightly more intelligent for them.
    easiest way would be to get your PHP to generate XML, then read that into something like an ArrayList on your HTTPService result event (depends what you're doing with it).
    for example, you could have the PHP generate XML such as:
    <pictures>
         <location>test1.png</location>
         <location>test2.png</location>
         <location>test3.png</location>
         <location>test4.png</location>
         <location>test5.png</location>
         <location>test6.png</location>
    </pictures>
    then you'll read that in as the ResultEvent, and perform something like this on it
    private var tempAC:ArrayList = new ArrayList
    protected function getStuff_resultHandler(event:ResultEvent):void
        for each(var item:Object in event.result.pictures)
           var temp:String = (item.@location).toString();
           tempAC.addItem(temp);
    in my example on cookies
    http://www.mattlefevre.com/viewExample.php?tut=flash4PHP&proj=Using%20Cookies
    you'll see an example of how to format an XML structure containing multiple values:
    if($_COOKIE["firstName"])
            print "<stored>true</stored>";
            print "<userInfo>
                    <firstName>".$_COOKIE["firstName"]."</firstName>
                    <lastName>".$_COOKIE["lastName"]."</lastName>
                    <userAge>".$_COOKIE["userAge"]."</userAge>
                    <gender>".$_COOKIE["gender"]."</gender>
                   </userInfo>";
        else
            print "<stored>false</stored>";
    which i handle like so
    if(event.result.stored == true)
                        entryPanel.title = "Welcome back " + event.result.userInfo.firstName + " " + event.result.userInfo.lastName;
                        firstName.text = event.result.userInfo.firstName;
                        lastName.text = event.result.userInfo.lastName;
                        userAge.value = event.result.userInfo.userAge;
                        userGender.selectedIndex = event.result.userInfo.gender;
    depends on what type of Array you're after
    from the sounds of it (with the mention of picture tooltips) you're trying to create a gallery with an image, and a tooltip.
    so i'd probably adopt something like
    <picture>
         <location>example1.png</location>
         <tooltip>tooltip for picture #1</tooltip>
    </picture>
    <picture>
         <location>example2.png</location>
         <tooltip>tooltip for picture #2</tooltip>
    </picture>
    <picture>
         <location>example3.png</location>
         <tooltip>tooltip for picture #3</tooltip>
    </picture>
    etc...
    or
    <picture location="example1.png" tooltip="tooltip for picture #1"/>
    <picture location="example2.png" tooltip="tooltip for picture #2"/>
    <picture location="example3.png" tooltip="tooltip for picture #3"/>
    etc...

  • How to query a database file on my hard drive?

    Hi,
    I have a filer called "server.dbs" on my hard drive. It is a database file. I use a simple program that allows you to view databases, and it loads up and I can traverse the database and see all the entries as any standard database.
    So I figured that Java's ability to handle SQL would allow me to make a standard SQL statement querying the database, and be able to get the results. The software stores servers in SID fields, and the value is the port the server runs on. I want to make a simple query to select a server by SID, and print the port in which that server is running on.
    So is there any way to, via my java application, load a database from a file (rather than a url) which has no authentication required, and simply make my queries directly to that file? If so, how?
    Thanks!
    -Josh

    Normal database access is via JDBC.
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    To use that JDBC driver is needed to access the database. Databases in wide usage all have one. It isn't clear from your posting that you have a common database though.

  • End-of-file in communication channel while querying the data

    We are using ColdFusion(Windows) to access an Oracle - 8.1.7
    database. I have context indexes setup on the data for search
    purposes.
    If I use a package to query the database and return some values,
    when many people use the call to the package I get the following
    error:
    End-of-file in commnuication channel
    And many other users lose connection to the database. The
    database, however does not go down.
    The same logic works well on the development database where
    traffic is less.
    If we replace the stored proc call by the individual sql
    statements there are no problems. Due to complexity of the
    program, I would like to use stored procs instead of sql
    statements in the ColdFusion code.
    Does anyone have any suggestions?

    07445:exception encountered:core dump [kopedga()+200] [SIGSEGV]
    [Address not mapped to object] ....
    ORA-7445 is a core dump (segmentation fault) and is a bug in the
    database.
    You have now the following options:
    If you have metalink access:
    1. You can have a look if you find a bug entry and then see
    when it will be fixed (e.g. search for 'ORA-7445 kopedga').
    2. Create an iTAR in Metalink.
    If you don't have metalink access:
    3. Use the latest patchset and try again and hope that it is
    fixed.
    Regards,
    Thomas

  • Filter API will hit the database if not found in Cache???

    I wrote a sample program using Filter API i.e. LikeFilter, EqualsFilter which will query the cache (i.e. Map in memory) based on the criteria. But what if it doesn't found the entries in Cache . Will it then query the database with similar criteria.
    I don't think so ... Please correct me if i am wrong.
    I need to implement Pre-loading the cache and the link http://download.oracle.com/docs/cd/E14526_01/coh.350/e14509/preloadcache.htm#CACCFCFJ
    use the Filter API. I am not sure if i can rely on pre-loading the cache from database.
    Any sample example preloading the data from database into cache will be greatly appreciated
    Regards,
    Bansi

    Then you won't need the Invokable code (anyway its owned by my employer ;-)
    All you need to do is write a simple program something like this :
    1. Query everything from the database "select * from table"
    2. Iterate through the ResultSet converting them all into objects
    3. Cache.put() these objects into Coherence.
    Now some optimisations. Re :
    1. You have a single query going to the database and will be connecting to a single cluster member. You could divide the query up by some logical division (eg. Customer / Date etc.) and then have many clients putting in concurrently, but it raises the complexity.
    2. It is also possible to store List tuples in Coherence, I once worked on a very nice project along those lines.
    3. Cache.putAll() is much faster than put() and you should batch these into sizes of 1000 for maximum performance.
    However, I would ignore these optimisations for now (tho 3. is the most useful).
    You will have to manually kick off this process when you restart your cluster (or put it in your startup script). People generally write a cluster restart script. Tho JavaServiceWrapper is very nice for restarting nodes that run out of memory. When you get really complicated you can use something like FabricServer to dynamically control your cluster, but lets get the basics working now.
    Best, Andrew.

  • Query distributed database with different character sets.

    Hello experts, this is my situation:
    I have two databases A and B, the same version 11.1.0.7, the same OS Suse Linux Enterprise 10 but with different character sets, A has WE8MSWIN1252 while B has AL32UTF8. The database B is my XML DB repository so there I have some XML type tables. I need to query this tables from the database A using a dblink and in fact I have done that but the XML content is trasformed due to the different character sets between the databases. Some time there are data loss and some time there are data missmatch.
    Is there any way to query the tables stored in the database B without problems? I do not know if the following is correct: Maybe I can set the character set for the session in the database A during the time it query the database B. That is, change the character set in fly at session level.
    Do you have any special suggestion?
    I hope you can help me, thank you in advance.

    The Globalization Support Guide for 11.1.0.7 has a chapter on character set migration that should be helpful. AL32UTF8 is a superset of WE8MSWIN1252 but it is not a strict superset. That is, it doesn't meet the second prong of the test in the documentation
    The new character set is a strict superset of the current character set if:
    Each and every character in the current character set is available in the new character set.
    Each and every character in the current character set has the same code point value in the new character set. For example, many character sets are strict supersets of US7ASCII.Exporting the data from the A, changing the character set (or creating a new database with the AL32UTF8 character set), and then importing the data may be the easiest approach in your case.
    Justin
    Edited by: Justin Cave on Jan 13, 2011 12:08 PM

  • Complex query crashing database!

    Hi
    Our 10g database runs on Windows 2003 (with 32 GB RAM on server).
    Whenever a user is running a particular complex query, the database just crashes suddenly.
    In fact, it doesn't write anything in alert log file for any problem.
    The user starts the query, it runs for sometime, then suddenly database crashes!
    Only way to work there after is to restart the database.
    Although I asked the user to not to run that query again but it is generated by some application which may generate similar query again!
    So, how I can prevent database from crashing again?
    Will creating a resource profile to allocate finite resource help? Problem is since database crashes so suddenly, I can't find any info from log files!
    Thanx

    The database instance crashes. We have to start the ORACLE.EXE again to up the database.
    Here is last few lines of the alert.log
    Fri Feb 05 11:14:59 2010
    Setting recovery target incarnation to 1
    Fri Feb 05 11:14:59 2010
    Successful mount of redo thread 1, with mount id 1911309359
    Fri Feb 05 11:14:59 2010
    Database mounted in Exclusive Mode
    Completed: alter database mount exclusive
    Fri Feb 05 11:14:59 2010
    alter database open
    Fri Feb 05 11:15:00 2010
    Beginning crash recovery of 1 threads
    parallel recovery started with 7 processes
    Fri Feb 05 11:15:00 2010
    Started redo scan
    Fri Feb 05 11:15:00 2010
    Completed redo scan
    3886 redo blocks read, 276 data blocks need recovery
    Fri Feb 05 11:15:00 2010
    Started redo application at
    Thread 1: logseq 179837, block 3
    Fri Feb 05 11:15:00 2010
    Recovery of Online Redo Log: Thread 1 Group 6 Seq 179837 Reading mem 0
      Mem# 0 errs 0: F:\DB LOG FILES\ORADATA\REDO06.LOG
      Mem# 1 errs 0: F:\DB LOG FILES MULTIPLEXED\ORADATA\REDO06.LOG
    Fri Feb 05 11:15:00 2010
    Completed redo application
    Fri Feb 05 11:15:00 2010
    Completed crash recovery at
    Thread 1: logseq 179837, block 3889, scn 10584777673
    276 data blocks read, 276 data blocks written, 3886 redo blocks read
    Fri Feb 05 11:15:01 2010
    LGWR: STARTING ARCH PROCESSES
    ARC0 started with pid=21, OS id=5752
    Fri Feb 05 11:15:01 2010
    ARC0: Archival started
    ARC1: Archival started
    ARC1 started with pid=22, OS id=4548
    Fri Feb 05 11:15:02 2010
    LGWR: STARTING ARCH PROCESSES COMPLETE
    Thread 1 advanced to log sequence 179838
    Thread 1 opened at log sequence 179838
      Current log# 7 seq# 179838 mem# 0: F:\DB LOG FILES\ORADATA\REDO07.LOG
      Current log# 7 seq# 179838 mem# 1: F:\DB LOG FILES MULTIPLEXED\ORADATA\REDO07.LOG
    Successful open of redo thread 1
    Fri Feb 05 11:15:02 2010
    ARC1: STARTING ARCH PROCESSES
    Fri Feb 05 11:15:02 2010
    ARC0: Becoming the 'no FAL' ARCH
    ARC0: Becoming the 'no SRL' ARCH
    Fri Feb 05 11:15:02 2010
    SMON: enabling cache recovery
    Fri Feb 05 11:15:02 2010
    ARC2: Archival started
    ARC1: STARTING ARCH PROCESSES COMPLETE
    ARC2 started with pid=23, OS id=6120
    Fri Feb 05 11:15:02 2010
    Successfully onlined Undo Tablespace 1.
    Fri Feb 05 11:15:02 2010
    SMON: enabling tx recovery
    Fri Feb 05 11:15:02 2010
    Database Characterset is WE8MSWIN1252
    replication_dependency_tracking turned off (no async multimaster replication found)
    Starting background process QMNC
    QMNC started with pid=25, OS id=5312
    Fri Feb 05 11:15:03 2010
    Completed: alter database open
    Fri Feb 05 11:15:03 2010
    ARC1: Becoming the heartbeat ARCH
    Fri Feb 05 11:16:01 2010
    Shutting down archive processes
    Fri Feb 05 11:16:06 2010
    ARCH shutting down
    ARC2: Archival stopped

Maybe you are looking for