Look for a partition in the range

Hi gurus,

I have a partition table,

CREATE TABLE sales
(
Number of SalesID
SalesNumber varchar2 (50).
Date of SalesDate,
Number of value TotalAmount
)
PARTITION BY RANGE (SalesDate)
(PARTITION P_JAN VALUES LESS THAN (TO_DATE (1 JANUARY 2008 ',' DD/MM/YYYY "")),)
PARTITION P_FEB VALUES LESS THAN (TO_DATE (JANUARY 2, 2008 ',' DD/MM/YYYY "")).
PARTITION P_MAR VALUES LESS THAN (TO_DATE (JANUARY 3, 2008 ',' DD/MM/YYYY "")).
PARTITION P_APRVALUES LESS (TO_DATE (JANUARY 4, 2008 ',' DD/MM/YYYY ')),
PARTITION P_MAX VALUES LESS THAN (MAXVALUE))
;

I need to dynamically manage partitions based on the criteria of data,

for example. to TO_DATE (January 5, 2008 ',' DD/MM/YYYY '), first I have to check if there is no partition exisits who, if so have need create this partition, a parition/month

an entry for this condition is just a date, it can be any date.

Please help me get the right query.

Thank you

Could you just do new lines fall under the partition of "p_max' by default and launch something to divide every so often?

User_tab_partitions (perhaps with user_part_key_columns to check key columns) questioning made delicate by the fact that high_value is a LONG column. It may be easier to read in a PL/SQL variable and check it on the procedural level.

11g can automatically create missing partitions on the fly so it might be easier to upgrade rather than developing your own.

Tags: Database

Similar Questions

  • On the partition of the range

    Dear friends,

    I use Oracle10g. I need to create a range partition as below:


    CREATE TABLE EMP
    (
    EMPNO NUMBER 4,
    ENAME VARCHAR2 (10 BYTE),
    USE VARCHAR2 (BYTE 9),
    MGR NUMBER 4,
    HIREDATE DATE,
    SAL NUMBER (7.2).
    NUMBER (7.2), COMM.
    DEPTNO NUMBER (2)
    )

    PARTITION OF 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 no data entry is not match with the criteria above, then where he's going? I mean, not the data that don't follow the rule above which partition it will? is it possible to put the option DEFAULT partition in the partition of the range?
    I find that the DEFAULT option in the partition from the LIST

    (2) except that, when I add a new partition with what above, then it shows the error below:

    change the emp table add partition emp.emp_1988 VALUES LESS THAN (TO_DATE('31/12/1988','DD/MM/YYYY')) USERS TABLESPACE


    Error:
    "ORA-14020: this physical attribute may not be specified for the partition table."



    Someone could help me please, how can I solve the above problems?

    Range partitioning provides a range of values. Therefore, any value greater than the maximum value in your definitions of partition would fail. Thus, for example, 01/01/1988 and would especially error. That's why the range partitioning allows you to specify a 'best' possible values where you say 'lower values (MAXVALUE) '. Therefore, if you had included a partition "emp_maxvalue" by 'lower values (MAXVALUE)' after the partition of 'emp_1987', any value of 1988 or higher would go in the emp_maxvalue partition.

    {Because there is no minvalue specified, a value of, say, 06/01/1979 would go in the score of "emp_1980" as it is "(01/01/1980) below"!}

    Yet once, as the partitioning is a date range, you cannot Add a partition. You need to DIVIDE a partition. For example, if you had a present "emp_maxvalue" partition, in order to create the partition of emp_1988, you would be SPLIT "emp_maxvalue" into two partitions: emp_1988 and emp_maxvalue.

    Please read the documentation on the Partition maintenance in the Administrator's Guide.

    Hemant K Collette
    http://hemantoracledba.blogspot.com

  • You are looking for an application unzip the files on iMac

    You are looking for an application unzip the files on iMac. I can find lots of 3rd party applications, but how do I know that they are safe? When I look in the app store, they say for iPhone or iPad can I use one of these?

    THX

    1. There is usually no additional software to do so; Simply double-click the zip in the Finder. If this method does not work for any reason, use The Unarchiver.

    2 No.

    (140768)

  • I am looking for regentry.chm of the Windows 2000 Resource Kit.

    I am looking for regentry.chm of the windows 2000 resource kit

    Hello

    Because you are using the Windows 2000 resource kit, it will be better to post the same question in the Technet forums and check if it helps.

    You can follow the link to your question:

    Windows Small Business Server: http://social.technet.microsoft.com/Forums/en-us/category/sbsserver

  • Looking for an update of the bios for Acer aspire M1641 motherboard

    Looking for an update of the bios for Acer aspire M1641 motherboard

    All I could find was the one for the acer aspire M1640 which has a different card number, but is as close as I can get for it. That's the good? If this isn't the case, anyone would be able to point me in the right direction?

    Thank you.

    FTP://FTP.Acer-euro.com/desktop/aspire_m1641/BIOS/

  • Looking for specific files of the .bkf. Is this possible?

    I have an external drive on which I had saved the entire desktop.  Desktop is dead (without power on/off switch) and now have a new laptop.  Looking for specific files of the .bkf.  Is this possible? If this is not the case, how can I 'restore' old office files to new pc? XP on desktop and laptop.

    What are the Windows Vista forums. Please repost your questions in the forum XP here: http://social.answers.microsoft.com/Forums/en-US/category/windowsxp.

  • Microsoft Flight Simulator has stopped working. Windows is looking for a solution to the problem

    Original title: games

    When I start my X Microsoft Flight Simulator (Deluxe Edition), it is running propely for some time (15 to 20 minutes) that it no longer works and gives me a message "Microsoft Flight Simulator has stopped working. Windows is looking for a solution to the problem"and he have me to close the program. (I have Windows 7)

    Help, please. :)

    I just "uninstalled" pack of the accelerator, and it worked fine.

  • Can I delete my recovery for WIN7 partition after the upgrade

    Can I delete my recovery for WIN7 partition after the upgrade.

    What can I INSTALL CLEAN so I want

    What should I do when I need to reinstall Windows 10?

    The upgrade is a download of ISO or just installed on WIN7?

    The application upgrade says to reserve my copy so I did but I never got confirmation of this email?

    July 29, 2015.

    How to get the Windows 10 free upgrade

    J W Stuart: http://www.pagestart.com

  • Looking for ways to solve the following problems of these messages: "check the temp environment variable. "Unable to print the document. "You don't have permission to save in this location."

    Looking for ways to solve the following problems of these messages: "check the temp environment variable. "Unable to print the document. "You don't have permission to save in this location."

    Hi Michael,

    Please follow the link and see the issue:

    Cannot print or preview before printing a Web page in Internet Explorer: http://support.Microsoft.com/kb/973479

    If the problem is specific to MS Word, then I suggest you to post the same question in the forums of MS Office for assistance.

    Microsoft Office Forum:

    http://answers.Microsoft.com/en-us/Office/Forum/Word

    I hope this helps.

  • I'm looking for a link to the 'Adobe Creative Suite Design Premium' Netherlands/Dutch version

    I'm looking for a link to the 'Adobe Creative Suite Design Premium' Netherlands/Dutch version. I was promised this week to be contacted by a "senior" by Adobe support person. But after 5 days still nothing. Need help finding the download package. It is not available via the Adobe Web site.

    Who can help me please?

    [Go to the living room to a support forum - Moderator]

    I think it's more creative Cloud as Creative Suite.

    Language switching in Cloud applications is a preference setting. Switching language non-Cloud has always required contacting Adobe, as the license is tied to the language. Language files must be included with the installer and the legacy versions are archived with different groups of language files.

    For the Suites and standalones inside each suite - I have always understood that the languages listed next to each link are the only ones to be included in this specific download.

    Very few languages listed for CS5 Design Premium. No Dutch so I do not think the OP won't get a Dutch version of one of the links below.

  • Hi, I m looking for a decoding of the 0x6101be5 fault code. Any idea to solve this problem?

    Hi, I m looking for a decoding of the 0x6101be5 fault code. Any idea to solve this problem?

    Type of the printer is Photosmart D5460

    Thanks a lot for hel

    steviedanielle

    It could be a work around. each time u replace each cartridge. Turn on the printer and check if that make all the difference... Although the chances of losing these cartridges are more unless your next printer uses the same cartridge

  • Partition of the range

    Hello

    I want to ask if I can create the partition of the range of like 10 minutes? As I have data of 1 hour and I want to make a partition of 10? Please suggest

    Thank you

    Try place range partitions in good condition

    create table part_test ( id date) partition by range(id)
     ( partition p1 values less than(to_date('01-JAN-2012 01:00:00','DD-MON-YYYY hh24:mi:ss'))
      ,partition p2 values less than(to_date('01-JAN-2012 02:00:00','DD-MON-YYYY hh24:mi:ss'))
    .....
      ,partition p24 values less than(to_date('02-JAN-2012 00:00:00','DD-MON-YYYY hh24:mi:ss'))
     );
    
  • Satellite Pro U400 - C14 - I'm looking for a replacement of the battery

    Hello
    I am looking for a replacement battery for this laptop.
    Could you please tell me if the piles of:

    Satellite U400-108, Satellite U400-10I, Satellite U400-10J,
    Satellite U400 - 10L, Satellite U400 - 10 M, Satellite U400-10N,
    Satellite U400-10O, Satellite U400-10 t, Satellite U400-112,
    Satellite U400 - 11L, Satellite U400-11 q, Satellite U400-11 t.
    Satellite U400-12R, Satellite U400-13d, Satellite U400-14 b,
    Satellite U400 - 14 M, Satellite U400 - 14 p, Satellite U400-15E,
    Satellite U400 - 17 H, Satellite U400-C01, Satellite U400-ST3301,
    Satellite U400-ST3302, Satellite U400-ST5404, Satellite U400-ST6301

    Would correspond to it?
    I am looking for a battery 7800mah or 6600mah

    Peace

    Hello

    You can use the 6000mAh Battery Pack Li - ion, 9-cell, part number: PA3537U-1BRS

    I found this on the page of Toshiba Europe Options & accessories.

    If you would google for this part number, you should find deals online.

    See you soon

  • Qosmio G30: I am looking for an atenna with the appropriate male connector

    My G30 came with an analog TV tuner antenna adapter. The adapter is female. IM hardly an atenna with the appropriate male connector to connect this adapter. I tried one type of coaxial cable but failed.

    In this case, what is the type of connector should I look for?

    Thank you.

    Hello

    Hmmm, a long time ago, I used a G20 and I think the G30 is using the same antenna adapter.
    I simply connected the antenna to the coaxial antenna cable adapter.

    These coaxial cables use male and female connectors.
    There are also adapters with 2 x female or 2 male connectors.

    I think that you should just ask the computer, TV/video shop for a compatible cable/adapter!

  • looking for a file in the disk

    Hello and greeting to your friend,

    I'm looking for a command or a small program that displayed the files by their names in directories and returns a Boolean value, true if the file exists and, if mistakes.

    Thank you

    You can use the recursive file list feature to create an array of file names. Then do a string search in this table:

    Your regalar expression would be "^ foo". Refer to "Match Regular Expression" primitive for more information on regular expressions. Also you can watch here in the forums since it is a regularly discussed topic and, unfortunately, not too easy at first...

    Norbert

Maybe you are looking for