Trouble with subquery and rownum and ordering

I'm having trouble making this subquery work. The basic idea is that the web app will show only so many rows of results on the page, but right now I'm just playing around in SQL*Plus. The address book holds mixed case, so in order to sort by name properly I need to use UPPER to ignore case sensitivity. This SQL statement works fine for me:
select addressbookid from addressbook where addressbookid like '905430931|%' order by upper(addressbookid);I know that if you mention ROWNUM in the WHERE clause, you're referring to the row numbers of the ResultSet that Oracle returns. How do I use both ORDER BY UPPER(ADDRESSBOOKID) and WHERE ROWNUM > 25 AND ROWNUM <= 50? I figured a subquery would do it, but I can't write a correct one that does it! Below are my 2 attempts with the errors, and then I just tried to play with rownum:
SQL> select addressbookid from addressbook where addressbookid in (select addressbookid from address book where addressbookid like '905430931|%' order by upper(addressbookid));
select addressbookid from addressbook where addressbookid in (select addressbookid from addressbook
ERROR at line 1:
ORA-00907: missing right parenthesis
SQL> select addressbookid from addressbook where addressbookid in upper(select addressbookid from addressbook where addressbookid like '905430931|%');
select addressbookid from addressbook where addressbookid in upper(select addressbookid from address
ERROR at line 1:
ORA-00936: missing expression
SQL> select addressbookid from addressbook where addressbookid like '905430931|%' and rownum > 25 and rownum <= 50 order by upper(addressbookid);
no rows selected
SQL> select addressbookid from addressbook where addressbookid like '905430931|%' and rownum > 25 and rownum <= 50;
no rows selectedLike I said, if I can get a working subquery, then I'd like to attach that restriction on the rownum stuff. I'm wondering if it will be a problem trying to get the ordering to happen and then the rownum restriction after that, and all in the same query...
Btw, we've made all the table and column names in our database uppercase, so that shouldn't matter.

This is probably the most efficient way ...
select addressbookid
from
   select addressbookid,
   rownum rn
   from
      select addressbookid
      from addressbook
      where addressbookid like '905430931|%'
      order by addressbookid
   where rownum <= 50
where rn > 25

Similar Messages

  • I am having all kinds of trouble with itunes and updating my ipad. when I open up itunes, it seems to just sit there, never going to itunes store. when I connect my ipad, I check update and it starts, but then I get this message:backup can't be saved on

    I am having all kinds of trouble with itunes and updating my ipad. I open itunes up but it doesn't do anything except open to a blank screen. I try to access the itunes store but it won't go there. When I connect my ipad, and try to update it, it starts and then I get a message that says backup cannot be saved on this computer. I have tried everything suggested to no avail. This is the 2nd or 3rd time I have had problems with itunes. Sometimes I even get a message that I am not connected to the internet.
    I have uninstalled and re-installed. Any help?

    You might not have enough space left on your hardrive.

  • Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Hi FuzzyDunlopIsMe,
    Welcome to the Support Communities!
    It's possible that resetting your password multiple times has triggered this security.  Click on the link below for assistance with your Apple ID Account:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Here is some additional information regarding your Apple ID:
    Apple ID: 'This Apple ID has been disabled for security reasons' alert appears
    http://support.apple.com/kb/ts2446
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Click on My Apple ID to access and edit your account.
    Cheers,
    - Judy

  • I downloaded Firefox 4.0 and it says to re-install the toolbar but I have not been successful in doing so. Can I go back to the older version? I had no trouble with that and I do not like this new version at all.

    I downloaded Firefox 4.0 and it says to re-install the toolbar but I have not been successful in doing so. I went to the forums and tried all the suggested fixes but none worked. Can I go back to the older version? I had no trouble with that and I do not like this new version at all. I tried a system restore twice and it did not fix the problem.

    I would imagine it's the MyWay Searchbar which is classified by most anti-malware scanners as adware, or even worse as spyware. I say that because I see "SmileyCentral" in your list of plugins and that's an add-on for that particular toolbar. You can disable that via Tools | Add-ons | Plugins.
    There are a number of toolbars which won't work with Firefox 4 anymore due to the enhanced protection mechanisms in the browser.
    Mozilla recommends that you only install add-ons from its own security site @ https://addons.mozilla.org/en-US/firefox/?browse=featured Generally speaking, those have all been tested and approved. The exceptions are those currently under review which are marked with a yellow banner to warn users that they haven't passed Mozilla's labs yet.

  • Trouble with Mail and Maverick

    Trouble with Maverick and Mail - contacts (groups) will not load into address bar in mail.

    Check that the mac's preferences for icloud is still connected to the proper account.  Be sure photo stream is turned on. 
    You haven't described what "trouble" your mail account has.

  • Several of us have a iPhone 6s and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?

    Several of us have a iPhone 6plus and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?

    Not having the problem, don't personally know anyone who is.

  • Trouble with export and import

    I am having trouble with export and import
    here is what I did...
    exp "'/ as sysdba'" PARFILE=parfile.txt
    PAFILE
    TABLES=user1.Table1
    file=Table1_1006.dmp
    LOG=Table1_1006.log
    query="where to_char(processeddate,'YYYYMMDDHHMISS') between to_char(to_timestamp('1911-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),'YYYYMMDDHHMISS') and to_char(to_timestamp('2011-10-06 16:46:26','YYYY-MM-DD HH24:MI:SS'),'YYYYMMDDHHMISS')"here is my log from export
    set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    Current user changed to user1
    . . exporting table               Table1   16019049 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    Export terminated successfully with warnings.Then I started importing
    /database2/rdbm15> imp "'/ as sysdba'" file=Table1_1006.dmp fromuser=user1 touser=user1 tables=Table1 log=imp_Table1_1006.log
    Import: Release 10.2.0.5.0 - Production on Thu Oct 6 19:57:01 2011
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in US7ASCII character set and AL16UTF16 NCHAR character set
    . importing user1's objects into user1
    IMP-00015: following statement failed because the object already exists:
    "CREATE TABLE "Table1" ("APPROVALTRACEID" VARCHAR2(64), "REQUESTOR"
    "EID" VARCHAR2(9), "EID" VARCHAR2(9), "FIRSTNAME" VARCHAR2(32), "LASTNAME" V"
    "ARCHAR2(32), "MIDDLEINITIAL" VARCHAR2(8), "TIER" VARCHAR2(3), "JOBTITLE" VA"
    "RCHAR2(64), "JOBCODE" VARCHAR2(10), "EMPLOYEETYPE" VARCHAR2(2), "CONTRACTOR"
    "TYPE" VARCHAR2(2), "EMPLOYEESTATUS" VARCHAR2(2), "COSTCENTER" VARCHAR2(10),"
    " "COSTCENTERDESCRIPTION" VARCHAR2(50), "CONTRACTENDINGDATE" VARCHAR2(8), "A"
    "CCOUNTSTATUS" VARCHAR2(2), "LOGINID" VARCHAR2(70), "APPLICATIONGROUP" VARCH"
    "AR2(50), "APPLICATIONNAME" VARCHAR2(50), "APPLICATIONID" VARCHAR2(12), "LEV"
    "EL1" VARCHAR2(512), "LEVEL2" VARCHAR2(512), "LEVEL3" VARCHAR2(512), "LEVEL4"
    "" VARCHAR2(512), "LEVEL5" VARCHAR2(512), "PROFILECODE" VARCHAR2(50), "PROCE"
    "SSEDDATE" DATE, "APPROVERMANAGEREID" VARCHAR2(9), "APPROVERMANAGERDELEGATEE"
    "ID" VARCHAR2(9), "APPROVERT4MANAGEREEID" VARCHAR2(9), "APPROVERT4MANAGERDEL"
    "EGATEEID" VARCHAR2(9), "APPROVERAPPOWNEREID" VARCHAR2(9), "APPROVERAPPOWNER"
    "DELEGATEEID" VARCHAR2(9), "PERFORMEREID" VARCHAR2(9), "NATIONALID" VARCHAR2"
    "(30), "COUNTRYCODE" VARCHAR2(9), "PASSPORTID" VARCHAR2(20), "DATEOFBIRTH" V"
    "ARCHAR2(15), "CITYOFBIRTH" VARCHAR2(15), "VENDORNAME" VARCHAR2(50), "VENDOR"
    "MANAGERNAME" VARCHAR2(50), "VENDORMANAGERID" VARCHAR2(9), "VENDORADDRESS1" "
    "VARCHAR2(100), "VENDORADDRESS2" VARCHAR2(100), "VENDORSTATEPROVINCE" VARCHA"
    "R2(15), "VENDORCOUNTRYCODE" VARCHAR2(9), "VENDORZIPPOSTALCODE" VARCHAR2(9))"
    "  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 4076863488 "
    "NEXT 1048576 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)            "
    "                   LOGGING NOCOMPRESS"
    Import terminated successfully with warnings.but I did not get rows to database2
    [server1]database2
    /database2/rdbm15> sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.5.0 - Production on Thu Oct 6 19:59:17 2011
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select count(*) from user1.Table1;
      COUNT(*)
             0
    SQL> exit
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for HPUX: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - ProductionEdited by: user3636719 on Oct 6, 2011 5:23 PM

    user3636719 wrote:
    Thanks for the reply...
    Old EXP IMP doesnt have capability to append the row, since you're using 10g use datapump instead. use option TABLE_EXISTS_ACTION=APPENDso my import should be like this
    imp "'/ as sysdba'" file=Table1_1006.dmp fromuser=user1 touser=user1 tables=Table1 log=imp_Table1_1006.log TABLE_EXISTS_ACTION=APPEND
    Did you look up the command line syntax and control options for imp?
    You should make it a habit that whenever anyone - especially a stranger on the web - gives you a bit of code or references a command or init parm or any some such, the VERY FIRST thin you should ALWAYS do is look it up for yourself and see exactly where and how it is used and what it means. That is how you grow beyond having to be spoon fed every little thing and become more self-sufficient.
    If you had, you would have seen that there is no TABLE_EXISTS_ACTION option for imp and seen that it is an option for impdp. And realized that exp and imp are NOT the same thing as expdp and impdp.
    =================================================
    Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
    Go to tahiti.oracle.com.
    Drill down to your product and version.
    <b><i><u>BOOKMARK THAT LOCATION</u></i></b>
    Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab you will find the complete documentation library.
    Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
    Do the same with the SQL Reference Manual.
    Do the same with the Utilities manual.
    You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
    Then set yourself a plan to dig deeper.
    - Read a chapter a day from the Concepts Manual.
    - Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
    - Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
    - When you have finished reading the Concepts Manual, do it again.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    =================================

  • TO ALL THOSE HAVING TROUBLE WITH ICHAT AND AIM ON MACBOOKS

    I've had a lot of trouble with AIM and iChat on my new Macbook, but I believe I've figured out the answers to all the problems I and others have encountered.
    Firstly, for those who's AIM continually crashes and displays the message "The application AIM unexpectedly shut down," my answer to your problem is too many sent messages. Watch the bar in the bottom left of your chat window, when it reaches red, your application will probably shut down.
    Secondly, for those experiencing difficulties with iChat, it's most likely a problem with communitcation between your wireless router and your computer. Try these steps:
    1. From the Apple menu, choose System Preferences.
    2. From the View, choose Sharing.
    3. Click the Firewall tab.
    4. Click New.
    5. From the Port Name pop-up menu, choose Other.
    If you have a Macbook, you'll probably have a TCP Port Number Bar and a UDP Port Number Bar. Try these steps:
    1. In the TCP Port Number(s) Bar, type: 5190, 5298
    2. In the UDP Port Number(s) Bar, type: 1024-5219, 5221, 5223-65535
    3. In the Description Bar, type: iChat AV
    4. Click OK
    5. Click Start above the window with your firewall settings, and make sure the box next to iChat AV is checked
    6. Relaunch iChat
    Good Luck! I hope this solves some of the problems that people have been encountering.

    Rob
    My Linksys is the WAG54G, which might be different from your WRT54G. Currently, UPnP is disabled and the Router ports are a bit of a mystery, because they're forwarded to an IP address that's outside of the current DHCP Address Range! Once I got it working, I was reluctant to change it even though it looked anomalous.
    The Firewall is on, with the iChat ports open that I listed in the previous post.
    My two regular buddies are my sons, who both use Trillian Pro on a Windows machine. Works pretty well despite occasional freezes or garbled sound.
    Hope you get sorted soon.
    Dave

  • I am having trouble with safari and most apps shutting down when I'm in the middle of stuff what do I need to do to resolve this?

    I am havering trouble with safari and apps shutting down on me all the time what can I do to resolve this problem. Thanks :-)

    Make sure you have enough free space on your iPad. With iOS 7 it is recommended that you have 15-20% of the storage space on the device free.  For a 16 GB device that is 2.4-3.2 GB free. For a 32 GB device that is 4.8-6.4 GB free. For a 64 GB device that is 9.6-12.8 GB free.
    Also try a reset. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • I'm Having trouble with OWA and Certs after the Rollup 7 for SP3 installation. any idea? update 2961522-

    Hi, everyone.
    I'm Having trouble with OWA and Certs after the Rollup 7 for SP3 installation. any idea? update 2961522-
    after running get-OWAVirtualDirectory or test-OWAConnectivity i'm getting a message that says "OWA it's Orphan, No Metadata information can be found."
    I only have the OWA users impacted.- anywhere users, and ActiveSync are working well.-
    Thanks,
    Fabian Alberto Campo
    MCT-MCSA 2012-MCITP365-MCTS
    Fabián A. Campo H. Consultor tecnico @ IXO Ltda. MCT MCP MCTS MCSA HP-APS Cra. 67 No. 167 – 61 of 303 Bogotá, Colombia

    Hi Fabian,
    Is there any error code when user access their mailbox on OWA. Please confirm if there is no results returned in EMS when you run Get-OWAVirtualDirectory cmdlet. Also check whether there is any Event Logs related to OWA in Exchange.
    In IIS manager, make sure the OWA virtual directory is listed in the Default Web Site. In EMC, we can navigate to Server Configuration > Client Access, select server and turn to Outlook Web App tab. Then we can click Reset Virtual Directory in the right
    Actions pane to reset OWA virtual directory.
    Additionally, please restart IIS service by running iisreset /noforce from a Command Prompt window.
    Regards,
    Winnie Liang
    TechNet Community Support

  • Trouble with edit and develop after november 2013 release?

    Hi,
    I can not use edit and develop after release November 2013.
    I am a user from Sweden and wonder if it only hit European data center?
    The language has also changed from Swedish to English in the modules.
    I can not access the following in Site Settings:
    Admin users
    Mobile support
    Secure Domain redirect
    Beta features
    Does anyone have the same problem?
    Regards André

    Hi Florin
    There is no errors in the browser. I tested Chrome, Safari, Firefox.
    I sent a video to your colleague Silviu Ghimposanu (Adobe Business Catalyst Support)
    He can give you more information. I submit tickets. Ticketsnr 60092, 60085
    Maybe you can solve this together.
    Regards André
    20 nov 2013 kl. 12.17 skrev Florin Carlig:
    Re: Trouble with edit and develop after november 2013 release?
    created by Florin Carlig in Business Catalyst - View the full discussion
    Hi Andre,
    Can you please record a quick video with the errors you might have in your browser, in the browser's console?
    Here's what I want (a video I did in Chrome): http://screencasteu.worldsecuresystems.com/Florin/2013-11-20_1306.swf
    You can use Jing to record this kind of videos: http://www.techsmith.com/jing.html
    Thanks and regards,
    Florin
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5857868#5857868
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Re: Trouble with edit and develop after november 2013 release?
    To unsubscribe from this thread, please visit the message page at Re: Trouble with edit and develop after november 2013 release?. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Business Catalyst at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • I have an iPhone and just goy I pad but no computer I'm trying to synch them together but having trouble with iCloud and I can't seem to subscribe for iTunes match from either devise

    I have an iPhone and just goy I pad but no computer I'm trying to synch them together but having trouble with iCloud and I can't seem to subscribe for iTunes match from either devise

    You first have to subscribe to iTunes Match through iTunes on your computer and have your music library in iTunes uploaded/matched before you can enable it on your iOS devices (see http://www.apple.com/itunes/itunes-match/).  Without a computer you won't be able to use iTunes Match.

  • Problem with SDO_FILTER combined with Timestamp and Order By using JDBC

    I'm having a problem with using SDO_FILTER. I've included a test driver below. It seems that I'm having a problem with combining the SDO_FILTER, Timestamp, ORDER BY and a nested table using the Oracle 11.1.0.7.0 driver against Oracle 11g. The below query queryNoWork results in the following error:
    Caused by: java.sql.SQLException: ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "MDSYS.SDO_3GL", line 1320
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3488)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
    at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:299)
    All of the other query variations seem to work. The GEOM column referenced is a Linestring that has only 2 points, start and end. Any help on this would be greatly appreciated. Thanks!
    import java.math.BigDecimal;
    import java.sql.Connection;
    import java.sql.Date;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Timestamp;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Enumeration;
    public class QueryTester
         public static void main(String[] args)
              try
                   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                   ArrayList<Object> queryParameters = new ArrayList<Object>();
                   queryParameters.add(new BigDecimal(0));
                   queryParameters.add(new Double(0));
                   queryParameters.add(new BigDecimal(180));
                   queryParameters.add(new Double(90));
                   queryParameters.add(new java.sql.Date(sdf.parse("2005-12-25").getTime()));
                   queryParameters.add(new java.sql.Date(sdf.parse("2005-12-26").getTime()));               
                   BigDecimal one = new BigDecimal(1);
                   DriverManager.registerDriver((Driver) Class.forName("oracle.jdbc.driver.OracleDriver").newInstance());
                   Enumeration<Driver> drivers = DriverManager.getDrivers();
                   while(drivers.hasMoreElements())
                        System.out.println(drivers.nextElement().getClass().getName());
                   Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@xxxx:1521:xxxx", "xxxx", "xxxx");
                   String queryNoWork = "select * from (select ROWNUM rowcount, a.* from (select * from TRACK_SEGMENTS where ( ( sdo_filter(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= ?and START_DATE < ?) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ORDER BY ID ) a) where rowcount between 1 and 30000";
                   String queryWorks0 = "select * from (select ROWNUM rowcount, a.* from (select * from TRACK_SEGMENTS where ( ( sdo_relate(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= ?and START_DATE < ?) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ORDER BY ID ) a) where rowcount between 1 and 30000";
                   String queryWorks1 = "select * from (select ROWNUM rowcount, a.* from (select * from TRACK_SEGMENTS where ( ( sdo_filter(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= TO_TIMESTAMP('2005-12-25','YYYY-MM-DD') and START_DATE < TO_TIMESTAMP('2005-12-26','YYYY-MM-DD')) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ORDER BY ID ) a) where rowcount between 1 and 30000";
                   String queryWorks2 = "select * from (select ROWNUM rowcount, a.* from (select * from TRACK_SEGMENTS where ( ( sdo_filter(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= ?and START_DATE < ?) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ) a) where rowcount between 1 and 30000";
                   String queryWorks3 = "select * from TRACK_SEGMENTS where ( ( sdo_filter(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= ?and START_DATE < ?) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ORDER BY ID";
                   String query = queryWorks0;
                   PreparedStatement s = conn.prepareStatement(query);
                   int parameterIndex = 0;
                   for (Object object : queryParameters) {
                        if (object instanceof Timestamp)
                             s.setDate(++parameterIndex, (Date) object);
                        else
                             s.setObject(++parameterIndex, object);
                   s.execute();
                   ResultSet results = s.getResultSet();
                   results.next();
                   System.out.println("executed query - " + results.getLong(1));
              catch (Exception e)
                   e.printStackTrace();
    }

    Is the TRACK_SEGMENTS table partitioned ?
    It looks like in the case where the SQL does not work, it is not using the Spatial index. So can you add some index hints
    in the query to force it to use the spatial index TRACK_SEGMENTS table ?
    siva

  • Trouble with calendar and events populating phone

    I am having a significant amount of trouble with getting my phone to populate my calendar and my events.  I have had trouble with this since I got my phone at the end of April and I am getting tired of it.  If i put new calendar entries in on my local calender or I sync from my active sync calender, the result is the same - nothing will show.  The strange thing is is that the reminders will open up, everything is invisible to me.  I've reinstalled the software and have been through the settings on my calender accounts.  I am a business person and this is very important to me and I am starting to get frustrated with this. 
    Any help would be greatly appreciated!

    Ok, I finally figured it out or better I finally got it to work after playing with it. For those who have the same issues I will give you the steps I have taken. It might sound a bit senseless but I didn't know what I was doing might actually make it work.
    Anyways, I read somewhere that in order to be able to set a default Calendar in Settings they added a CalDAV account. I didn't have one but I do have a gmail account. Before adding that I tried again turning on and off the iCloud calendar which didn't help.
    Then I went to the ical app on the iphone and added a new calendar which I called the same as my main one on the iCloud site (HomeCloud). I rebooted the phone every time I made a change. But didn't help either.
    Then I deleted my iCloud account on the iphone reboooted and added it again, rebooted. Now the "Calendars" calendar was not on the iphone anymore but I could see my main HomeCloud, my UK Holiday and the gmail account calendar but nothing was synced.
    Last step I tethered the iphone to my imac and synced via iTunes again and voila I could see everything synced correctly. Last thing I had to uncheck the gmail calendar on the iphone because it was set as the default and now the events I put in the iphone sync correctly with the iCloud site and my icals on my machines.
    I hope this will help whoever has the same issue.

  • Macbook pro 13" i7 and trouble with iphoto and finder

    Hi, I've just bought last week the new macbook pro 13" i7.
    I've just replaced the HDD for an SSD Intel 510 Series 120Go and it works very well !!!
    But since yesterday when I've plugged my EOS 450D in order to transfer some photos... The problem is that I've a bug with iphoto: when I want to empty the trash (from iphoto), it doesn't work, photos are again in the trash, or when I look some picture it bugs !!!
    At this moment iphoto doesn't run correctly, you know like when the "mouse" is searching all the time !!! Just after the finder and another soft bug... but not all the the time.
    This trouble appears too in the menu: "files" appears with less word or "photos" or "event"...
    So I've re install OSX since Time machine but nothing.
    I've re install the original HDD but always the same !!!
    I've empty the RAM with "cmd+alt+P+R" but always the same...
    I've re install OSX with CD but nothing.
    Problem with graphic card ? with RAM ? Motherboard ?
    I don't think that it is th SSD because I've the same problrm with the original HDD.
    I don't understand the macbook is new.
    I need some help please.
    Thanks in advance.
    Best
    Yann 57

    Something strange !!!
    At this time I've plugged an external HDD to backup with Time machine and it freeze again !!! And now this is my internet exporer !!!
    I've shut down manually the computer and empy the PRAM...
    Is there a trouble with USB port ? The same thing since I've plugged my EOS 450D yesterday with the USB port...
    Please Help
    Spec:
    Macbook pro 13" intel core i7
    4Go RAM
    SSD 120Go Intel 510 Series
    MAc OSX 10.6.7

Maybe you are looking for

  • BB Maps icon missing. Not possible to re-install app

    Hello everyone. I have a small problem that a lot of users seem to have with BB 8900. A Blackberry Maps application has been installed on my device (version 4.6.1), but the icon to start it up is missing. I have seen some posts regarding that problem

  • Avoid Depreciation for particular asset

    Sir , Is there any possibility to avoid to run depreciation for particular or specified assets. Tamil Selvan.

  • I need a duplicate of the chit, what i have to do ?

    I need a duplicate of the chit, what i have to do ?  I do not know how to contact the store, because i am from Brazil and the store that i bought the iphone is in Miami at The falls malls. I need halp because my phone don't turn on

  • Date Profile with Actions and Deadline Monitoring

    Hi Folks , I have met an requirement of Actions with Deadline Monitoring of Date Profile . I could able to see Date profile with Day Rules in the standard , But i have met an requirement for very high imp - 2 hrs , High - 4 hrs .... etc. Where in Sta

  • Idoc to BAPI n viceversa

    Hi All I have to implement a scenario which converts Idoc to BAPI n vice versa Can u give me step by step solution for the above.. Plz find the solution as early as popssible Thanks