SQL solution for timestamp range based records

Hi, lets say I have a record on 10.2 Oracle database:
2011-08-18 12:53:35     2011-08-20 02:53:35
I want to retrieve via single SQL three records from this record like:
2011-08-18 12:53:35     2011-08-19 00:00:00
2011-08-19 00:00:00     2011-08-20 00:00:00
2011-08-20 00:00:00     2011-08-20 02:53:35
Is this possible, thanks & regards.

WITH DATA AS (SELECT TO_DATE('2011-08-18 12:53:35','YYYY-MM-DD HH24:MI:SS') df, to_date('2011-08-20 02:53:35','yyyy-mm-dd hh24:mi:ss') dt from dual)
select greatest(df,trunc(df) + (rownum-1)) date_from
,least(dt,trunc(df) + (rownum) - 1/86400) date_to
from data
connect by rownum <= (trunc(dt+1) - trunc(df))
hth

Similar Messages

  • What is the best solution for running windows based programs

    I have one program that I need windows for.  What is the best solution for doing this without painfully slowing down my mac.

    Depends on your needs.
    BootCamp requires reboot and uses all physical resources of the system.  Only OSX *or* Windows can run.  Better for gaming or memory intensive tasks.  BootCampAssistant must set up the boot sector to make it work.  Also BCA required to remove it.
    VM (virtual machine) like Parallels which "hosts" Windows while still running OSX.  You split RAM between the two environments.  VM is just another program so no special boot sector changes needed, but not good for graphics or RAM intensive programs.
    Other recommended alternates to Parallels (paid) are VM Fusion (paid) and VirtualBox (free download from Oracle.com).

  • Open SQL statment for Update flag based on Date

    Dear all,
    I am trying to write an Open SQL statement to update a flag in a table. Table Ztable1 with fields Sr.No, Flag, Datefrom, DateTo. i would like to update Flag entry in the table only if today falls in between Datefrom & Dateto. I can satisfy the above requirement using the following ABAP code.
    DATA: lv_timestamp TYPE timestamp,
          lv_today LIKE adr2-valid_from,
          tz TYPE timezone.
    CONVERT DATE sy-datlo TIME sy-timlo INTO TIME STAMP lv_timestamp
      TIME ZONE tz.
    lv_today = lv_timestamp.
    update ztable1 set flag = 'X' where lv_today BETWEEN datefrom and dateto.
    But the issue is that, DateFrom & DateTo contains space aswell Dates. Datefrom can be space if it is start of Time (01010001) and also DateTo can be space if it is End of time (31129999). Which means that if DateFrom is space, then it should treated as 01010001, simlarly DateTo is space, then it should be 31129999. How can i write the if else cases within where clauses.
    I know Decode statement in Native sql programming, but that won't fit for Opensql in ABAP. Also, because of huge entries in database, i cannot read entries, manupulate & then update.
    How can i enhance the same above Update statement to cater this need.
    Please advise.
    Thanks a lot in advance.
    Greetings, Satish

    Hi,
    first fetch records in to internal table.
    ranges: r_range for sy-datum.
    loop at itab into wa.
    if wa-validfrom is initial.
    wa-validfrom =  (here u pass valid from date).
    elseif wa-validto is initial
    wa-validto = 99991231.
    endif.
    r_range-low = wa-validfrom
    r_range-high = wa-validto
    *check here current date is falling in interval. if its fall between ranges update flas in work area and *modify you internal table
    if sy-datum in r_range.
    wa-flag = 'x'.
    modify itab from wa.
    endif.
    refresh r_range.
    clear wa-flag.
    endloop.
    *--Finally update your ztable
    modify ztable from table itab.
    Regards,
    Peranandam

  • SQL query for timestamp

    I need to query a database from my java program for the time of each entry, but all that's in there is a timestamp. I haven't been able to query it. It was suggested that I convert it to a date in the sql database, but I don't know how to do this. Any suggestions?

    LordEricO wrote:
    I need to query a database from my java program for the time of each entry, but all that's in there is a timestamp. I haven't been able to query it. It was suggested that I convert it to a date in the sql database, but I don't know how to do this. Any suggestions?Question is not precise.
    Do you want to query for a timestamp? Or do a query which returns a timestamp.
    For the first it is unlikely that you want to query for an exact value. It is more likely that you want a range.
    In either case you would be using prepared statements and Timestamp though.

  • Gateway for Sybase or MS SQL - support for Timestamp

    Hi All,
    Is there any way to get Timestamp data out of Sybase or MS SQL Server?
    I thought this would be pretty straightforward, but after a short investigation I'm no longer that optimistic...
    The "Database Gateway for Sybase User's Guide" says in Appendix A, that the following conversions are performed by the gateway:
    (Sybase - Oracle)
    DATE - DATE
    DATETIME - DATE
    SMALLDATETIME - DATE
    TIMESTAMP - RAW
    TIME - CHAR(15)
    It says the same for MS SQL Server.
    What I need is a conversion from Sybase DATETIME into Oracle TIMESTAMP, but I'm guessing there is a limitation of the Gateway
    and it is not able to use the millisecond data in any way... Am I right?
    Or maybe there is some magic setting in the .ini file for this? Things like HS_NLS_TIMESTAMP_FORMAT seem to be unsupported by Sybase gateway.
    I'm using 11.2.0.1 on Linux.
    Thanks for any hints.

    Hi,
    As you have seen in the documentation the Sybase and SQL*Server datatime columns are translated as Oracle DATE datatypes, so the milisecond data will be lost.
    the 11.2 DG4MSQL Users Guide actually says -
    SQL*Server Oracle Comment
    DATETIME DATE Fractional parts of a second are truncated
    although the Dg4Sybase Users Guide has the same conversion it does not have the comment.
    The only way round it would be use a different non-Oracle datatyp from which you could extract the millesecond part of the string.
    Regards,
    Mike

  • Need sql querry for getting previous day records only

    Hi ,
    i have a table with following records,
    emp sal date
    111 200 03-mar-2011
    100 200 03-mar-2008
    15 200 06-mar-2012
    17 200 03-mar-2003
    178 200 03-mar-2004
    11 200 11-jun-2012
    i need only previous day records only(11 200 11-jun-2012).can any one help on this query?

    insa wrote:
    Except trun you can use Like operator--
    select * from emp where date like sysdate-1;
    Is it helpful for you?That is most certainly not a helpful answer. the LIKE operator is a string comparison operator and should not be used with dates. Doing so will cause an implicit date to character conversion based on the sessions NLS settings and would be not different to doing:
    select * from emp where to_char(date) = to_char(sysdate-1)... which will cause a lack of index usage, and also not deal with any time component within the date.
    Please ensure you test your answers before posting them. Several people had already given correct answers here with explanations as to why they are better than other methods.

  • PL/SQL Solution for Converting Long to VarChar2

    I recently had to convert a bunch of text stored in Long fields to a new VarChar2(2000) field in the same table.
    As you know if you've ever tried, you can't use a basic SQL the update statement will not do this, e.g. update table1 set field2 = field1 (where field2 is VarChar(2000) and field1 is Long) fails as does update table1 set field2 = substr(field1, 1, 2000).
    Interestingly PL/SQL's implementation of SubStr does work with Long fields. I was able to put together the following anonymous PL./SQL block to accomplish the task (msgtext is varchar(2000), msgtext2 is Long):
    DECLARE
    CURSOR message_cur
    IS
    SELECT ROWID, msgtext, msgtext2
    FROM tlrcmmessages
              FOR UPDATE;
    message_rec message_cur%ROWTYPE;
    BEGIN
    OPEN message_cur;
    LOOP
    FETCH message_cur
    INTO message_rec;
    EXIT WHEN message_cur%NOTFOUND;
    UPDATE tlrcmmessages
    SET msgtext = SUBSTR(message_rec.msgtext2, 1, 2000)
    WHERE CURRENT OF message_cur;
    END LOOP;
    CLOSE message_cur;
    END;
    I hopes this helps others out there in similar circumstances.
    Good luck,
    Rob Bratton, Bratton Enterprises

    Oracle strongly recommends to convert LONG fields into CLOB:
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adfnstyp.htm#429091
    Rgds.

  • Any Sql Solution for this?

    Hi guys,
    How can I update rows which total upto the number of dollars the user enters.
    Ex: I have the following rows in the table
    Col1 Col2 Col3 Col4
    1------10------A
    2-------3------B
    3-------7------C
    4------20------D
    5-------5------E
    6-------5------F
    I have a procedure which takes a user input (say 23). Now I need to update Col4 with EXT for all those rows which total to 23. So the result should look like
    Col1---Col2---Col3----Col4
    1------10------A------EXT
    2-------3------B------EXT
    3-------7------C
    4------20------D
    5-------5------E------EXT
    6-------5------F------EXT
    Had to insert dashes for formatting purposes...
    Any solutions will be appreciated.
    Thanks
    John

    Hi John,
    Well, that's a very strange way to do it but if you must, there's no problem saying:
    UPDATE TABLE SET Col4 = 'EXT' WHERE Col1 + Col2 + Col3 = 23;
    However, I suspect you intend that the user may enter any number of values. If this is the case, you'd be much better off (in the relational world, anyway) entering a new row for each of the new values, viz:
    User, Date, Input
    1, 01/01/2003, 10
    1, 13/01/2003, 5
    1, 15/01/2003, 8
    2, 19/01/2003, 20
    2, 10/02/2003, 3
    3, 4/01/2003, 21
    Now you can say:
    SELECT SUM (Input) Total, COUNT (Input) NrInputs FROM TABLE GROUP BY User HAVING SUM (Input) = 23;
    ... which works much better and will work for any number of columns. You don't even need the date column unless, for some reason, you need to order the input.
    d.

  • SQL Help for Date Range display

    Gurus,
    I have a sql statement like
    select MIN(HIREDATE), MAX(HIREDATE) FROM EMP WHERE DEPTNO = 30My output looks like
    MIN(HIREDATE)     MAX(HIREDATE)
    12/30/1998        12/30/2001Based on the values of MIN(HIREDATE) , MAX(HIREDATE) values
    I need a SQL to generate the output like
    12/30/1998
    1/30/1999
    2/28/1999
    until Max(HIREDATE) value
    In Feb we dont have 30th day, In that case take the last day of the month.
    Thanks for great help
    C 007

    With 10g.
    Regards Salim.WITH t AS
         (SELECT min(hiredate) min_hiredate,
                 max(hiredate) max_hiredate
            FROM emp_test
            where deptno=30)
    SELECT min_hiredate dt
      FROM t
    model
    dimension by ( 1 rn)
    measures(min_hiredate,months_between(max_hiredate,min_hiredate) diff )
    (min_hiredate[for rn from 1 to diff[1] increment  1]=add_months( min_hiredate[1],cv(rn)-1))
    order by rn
    SQL> WITH t AS
      2       (SELECT min(hiredate) min_hiredate,
      3               max(hiredate) max_hiredate
      4          FROM emp_test
      5          where deptno=30)
      6  SELECT min_hiredate dt
      7    FROM t
      8  model
      9  dimension by ( 1 rn)
    10  measures(min_hiredate,months_between(max_hiredate,min_hiredate) diff )
    11  (min_hiredate[for rn from 1 to diff[1] increment  1]=add_months( min_hiredate[1],cv(rn)-1))
    12  order by rn
    13  /
    DT
    1998-12-30
    1999-01-30
    1999-02-28
    1999-03-30
    1999-04-30
    1999-05-30
    1999-06-30
    1999-07-30
    1999-08-30
    1999-09-30
    1999-10-30
    1999-11-30
    1999-12-30
    2000-01-30
    2000-02-29
    2000-03-30
    2000-04-30
    2000-05-30
    2000-06-30
    2000-07-30
    2000-08-30
    2000-09-30
    2000-10-30
    2000-11-30
    2000-12-30
    2001-01-30
    2001-02-28
    2001-03-30
    2001-04-30
    2001-05-30
    2001-06-30
    2001-07-30
    2001-08-30
    2001-09-30
    2001-10-30
    2001-11-30
    SQL> 

  • Is any stable solution for coding HTTPService based GUIs with JFX known ?

    hello dear people,
    i am using javafx since it came out for Linux and started to use it quite extensively but at one point i could not deal with this technology, it seems like the most basic client to server communication features are not stable yet and i am very curious if there is a link to an example where the jfx source code allows significantly more than 10 HTTPRequests to be send by a jfx-client to a HTTPServer..let me xplain what i tried yet but what always ended up not working stable.
    for me when developing RIAs often cooks down to simple communication with a REST Service and i tried this one year ago already with but i still refuse to write Java Interfaces to make use of Java in the suggested way in [the post by baechul|http://blogs.sun.com/baechul/entry/javafx_1_2_async] (updated link, though new questions regarding destroying of the threaded Task -- see comments) for writing a simple REST-Client working in jfx ... so i tried the following two ways
    a) using the SwingWorker Util-Lib with the JFXTras Worker Classes and some Java URLRequests i think but the app got stucked while making continously REST-Calls to my server... and now with 1.3 i wanted this to code from scratch and clean, but again this time i am using the straight forward jfx-api way
    b) with the io.HTTPRequest{} Class and the app still keeps hanging after a couple of request..
    the signs of this fault, despite that the flags, started, connecting, etc. of the HttpRquest Class seem not to change at all (even if the requests are send out correctly by the jfx application) when the client stops to send out HTTPRequests, for example the onConnecting Handler is never called..
    so under the hood i still have to face this problem and maybe this is related to the [unanswered post here |http://forums.sun.com/thread.jspa?forumID=934&threadID=5385815] .. and i wonder if it has something to do with the issue threaded [in this forum related to hanging HTTPReqs here|http://forums.sun.com/thread.jspa?forumID=934&threadID=5396227].
    if i remember my tests from last year right, this wasn`t only happening on linux and up to today any javafxclient build from me stops sending out URLRequests while it doesn`t matter if those are PUTs, GETs or POSTs after more than let me count --approximately 8-12 request.start(); calls in an application.. i used to create new var req : HTTPRequest in each method of my RestClient.fx and run my app always as "Application" from Netbeans 6.9 with the jdk 1.6.20 and sdk1.3 on ubuntu 10.04. i am sorry for not having the time to give you the code here yet cause it doesn`t make sense for me now to describe to you how to setup the RESTservice i am developing with .. but i think this is a real issue for jfx-applications and the people who deal with this kind of problems generally have their development environments setup to try this out very easily.
    thanks for any pointers to examplary code that serves stable asynchronous client-server communication for gui-developers. i really would like to make use of this very nice API because i acknowledge its scenegraph and additional graphics power very very much !!
    Thanks in advance for sharing your insights, thoughts and links on this !
    update: i just dived into the twitterFX project but the app does not run on my computer and i also wonder why it has defined dependency to make use of the [httpclient javalib|http://hc.apache.org/downloads.cgi] while the community [doc from april 2009 here|http://java.sun.com/developer/technicalArticles/javafx/AppORama/] seems to report intense usage of the HTTPRequest Class
    update2: what basically can be observed when debugging my application is that for each HTTRequest there is a thread created under the parent "request io pool" named either 'io.N' or simply 'Thread-3' and all of which are in the state 'running' even after the request is nominally done. additionally under the root of the system-thread, everytime a HTTPRequest is created a "Keep-Alive-Thread" is running which has a quite thrilling name, but when this vanishes every thread under the "request io pool" is still Alive
    so from far out this looks quite similiar to the scnd post i mentioned here before and which can be found now here again, but i don`t know if this is correct behaviour, means: when a thread-object is meant to be destroy - maybe it is related to eventHandlers attached to my HTTPRequest{} Object but thats just a vague assumption
    i am linking in more resources related to this problem: for example [this post|http://forums.sun.com/thread.jspa?forumID=932&threadID=5392824] is reporting about a problem might be specific for POST requests, though i doubt that, which is: the object never gets into the state of HTTPRequest.isDone. i tried this out with my code, too and my HTTPRequest objects never call the onDone: function () {} it would be nice to have some more knowledge about that..
    Edited by: mremote on Jul 20, 2010 8:32 AM
    Edited by: mremote on Jul 20, 2010 9:08 AM

    hello dear application developers,
    i just found out that the translateFX runs pretty smooth (even over more than 10 request) and i tried to find out the differences between this and my implementation.. for me, the differences seem not really significant but somehow they must be so.. considering the different behaviour:
    the HttpRequest Objects are encapsulated both times as different kind of variables in a simple instance of an object:
    - the translateFX code just uses one var request : HTTPRequest and one var parser:PullParser resp. as Class.Attributes over and over again to which in the function just new HttpRequest{} are assigned on every call, so i assume that there is at most one HttpRequest at a time possible which might be dereferenced while still running
    - opposed to that i have in my code the HttpRequest as Local Variables which should be created and destroyed within the execution time of my function body, though i do not f ully understand how my anonymous handler functions assigned to e.g. HttpRequest.onInput may be deleted after the code executor has already run through my function body..
    - another difference is that the author if translateFX closes his PullParser.inputStream at the end of his function body... although i quite not understand why this should make sense.. bcause when this part is called, the PullParser will not be instantiated yet, this is done in the handler when the Response from the Server gets Back and the InputStream is starting to float in. this line of code parser.input.close(); seems to be called to prevent unexpected behaviour cause he`s working with the parser as a Class.Attribute
    so even i changed my implementation at both points both to the translateFX approach, i feel disappointed to say that i still don`t know why after a couple of HttpRequest.start(); none is send out from my app anymore and there is no difference in between running the app from within the browser, launching it with Webstart or running it as an Application..
    if someone has some time to investigate here - [there is|http://github.com/jri/deepamehta3/downloads] the latest snapshot of our application server which i use. (after its extraction and startup this package serves instantly a RESTservice on your local computer including. jetty webserver and deepamehta as a prepackaged osgi system)
    i will soon upload the whole app to my [github repository|http://www.github.com/mukil] soon... it hoepfully will be a kind of DetailPanel for a TopicMap Navigator one day
    basically the problems are happening after a couple of call of this simple code...
        var coreServiceURI : String = "http://localhost:8080";
        var gRequest : HttpRequest;
        var gModel : ClientModel = ClientModel.getInstance();
        /* loads a topic from the application service */
        public function getBaseTopic ( topicId:Long, params:String, cache:Boolean, index:Integer ) : Void {
          // var topic : FXBaseTopic = null;
          var parser :  PullParser;
          gRequest = HttpRequest {
            location: "{coreServiceURI}/core/topic/{topicId.toString()}";
            method: HttpRequest.GET;
            headers: [
              HttpHeader { name: HttpHeader.CONTENT_TYPE; value: "application/json"; },
              HttpHeader { name: HttpHeader.CONTENT_LENGTH; value: "{params.getBytes().length}"; }
            onStarted: function() { gModel.connectionStatusMessage = "dmc.loadingStarted({gRequest.method
               }, {gRequest.location})";
            onResponseMessage: function(msg:String) { gModel.connectionStatusMessage = "dms.responseMessage: {msg}"; }
            onInput: function(os: java.io.InputStream) {
              var id: Long;
              var type: String;
              var label: String;
              //var properties : FXDataField[] = [];
              var properties : String[];
              // os;
              parser = PullParser {
                documentType: PullParser.JSON;
                input: os;
                onEvent: function(event: Event) {
                  if (event.type == PullParser.INTEGER and event.level == 0) {
                    if (event.name == "id") {
                        id = event.integerValue;
                        //println("setTopic: {event.integerValue}, ");
                  } else if (event.type == PullParser.TEXT and event.level == 0) {
                    if (event.name == "type_uri") {
                        type = event.text;
                        //println(" {event.text}, ");
                    } else if (event.name == "label") {
                        label = event.text;
                        // println(" {event.text} \n");
                  } else if (event.type == PullParser.INTEGER and event.level == 1) {
                    // wether properties are integers or strings
                    insert event.integerValue into properties;
                  } else if (event.type == PullParser.TEXT and event.level == 1) {
                    insert event.text into properties;
                  } else if (event.type == PullParser.END_DOCUMENT){
                    println("[SERVER] --- dmc.gotBaseTopic: {id}, {type}, {label} with a propAt1: \"{properties.get(2).toString()}\"");
                    // topic = FXBaseTopic {
                      id = id;
                      type_uri = type;
                      label = label;
                      properties = properties;
              parser.parse();
            onException: function(ex: java.lang.Exception) {
                println("*** dms.onException: {ex.getClass()} {ex.getMessage()}");
          gRequest.start();
          parser.input.close();
        }i really dont think that this is related to problems with running javafx apps on jvms build for amd64 linux, because i`ve had similare behaviour as i still was running the 32bit version of the jvm (though that was other code and is now nearly a year ago)
    maybe someone sees the problems right away... any help is very appreciated.. and links to other working solutions would still be great !

  • What is the best wysiwyg SQL solution for a beginner?

    Hi there,
    I want to go from Access to SQL due to the fact that SQL can handle more users, posts etc..
    Only problem is I'm quite used to the Access interface and seeing/reading directly off the tables,
    something I understand is not that easy when it comes to SQL. So in order to get started I need
    to start off with a program that is easy and understandable for a beginner.
    Is there a WYSIWYG program out there that can make this transaction to SQL easier?
    And final question, what type of SQL is best suited for windows/ traditional asp pages?
    Regards,
    Christian
    DWCS5.5 | Access | Asp

    SQL stands for Structured Query Language and has nothing to do with a specific DBMS as MS Access also supports SQL as well. If you are looking to move away from Access, then any of the major DBMS will work - Sybase, Oracle, MS SQL Server, MySQL, etc - with ASP.
    As Pegaprint points out. MS Access can be used as a front end to any ODBC database. I work with large enterprise databases and have many front end tools available, but still use MS Access often to design queries because it's simple and works great. In any event, your first task is probably to get a good understanding of SQL as that will be crucial.

  • Third party solution for CDR records

    Just wondering if anyone is using third party software/solutions for reading their CDR records from CUCM and use them to  generate general reports for clients
    Thanks

    Hi,
    don't forget for 2Ring CALL ACCOUNTING (http://www.2ring.com/ca).
    It's really powerfull reporting.
    Regards,
    Martin

  • Storage solutions for Aperture Library & vault??

    My Aperture library has grown to over 400 GBs and I am concerned about storage as it grows larger week by week. I have been using two 500 GB firewire 800 drives, one for the library and one for vault. Today I purchased a 1 Terabyte drive for the library, it works well and I actually see a speed improvement. I will pick up another next week for the vault.
    Aperture lumps all of the data in one folder therefore requiring the size of our hard drive to keep pace with the Library. I need a different solution than replacing firewire drives with larger capacity ones every three to six months.
    My main requirements are speed and expandability. I do not want to keep several aperture libraries, to me this defeats the purpose of an image database.
    I have heard the pros and cons of raid and I do not think it's the best solution for an Aperture based system. Sata sounds interesting and seems that it may become more standard. I have also read about using an out-dated mac as a server by installing several hard drives and connecting it to the workstation by gigabyte ethernet. I would like to have my library on a very fast connection, firewire is fine for the vault. I am wondering what others are doing in the same situation as mine and if you might have any advice.
    With the purchase of the 1TB drives I figure that I will be fine until mid to late summer, by that time Apple will have their new desktop available which I plan to purchase. It might be best to see what the machine will or will not support. Any thoughts?........
    G5 dual 2.0   Mac OS X (10.4.6)  

    As the previous poster said: this is an Apple problem that needs to be solved. I might add, it probably will be in the near future. So, you should try to scrape by for the next few months as best you can and wait and hope and pray for a solution from Apple.
    With DVD and Firewire drives backing up your original you are well--probably over--backed up. One copy on DVD is more than sufficient for your originals. Make more backups of the Aperture library which includes your original file and your time consuming metadata and adjustments.
    RAID 0 is risky because if a single drive goes then you loose everything! There are other RAID schemes that make your system more dependable. RAID 1 mirroring is safer but doesn't expand your storage capacity.
    RAID 3 & 5 are both more dependable and give you bigger working volumes but there is a lot of processor work going on to calculate parity (error correcting and data recovery information) that is spread across several drives. If you use Mac OS X RAID or Soft RAID that processor power comes from you computer's CPU--which probably has enough work to do already without having to crunch numbers for every byte that goes to/from your hard-drive.
    RAID 3 & 5 are good systems if you have hardware to to the parity calculation but they each require a minimum 4 drives to make a set--which you don't want to use as a boot drive. That means you would need 5 drives inside your G5 of a combination of internal and external drives.
    A cleaner solution might be getting a Wiebe Tech Siver SATA V case and port multiplier card (about $1500 w/o drives). That will give you a good fast connection for 5 external hot-swappable drives. Then use Ben Long's library spanner to get you by until Apple comes to the rescue with a multiple drive library.

  • SQL to get a LOV based on a value range (zips based on zipcode range)

    I have a requirement to capture state,county,city and zipcode values based on AR Tax tables. I created an DFF with Input field for State, County and City and corresponding LOVs based on the tax tables. I am not sure how to proceed with zipcode (I am not a FORMS expert, that further makes it complicated :) )
    For those who are aware of the tax tables - AR_LOCATION_VALUES and AR_LOCATION_RATES, there are no list of zipcode values. zipcodes are maintained at the city record level as a range FROM_ZIP_CODE and TO_ZIP_CODE. So a CITY record for GA.FULTON.ATLANTA has a from_zip of 30301 and to_zip of 30321-9999. I am not worried of the ( +4 ) values, all I care is the 5 digit zip and zip will increment by 1. For this scenario I want to show each zip code as a value in my LOV..so I want to show 30301, 30302, 30303....30320, 30321. Is there a SQL to generate such LOV based on range?
    Any SQL experts out there with ideas?
    Thx, Suresh

    William Robertson wrote:
    Nice, but I think he wants the zip range as 30301 - 30321, discarding the '-9999' (apparently known over there as the '+4' component of the zipcode).Thanks William, i missed out on that detail (though it makes a heck of a lot more sense than generating a LOV with 60,000+ elements :) )
    TUBBY_TUBBZ?
    with
       parsed_data as
       select
          lower_bound,
          substr(range_string, 1, instr(range_string, '-') - 1) as high_bound
       from
          select
             30301          as lower_bound,
             '30321-99999'  as range_string
          from dual
    select
       lower_bound + level - 1
    from
       parsed_data
    connect by level <= high_bound - lower_bound + 1;
    LOWER_BOUND+LEVEL-1
                  30301
                  30302
                  30303
                  30304
                  30305
                  30306
                  30307
                  30308
                  30309
                  30310
                  30311
                  30312
                  30313
                  30314
                  30315
                  30316
                  30317
                  30318
                  30319
                  30320
                  30321
    21 rows selected.
    Elapsed: 00:00:00.01Would be the proper approach based on having a lower bound and having to parse the upper bound from a range string.
    William Robertson wrote:
    Now if I had a clue how to use MODEL...You're not alone in that boat :)

  • Recording solutions for CUCM/CME.

    Hi, all!
    I have a questions about call recording solution for CUCM and CME.
    - Does Cisco Media Sense support call recording for Call Manager Express?
    - Will Media sense write all calls, including calls via PSTN to any DN, or only DN to DN calls?
    - Can it be used for call recording in CUCM?
    - Network-based call recording feature available only in CUCM 10 or early versions?
    - What is disadvanteges and benefits of span/rspan call recording solutions?

    Here are a few
    http://www.telrex.com/callrex.htm?gclid=CM3p4_em5oQCFSfTJAodVxw8RQ
    http://www.call-replay.com/?gclid=CLG277in5oQCFShsSQodtyXIjQ
    Hope this helps.
    Please remember to rate all replies

Maybe you are looking for

  • Is it better to install Windows 8 via Boot Camp than risk installing an unstable version of Windows 8.1, which isn't yet supported?

    Apologies for asking this question as I note a number of similar questions have been asked. However, having read many answers on here and trawled the net I'm still not sure what the right answer is... The Boot Camp 5 FAQs state that Windows 8.1 is no

  • Switchover to physical standby failed

    Hi gurus, Could anyone pls help for this issue, i'm working on oracle 9i dataguard in solaris box. we succesully switchover our physical standby to primary but when tried to bring back again to physical standby it is throwing an error SQL> alter data

  • Drop down Lists problem

    Hi I have two drop down lists. One called P2_PRODUCT_GROUP which has a LOV. Also another called P2_PRODUCTS which has another LOV. I want P2_PRODUCTS to be filtered based on the selection I make in P2_PRODUCT_GROUP. I've used the following SQL statem

  • Actual Date in WBS element

    Hi,   Actually in my WBS elemrnt the actual Date fields are disabled in change mode,  i need to enter the actual dates, How to do... Thanks in Advance....

  • Need Help With Contact Info Before Sync

    I just got my first iPhone, I had a treo 700wx before this, and use Outlook 2003 for my contacts. I want to download them to my iPhone but would like to know if I need to make changes to my contact names before I do. In Outlook and my 700wx the names