Number range partition

Hi
I have  a number range from 00001 to 99999 and i want to partition my nuber rangec into 3 parts.
To use number range in report program i can call function 'NUMBER_GET_NEXT' but how can i partion my number range so that:
00001-20000 is sales order
20001-40000 is purchase order
40001-50000 is receipt order.
Please note i dont have to create a seprate number range for the same.
Regards
Preeti Khurana

lv_count =  range_high - range_low.
      lv_count = lv_count + 1.
       do lv_count times.
          wa_gl-VONKT = wa_repcode-VONKT.
           append wa_gl to lt_gl.
        wa_repcode-VONKT = wa_repcode-VONKT + 1.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
           EXPORTING
             INPUT  = wa_repcode-VONKT
            IMPORTING
              OUTPUT = wa_repcode-VONKT.
        enddo.
it will give u the gl by splitting it from the range and append into an internal table.
U can use 2 more internal table and add some condition and split the range.
eg:
*00001-20000 is sales order
*20001-40000 is purchase order
*40001-50000 is receipt order.
lv_count =  wa_repcode-belnr_HIGH - wa_repcode-belnr_low.
      lv_count = lv_count + 1.
       do lv_count times.
           if wa_gl-belnr le 2000.
          wa_gl1-belnr = wa_repcode-belnr.
           append wa_gl1 to lt_gl1.
           else if wa_gl-belnr ge 2001
           wa_gl-belnr = wa_repcode-belnr.
               if wa_gl2-belnr ge 4001
           append wa_gl3 to lt_gl3.
          else.
     append wa_gl2 to lt_gl3.
     endif.
        wa_repcode-belnr = wa_repcode-belnr + 1.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
           EXPORTING
             INPUT  = wa_repcode-belnr
            IMPORTING
              OUTPUT = wa_repcode-belnr.
        enddo.
Am using the function module to get the order number in 10 digit. U can use the fc according to ur requirement..

Similar Messages

  • How to find out the min & max partition_id in a range partition?

    Hi we have a table set up by range partition
    In the table creation script. It goes something like:
    PARTITION PARTD_CUST_3_1_NEW VALUES LESS THAN ('39500')
    so how we can find out this number '39500' from some of the data_dictionary view?
    What we want to do is to set up parallel processing (do-it-yourself) based on partition.
    So the number of parallel process will be based on this ID-range.
    I can find out how many partitions are there by using something like this:
    SELECT COUNT(*)
    FROM all_tab_partitions WHERE table_owner='OWNER_NAME' AND table_name='TABLE_NAME'
    We have 5 partitions now but the table structure can change in the near future even this table has moer than 130Million rows
    I do not want to hardcode this "39500" just in case the table structure changes (partition structure changes)
    Any idea ??

    vxwo0owxv wrote:
    Hi we have a table set up by range partition
    In the table creation script. It goes something like:
    PARTITION PARTD_CUST_3_1_NEW VALUES LESS THAN ('39500')
    so how we can find out this number '39500' from some of the data_dictionary view?
    What we want to do is to set up parallel processing (do-it-yourself) based on partition.
    So the number of parallel process will be based on this ID-range.
    I can find out how many partitions are there by using something like this:
    SELECT COUNT(*)
    FROM all_tab_partitions WHERE table_owner='OWNER_NAME' AND table_name='TABLE_NAME'
    We have 5 partitions now but the table structure can change in the near future even this table has moer than 130Million rows
    I do not want to hardcode this "39500" just in case the table structure changes (partition structure changes)
    Any idea ??query DBA_TAB_PARTITIONS.HIGH_VALUE

  • How to Implement 30 days Range Partitioning with Date column. Not Interval

    Hi,
    I am using the db:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
    Current table structure is:
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE
    PARTITION BY RANGE (CreationDate)
    INTERVAL ( NUMTODSINTERVAL (30, 'DAY') )
    (PARTITION P_FIRST
    VALUES LESS THAN (TIMESTAMP ' 2001-01-01 00:00:00'))
    How can I define virtual column based partitioning with RANGE partitioning without using INTERVAL partitioning.
    And that is with Intervals of 30 days.
    For monthly I am trying as
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE,
    monthly_interval date as (to_char(CreationDate,'MM-YYYY')) VIRTUAL
    PARTITION BY RANGE (monthly_interval)
    partition p_AUG12 values less than (to_date('08-2012','mm-yyyy')),
    partition p_SEP12 values less than (to_date('09-2012','mm-yyyy')),
    partition p_OCT12 values less than (to_date('10-2012','mm-yyyy'))
    Enable ROw Movement
    BUT CAN'T INSERT the data even for that:
    Insert into a (a, CreationDate)
    Values (1, '12-10-2012')
    Insert into a (a, CreationDate)
    Values (1, '12-10-2012')
    Please suggest..

    Hi rp,
    Interval Partitioned to Range. Created Daily Partitions from Monthly Part. got complicated so I am posting here.
    Basically,
    I know Interval Partitioning is a kind of Range partitioning. But explicitly for Interval Partitioned tables XML Indexes are not allowed as discussed here:
    XMLIndexes on an Interval Partitioned Table??
    I can do monthly partitions as :
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE,
    monthly_interval varchar2(8) as (to_char(CreationDate,'MM-YYYY')) VIRTUAL
    PARTITION BY RANGE (monthly_interval)
    partition p_AUG12 values less than ('09-2012'),
    partition p_SEP12 values less than ('10-2012'),
    partition p_OCT12 values less than ('11-2012')
    ) Enable ROw Movement
    Insert into a (a, CreationDate)
    Values (1, '12-SEP-2012')
    Insert into a (a, CreationDate)
    Values (1, '14-SEP-2012')
    Select * from A partition (p_SEP12)
    Select * from A partition (p_AUG12)
    Select * from A partition (p_OCT12)
    Can we do it for 30 days partitions, instead of the monthly partitions. ANY suggestions..
    Thanks..

  • Is there any plan of allowing non-range partitioning of spatial indexes

    our application is really lacking the ability of spatial index being partitioned by list. We are binning information in our data warehouse by spatial locations, and when we query it (actually, MapViewer is generating a tile), entire geometry set is searched because table is list-partitioned and we cannot have local spatial index.

    Hi,
    I'm not in a position to answer the question about list partitioning, but would a pseudo-list partition implemented as a range partition work? For example, something like this:
    CREATE TABLE customers (
      first_name    VARCHAR2(20),
      last_name     VARCHAR2(20),
      address_1     VARCHAR2(20),
      address_2     VARCHAR2(20),
      city          VARCHAR2(20),
      state_abrv    VARCHAR2(3),
      postal_code   VARCHAR2(10),
      customer_id   NUMBER NOT NULL UNIQUE)
      PARTITION BY RANGE (state_abrv) 
       PARTITION ALASKA         VALUES LESS THAN ('AKz'),
       PARTITION ALABAMA        VALUES LESS THAN ('ALz'),
       PARTITION ARKANSAS       VALUES LESS THAN ('ARz'),
       PARTITION AMERICANSAMOA  VALUES LESS THAN ('ASz'),
       PARTITION ARIZONA        VALUES LESS THAN ('AZz'),
       PARTITION CALIFORNIA     VALUES LESS THAN ('CAz'),
       PARTITION WYOMING        VALUES LESS THAN ('WYz')
       );I've used this method in the past, although I agree a list partitioning solution is much preferred.
    Dan

  • Subpartition existing range partition in Oracle

    I have table xyz with following structure
    xyz ( vld_dte date,
    prd_typ varchar2(100),
    sales number
    table XYZ is partitioned by range on field vld_dte and partitions are monthly partitions like JAN-2009 , FEB-2009....DEC-2009 and so on.table is currently loaded with data.
    How can I modify existing range partition into composite range-list partition so that every partiton is subpartitioned on prd_typ , basically three sub-partitions for every partition 1- Grocery , 2-Home decoration,3-OTHERS

    ORA-14759: SET INTERVAL is not legal on this table.
    Cause: ALTER TABLE SET INTERVAL is only legal on a range partitioned table with a single partitioning column. Additionally this table cannot have a maxvalue partition.
    Action: Use SET INTERVAL only on a valid table
    mark answered post as helpful / correct*

  • Problem with a 2 columns Range Partitioning for a indexed organized table

    have an indexed organized table with a 2 column PK. the first field (datum) is a date field the second field (installatieid) is a number(2) field.
    Every minute a 7 records are inserted (installatieid 0-6).
    I like to partition this table with one partition per year per installatieid.
    I tried to do it with:
    partition by range(datum,installatieid)
    (partition P_2004_0 values less than (to_date('2004-01,'yyyy-mm'),1)
    ,partition P_2004_6 values less than (to_date('2004-01','yyyy-mm'),7)
    partition P_2005_0 values less than (to_date('2005-01','yyyy-mm'),1)
    ,partition P_2005_6 values less than (to_date('2005-01','yyyy-mm'),7)
    but now only the P_2004_0 and P_2005_0 are filled.
    I thought about to combine a range partition on datum with a list subpartition on installatieid, but I read this is not allowed with an index organized table.
    How can I solve this problem.

    partition by range(datum,installatieid)
    (partition P_2004_0 values less than
    (to_date('2004-01,'yyyy-mm'))
    ,partition P_2004_6 values less than
    (to_date('2004-07','yyyy-mm'))
    partition P_2005_0 values less than
    (to_date('2005-01','yyyy-mm'))
    ,partition P_2005_6 values less than
    (to_date('2005-07','yyyy-mm'))
    ? Sorry haven't got time to test it this morning ;0)

  • Partition Pruning on Interval Range Partitioned Table not happening when SYSDATE used in Where Clause

    We have tables that are interval range partitioned on a DATE column, with a partition for each day - all very standard and straight out of Oracle doc.
    A 3rd party application queries the tables to find number of rows based on date range that is on the column used for the partition key.
    This application uses date range specified relative to current date - i.e. for last two days would be "..startdate > SYSDATE -2 " - but partition pruning does not take place and the explain plan shows that every partition is included.
    By presenting the query using the date in a variable partition pruning does table place, and query obviously performs much better.
    DB is 11.2.0.3 on RHEL6, and default parameters set - i.e. nothing changed that would influence optimizer behavior to something unusual.
    I can't work out why this would be so. It very easy to reproduce with simple test case below.
    I'd be very interested to hear any thoughts on why it is this way and whether anything can be done to permit the partition pruning to work with a query including SYSDATE as it would be difficult to get the application code changed.
    Furthermore to make a case to change the code I would need an explanation of why querying using SYSDATE is not good practice, and I don't know of any such information.
    1) Create simple partitioned table
    CREATETABLE part_test
       (id                      NUMBER NOT NULL,
        starttime               DATE NOT NULL,
        CONSTRAINT pk_part_test PRIMARY KEY (id))
    PARTITION BY RANGE (starttime) INTERVAL (NUMTODSINTERVAL(1,'day')) (PARTITION p0 VALUES LESS THAN (TO_DATE('01-01-2013','DD-MM-YYYY')));
    2) Populate table 1million rows spread between 10 partitions
    BEGIN
        FOR i IN 1..1000000
        LOOP
            INSERT INTO part_test (id, starttime) VALUES (i, SYSDATE - DBMS_RANDOM.value(low => 1, high => 10));
        END LOOP;
    END;
    EXEC dbms_stats.gather_table_stats('SUPER_CONF','PART_TEST');
    3) Query the Table for data from last 2 days using SYSDATE in clause
    EXPLAIN PLAN FOR
    SELECT  count(*)
    FROM    part_test
    WHERE   starttime >= SYSDATE - 2;
    | Id  | Operation                 | Name      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT          |           |     1 |     8 |  7895  (1)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE           |           |     1 |     8 |            |          |       |       |
    |   2 |   PARTITION RANGE ITERATOR|           |   111K|   867K|  7895   (1)| 00:00:01 |   KEY |1048575|
    |*  3 |    TABLE ACCESS FULL      | PART_TEST |   111K|   867K|  7895   (1)| 00:00:01 |   KEY |1048575|
    Predicate Information (identified by operation id):
       3 - filter("STARTTIME">=SYSDATE@!-2)
    4) Now do the same query but with SYSDATE - 2 presented as a literal value.
    This query returns the same answer but very different cost.
    EXPLAIN PLAN FOR
    SELECT count(*)
    FROM part_test
    WHERE starttime >= (to_date('23122013:0950','DDMMYYYY:HH24MI'))-2;
    | Id  | Operation                 | Name      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT          |           |     1 |     8 |   131  (0)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE           |           |     1 |     8 |            |          |       |       |
    |   2 |   PARTITION RANGE ITERATOR|           |   111K|   867K|   131   (0)| 00:00:01 |   356 |1048575|
    |*  3 |    TABLE ACCESS FULL      | PART_TEST |   111K|   867K|   131   (0)| 00:00:01 |   356 |1048575|
    Predicate Information (identified by operation id):
       3 - filter("STARTTIME">=TO_DATE(' 2013-12-21 09:50:00', 'syyyy-mm-dd hh24:mi:ss'))
    thanks in anticipation
    Jim

    As Jonathan has already pointed out there are situations where the CBO knows that partition pruning will occur but is unable to identify those partitions at parse time. The CBO will then use a dynamic pruning which means determine the partitions to eliminate dynamically at run time. This is why you see the KEY information instead of a known partition number. This is to occur mainly when you compare a function to your partition key i.e. where partition_key = function. And SYSDATE is a function. For the other bizarre PSTOP number (1048575) see this blog
    http://hourim.wordpress.com/2013/11/08/interval-partitioning-and-pstop-in-execution-plan/
    Best regards
    Mohamed Houri

  • Number of partitions?

    I'm currently working on a database containing large, (100 million +) amounts of order information. This is due to be re-partitioned as part of an upgrade process. It seems most appropriate to perform range partitioning, but I was hoping someone could provide me with some information relating to performance impact based on the number of partitions.
    The best I can explain it is, assume a graph with speed of query execution on the y axis and number of partitions on the x. At present I've no idea what shape this graph will be - is there a performance degradation as the number of partitions becomes too high, resulting in a bell curve?
    I would assume the most sensible number of partitions would be acheived by dividing the data in the way that it is most commonly queried, (i.e. if most reports are run on monthly data, create monthly partitions) but again, this is all just speculation.
    Any information or guidance greatly appreciated.

    And if we have lots of radically different queries
    then you cannot hope to satisfy them all: some will
    be hit. So who do we privilege: the short running,
    often used or the slow running, infrequently used?
    No brainer, right? Except that we might need to ask
    ourselves: who runs those queries? For instance,
    which queries are run by the people who sign off the
    IT Dept's budget? Might that influence our
    decisions ;)I completely agree with you on this point. Initial design of one of our databases was done keeping the top management in mind... faster reports... on the click reports... I still wonder why it was so, when our internal SLA clearly stated that the administrative/management reports would run in approximately 2 minutes.
    We then figured out a better method to achieve the same with some overnight jobs and at least got the MIS department happy about the performance of queries (which was delaying the other reports due to obvious reasons).
    There is no simple solution. I accept this not from partitioning point of view but from entire database design point of view.
    Thanks Andrew.

  • Oracle 11g  List - Range Partition - Help Needed

    Hi All,
    I want to create a composite partition (LIST-RANGE) but RANGE partition should using interval partition
    This is my query .
    CREATE TABLE "DMSDB"."DEVICE_UTILS"
    (     "ULID" VARCHAR2(100 CHAR),
         "IP_ADDRESS" VARCHAR2(24 CHAR),
         "PORT" VARCHAR2(8 CHAR),
         "SHUTDOWN" NUMBER(10,0),
         "LINE_TYPE" NUMBER(10,0) DEFAULT '0',
         "OCCUPIED" NUMBER(10,0),
         "UTILIZATION" NUMBER(10,0),
         "IDLE_TIME" VARCHAR2(32 CHAR),
         "ACTIVATION_TIME" VARCHAR2(32 CHAR),
         "PULLED_DATE" TIMESTAMP (6) DEFAULT SYSDATE,
         "ACCESS_TIME" TIMESTAMP (6) DEFAULT SYSDATE
    PARTITION BY LIST(ULID)
              PARTITION PART_DEVUTILS_ULID VALUES (DEFAULT)
         SUBPARTITION BY RANGE( PULLED_DATE)
         PARTITION PART_DEVUTILS_WEEK INTERVAL (NUMTOYMINTERVAL(1,'WEEK'))
    Somehow its not working. can you please suggest where i am making mistake?

    Interval partitioning is not supported at the subpartition level.
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_7002.htm#BABCDDIA
    Regards
    Girish Sharma

  • Range partitioning does not work the way I thought it would

    I have a table that is range partitioned by number.
    The number represents a date field of the form: YYYYMMDDHH24
    However, there are extra values on the end of the field that represent an exact datestamp so a record looks like
    20071102100000001
    What I found in my tests is that if I have a partition based on range based on the following:
    values less than (2007110210)
    Any records inserted with a length greater than what is above automatically go to the future partition. It does not make sense that I would have to add another column and then do a substr on this field for just the first 10 characters to get them to go to the correct partition.
    ???? I am at a bit of a loss.

    Hi
    If you a column storing a timestamp you should use the timestamp or date datatype, not something else!!! Not only it makes not sense but you will have a lot of problems with that. To name only two: not consistent data and misleading the query optimizer.
    As you defined, since 20071102100000001 is greater than 2007110210 (i.e. not less then), I don't see why do you expect something else.
    HTH
    Chris

  • Range Partitioning on Varchar2 column???

    We hava table and it has a date column and its type is varchar2.
    This column's format is '16021013' ('ddmmyyyy').
    We want to make range partition on this column. What will be the best way?
    do you think virtal column partitioning will be efficient?

    >
    I'm not a new DBA:-) You can be sure. I asked only about range partitioning trick with varchar2 column because we did our examination about this table. We will need to archive this table quarter by quarter to the other archive database. Then, off course, nearly all queries are coming firstly by using this date column and they can have different filtering inside "where" conditions. Already, this table has index on this column but with huge number of data, index performance is not enough for us. This is a 7x24 banking system and we are lately joined to this project. Because of this, we cant change everything like changing data type of that column after this moment.
    >
    You are taking things way too personally. No one said anything about whether you were, or were not, a DBA or made any other comments about your skill or abilities.
    What we ask was for you to tell us WHAT the problem was that you were trying to solve and WHY you thought partitioning would solve it.
    And now, after several generic posts, you have finally provided that information. We can only comment based on the information that you post. We can't guess as to what types of queries you use or what kinds of predicates you use in those queries. But we need to know that information in order to provide the best advice.
    Next time you post put the important information in your original question:
    1. A table column is VARCHAR2 but contains a date value. We are unable to change the datatype of this column.
    2. We need to archive data quarterly based on this date value
    3. Nearly all queries use this date value and then also may have additional filter conditions
    4. This date column is indexed but we would like to improve the performance beyond what this index can give us.
    The above is a summary that includes all important information that is needed to know how best to help you.
    And I made a pretty good guess since two replies ago I provided you with example code that shows just how to partition the table.
    >
    Now, our only aim is how to make range partitioning this varchar2 date column.
    >
    As I showed you in my example code earlier you can add a virtual column to the table and partition on it. My example code creates a monthly partitioned table that allows you to archive by month or archive every three months to archive by quarter.
    You can modify that example to use quarterly partitions if you want but I would recommend that you use standard monthly partitions since they will satisfy the widest range of predicates.

  • Modify HUGE HASH partition table to RANGE partition and HASH subpartition

    I have a table with 130,000,000 rows hash partitioned as below
    ----RANGE PARTITION--
    CREATE TABLE TEST_PART(
    C_NBR CHAR(12),
    YRMO_NBR NUMBER(6),
    LINE_ID CHAR(2))
    PARTITION BY RANGE (YRMO_NBR)(
    PARTITION TEST_PART_200009 VALUES LESS THAN(200009),
    PARTITION TEST_PART_200010 VALUES LESS THAN(200010),
    PARTITION TEST_PART_200011 VALUES LESS THAN(200011),
    PARTITION TEST_PART_MAX VALUES LESS THAN(MAXVALUE)
    CREATE INDEX TEST_PART_IX_001 ON TEST_PART(C_NBR, LINE_ID);
    Data: -
    INSERT INTO TEST_PART
    VALUES ('2000',200001,'CM');
    INSERT INTO TEST_PART
    VALUES ('2000',200009,'CM');
    INSERT INTO TEST_PART
    VALUES ('2000',200010,'CM');
    VALUES ('2006',NULL,'CM');
    COMMIT;
    Now, I need to keep this table from growing by deleting records that fall b/w a specific range of YRMO_NBR. I think it will be easy if I create a range partition on YRMO_NBR field and then create the current hash partition as a sub-partition.
    How do I change the current partition of the table from HASH partition to RANGE partition and a sub-partition (HASH) without losing the data and existing indexes?
    The table after restructuring should look like the one below
    COMPOSIT PARTITION-- RANGE PARTITION & HASH SUBPARTITION --
    CREATE TABLE TEST_PART(
    C_NBR CHAR(12),
    YRMO_NBR NUMBER(6),
    LINE_ID CHAR(2))
    PARTITION BY RANGE (YRMO_NBR)
    SUBPARTITION BY HASH (C_NBR) (
    PARTITION TEST_PART_200009 VALUES LESS THAN(200009) SUBPARTITIONS 2,
    PARTITION TEST_PART_200010 VALUES LESS THAN(200010) SUBPARTITIONS 2,
    PARTITION TEST_PART_200011 VALUES LESS THAN(200011) SUBPARTITIONS 2,
    PARTITION TEST_PART_MAX VALUES LESS THAN(MAXVALUE) SUBPARTITIONS 2
    CREATE INDEX TEST_PART_IX_001 ON TEST_PART(C_NBR,LINE_ID);
    Pls advice
    Thanks in advance

    Sorry for the confusion in the first part where I had given a RANGE PARTITION instead of HASH partition. Pls read as follows;
    I have a table with 130,000,000 rows hash partitioned as below
    ----HASH PARTITION--
    CREATE TABLE TEST_PART(
    C_NBR CHAR(12),
    YRMO_NBR NUMBER(6),
    LINE_ID CHAR(2))
    PARTITION BY HASH (C_NBR)
    PARTITIONS 2
    STORE IN (PCRD_MBR_MR_02, PCRD_MBR_MR_01);
    CREATE INDEX TEST_PART_IX_001 ON TEST_PART(C_NBR,LINE_ID);
    Data: -
    INSERT INTO TEST_PART
    VALUES ('2000',200001,'CM');
    INSERT INTO TEST_PART
    VALUES ('2000',200009,'CM');
    INSERT INTO TEST_PART
    VALUES ('2000',200010,'CM');
    VALUES ('2006',NULL,'CM');
    COMMIT;
    Now, I need to keep this table from growing by deleting records that fall b/w a specific range of YRMO_NBR. I think it will be easy if I create a range partition on YRMO_NBR field and then create the current hash partition as a sub-partition.
    How do I change the current partition of the table from hash partition to range partition and a sub-partition (hash) without losing the data and existing indexes?
    The table after restructuring should look like the one below
    COMPOSIT PARTITION-- RANGE PARTITION & HASH SUBPARTITION --
    CREATE TABLE TEST_PART(
    C_NBR CHAR(12),
    YRMO_NBR NUMBER(6),
    LINE_ID CHAR(2))
    PARTITION BY RANGE (YRMO_NBR)
    SUBPARTITION BY HASH (C_NBR) (
    PARTITION TEST_PART_200009 VALUES LESS THAN(200009) SUBPARTITIONS 2,
    PARTITION TEST_PART_200010 VALUES LESS THAN(200010) SUBPARTITIONS 2,
    PARTITION TEST_PART_200011 VALUES LESS THAN(200011) SUBPARTITIONS 2,
    PARTITION TEST_PART_MAX VALUES LESS THAN(MAXVALUE) SUBPARTITIONS 2
    CREATE INDEX TEST_PART_IX_001 ON TEST_PART(C_NBR,LINE_ID);
    Pls advice
    Thanks in advance

  • Range Partition

    Iam getting problem while creating range partition. I have created a partitioned table as below
    CREATE TABLE ERROR_DETAILS_tst
    STG_TAB_COL_ID NUMBER NOT NULL,
    RECORD_ID NUMBER NOT NULL,
    ERROR_ID NUMBER NOT NULL,
    RECORD_CREATE_DT DATE NOT NULL,
    PROGRAM_NAME VARCHAR2(200 BYTE),
    ERROR_VALUE VARCHAR2(2000 BYTE),
    RECORD_LAST_UPDATE_DT DATE NOT NULL
    PARTITION BY RANGE (record_create_dt)
    PARTITION P07302007 VALUES LESS THAN (TO_DATE('30-jul-2007', 'dd-mon-yyyy')),
    PARTITION P07312007 VALUES LESS THAN (TO_DATE('31-jul-2007', 'dd-mon-yyyy')),
    PARTITION P08072007 VALUES LESS THAN (TO_DATE('07-aug-2007', 'dd-mon-yyyy'))
    record_create_dt is a timestamp.
    Iam trying to insert into this table using
    insert into ERROR_DETAILS_tst
    select * from error_details_test
    But getting ORA-14400: inserted partition key does not map to any partition error.
    Since record_create_dt is a timestamp its not getting matched with any of the partitions.
    Please suggest.

    Now all the records got inserted into 'Other' partition. I want the data to be moved into their respective partitions.
    For example I have records with record_create_dt as
    8/7/2007 1:45:41 PM
    8/7/2007 1:36:44 PM
    8/7/2007 1:45:43 PM
    8/7/2007 1:45:41 PM
    8/7/2007 1:45:42 PM
    I want these records to be moved into 'P08072007' partition. Since the record_create_dt is the timestamp these records are not considered for this partition. How can I get this.

  • Creating interval parition to existing range partition

    I have a table which has range partition on a number column.
    CREATE TABLE TEST(
    id INT NOT NULL,
    start INT NOT NULL
    PARTITION BY RANGE (start)
         PARTITION old_Data VALUES LESS THAN (1000000) TABLESPACE old,
         PARTITION new_Data VALUES LESS THAN (MAXVALUE) TABLESPACE new
    I would like to create monthly interval partition in old_data partition. Is this possible? Don't see any syntax for supporting this scenario.

    Welcome to the forum!
    Whenever you post provide your 4 digit Oracle version.
    >
    I have a table which has range partition on a number column.
    CREATE TABLE TEST(
    id INT NOT NULL,
    start INT NOT NULL
    PARTITION BY RANGE (start)
    PARTITION old_Data VALUES LESS THAN (1000000) TABLESPACE old,
    PARTITION new_Data VALUES LESS THAN (MAXVALUE) TABLESPACE new
    I would like to create monthly interval partition in old_data partition. Is this possible? Don't see any syntax for supporting this scenario.
    >
    No - it is not possible. There isn't any syntax for supporting that because integers do have have 'months' so how would Oracle partition an integer 'monthly'?
    If those integers are supposed to represent Unix 'epoch' date values then in 11g you can create a virtual column of DATE datatype and partition on that.
    But you will need to either recreate the table or, if you needed to do it online, use the DBMS_REDEFINITION package. Either approach results in a new table with the correct partitioning that includes the existing data.
    Here is a similar table to yours with a VIRTUAL column that is partitioned by day:
    drop table some_table_int
    create table some_table_int (
        column_1 nvarchar2(50),
        start_t number(38,0),
        column_n number,
        start_date DATE GENERATED ALWAYS AS (
        to_timestamp(to_char( to_date('01011970','ddmmyyyy') + 1/24/60/60 * start_t, 'DD-MON-YYYY HH24:MI:SS'),'DD-MON-YYYY HH24:MI:SS')
      ) VIRTUAL
    partition by range (start_date) interval (NUMTODSINTERVAL(7,'day'))
    (partition p_19700105 values less than (to_date('19700105', 'yyyymmdd'))
    /That VIRTUAL column is an ordinary DATE column and your ranges will be dates rather than numbers that have no meaning for anyone.
    The VIRTUAL column is only a data dictionary entry so it won't affect any actual data.

  • About range partition

    Dear Friends ,
    I am using Oracle10g . I have to create a range partition like below :
    CREATE TABLE EMP
    EMPNO NUMBER(4),
    ENAME VARCHAR2(10 BYTE),
    JOB VARCHAR2(9 BYTE),
    MGR NUMBER(4),
    HIREDATE DATE,
    SAL NUMBER(7,2),
    COMM NUMBER(7,2),
    DEPTNO NUMBER(2)
    PARTITION BY RANGE(hiredate)
    PARTITION emp_1980 VALUES LESS THAN(TO_DATE('31/12/1980','DD/MM/YYYY')) TABLESPACE USERS,
    PARTITION emp_1981 VALUES LESS THAN(TO_DATE('31/12/1981','DD/MM/YYYY')) TABLESPACE USERS,
    PARTITION emp_1982 VALUES LESS THAN(TO_DATE('31/12/1982','DD/MM/YYYY')) TABLESPACE USERS,
    PARTITION emp_1987 VALUES LESS THAN(TO_DATE('31/12/1987','DD/MM/YYYY')) TABLESPACE USERS
    But the problem is :
    1) if any input data is not match with the above criteria then where it goes ? i mean , the data which dont follow the above rule which partition it goes ? is there any way to set DEFAULT partition option in the range partition ?
    I only find the DEFAULT option in LIST partition
    2) Barring this , when I add a new partition with the above then it shows the below error :
    alter table emp add partition emp.emp_1988 VALUES LESS THAN(TO_DATE('31/12/1988','DD/MM/YYYY')) TABLESPACE USERS
    Error :
    "ORA-14020: this physical attribute may not be specified for a table partition" ,
    Would anybody plz help me , How can I solve the above problems ?

    Range Partitioning provides for a range of values. Therefore, any value higher than the maximum value provided in your partition definitions would fail. Thus, for example, 01/01/1988 and above would error. That is why Range Partitioning allows you to specify a "highest" values possible where you say "values less than (MAXVALUE)". Therefore, if you had included an "emp_maxvalue" partition with "values less than (MAXVALUE)" after the "emp_1987" partition, any value for 1988 or higher would go into the emp_maxvalue partition.
    { Since there is no minvalue specified, a value of, say, 01/06/1979 would go into the "emp_1980" partition as it is "less than (01/01/1980)" ! }
    Again, as Partitioning is a Range of Dates, you cannot add a partition. You have to SPLIT a partition. For example, if you had an "emp_maxvalue" partition present, in order to create the emp_1988 partition, you would SPLIT "emp_maxvalue" into two partitions : emp_1988 and emp_maxvalue.
    Please read the documentation on Partition Maintenance in the Administrator's Guide.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

Maybe you are looking for

  • Using a barcodescanner in an application

    Hey all, I�m in education as an software engineer and I have to design an application in Java for my schoolperiod. It should be a tool to manage the products of our school-cafeteria and schoollibrary. I want to use a barcodescanner, to scan the codes

  • How to create Box in scripts

    hi   can anyone send how to create box, like table including vertical and horizontal lines in sap-scripts regards ratna

  • When I upload video, the video disappears and screen is green.

    I am uploading a few videos to Adobe Premier Elements, and when it is uploaded there is no video - just a green screen.  The audio still works.  The video plays perfectly in Windows Media Player.  Any suggestions?  Below is a picture of what it looks

  • Fifth Gen Driver issue

    Hello all, My fifth gen ipod was working fine up untill a couple of weeks ago when my pc started to display it as an unknown usb device. the only piece of info I get from the pc is to reconnect the device and if the problem persists replace the devic

  • CsrAttachmentUploadDiv part attachment is not rendered SP 2013(Attach file in not working for all the list forms)?

    csrAttachmentUploadDiv partattachment  is not rendered SP 2013(Attach file in not working for all the list forms)? Ravi function ShowPartAttachment() { ULSopi:     if (document.getElementById("part1") == null || typeof document.getElementById("part1"