the use in a column of the model similar to to_char('mm/rr')...

Hello
I need to declare a check constraint that allows only values with the format "to_char('mm/rr')".
So, I have a table:
create table cost_period (id number (2), cost_period varchar2 (5))
and I said the check constraint:
alter table cost_period 
add constraint cp_chk check(regexp_like(cost_period, '^[0-1][0-9]/\d{2}$'))
and I inserted records to test...
insert into cost_period
values(1,'10/10');
insert into cost_period
values(3,'01/10');
insert into cost_period
values(2,'11/10');
insert into cost_period
values(6,'13/10');
insert into cost_period
values(7,'00/10');
all them above were inserted... whereas only the first three should... the fourth because there is no 13 months of a year, and the fifth because there is no month '00'.

How I change the constraint...?

Note: I use db10g v.2
Thank you
SIM

try to incorporate in your code the TO_DATE function to force an error if the value inserted is not a valid date.

SQL> select to_date('00/03','mm/dd') from dual;

select to_date('00/03','mm/dd') from dual

ORA-01843: not a valid month

SQL> 

you check constraint:

alter table cost_period
add constraint cp_chk check(TO_DATE(regexp_like(cost_period, '^[0-1][0-9]/\d{2}$'),'mm/dd'))

Note: not tested

Tags: Database

Similar Questions

  • First group title below displays under the column headers using the model 23 classic report with the help of repeat titles on break

    Hello

    I am migrating an application from 3 APEX APEX 4.2 on a thing I noticed with the classic reports when I put them in the model 23, it's that the first section break has break notch under the headings of columns for this section of line while the remaining lines properly have it display above the headers on the subsequent sections of group.


    When I look at firebug code I saw that all the tables but the first, the break line is included in the last line of the previous table, so I can see how it did not work for the holidays since.

    I have tow questions.

    1. is it really intentional because it seems not terribly elegant and my users to zero immediately above as a perceived bug.

    2. is there a reasonable job around always use headers repeat on break? I have multiple reports on the same page in places so switch to interactive reports is not a quick fix for me in this case.

    Example of a question can be seen at apex.oracle.com at home

    Thank you

    Brad

    Roadling wrote:

    Hello

    I am migrating an application from 3 APEX APEX 4.2 on a thing I noticed with the classic reports when I put them in the model 23, it's that the first section break has break notch under the headings of columns for this section of line while the remaining lines properly have it display above the headers on the subsequent sections of group.

    1. is it really intentional because it seems not terribly elegant and my users to zero immediately above as a perceived bug.

    The Standard report template definition in issue 23 contains thead and tbody elements:

    Before the column header

    
    

    Column title template

    #COLUMN_HEADER#
    

    After the title column

    
    
    

    After the lines

    
    
    
    
    
    
    #PAGINATION#
    
    
    
    

    This is intentional, the best practice for marking up HTML tables. What is not expected is the problem that arises when this model is used with the break of repeat titles on break formatting option. The repeated headings result table consisting of soup of tags containing several poorly constructed tbody and thead, which is not valid elements.

    2. is there a reasonable job around always use headers repeat on break? I have multiple reports on the same page in places so switch to interactive reports is not a quick fix for me in this case.

    Create a copy of the report model Standard in Standard (break formatting) for use with reports of the break, remove the thead and tbody definitions of template tags and the breakdown of the reports to use the new model of change. (Or, if you use mainly break reports using the Standard template, keep the tags in the copy and remove them from the original in order to minimize the number of reports, you need to change.)

    Personally, I would create a report model of line custom to break complex reports in order to be able to have complete control over the structure and presentation.

  • Impossible to enter the title of the document when you use the model of two columns left navigation

    I use DW 8, two columns left navigation model to rework my company Web site. My level of experience is probably beginner (known in Web design database and update existing sites; minimal associated style sheets).

    From the model mentioned, I created a template for my business site and saved it as "template.dwt." Then, I created a new page using this template. I click in "Title" and type the title of the page, but it defaults to "untitled document".

    I tried to follow the message thread of beachnut2 to "Model has locked the title of the document", but got lost. I followed the advice of Murray "create a new page. Save it as a template with FILE | Save as
    Model. Look at the code. The code on this new model, I created is as follows:

    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
    "< html xmlns =" http://www.w3.org/1999/xhtml "> "
    < head >
    < meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 "/ >"
    < title > Untitled Document < /title >
    < / head >

    My model based on the two-column template is as follows:

    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
    "< html xmlns =" http://www.w3.org/1999/xhtml "> <! - DW6->"
    < head >
    <!-copyright 2005 Macromedia, Inc. All rights reserved. ->
    < meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 "/ >"
    < title > Untitled Document < /title >
    < link rel = "stylesheet" href = "2col_leftNav.css" type = "text/css" / > < / head > "

    If I do the above tag looks like the blank template, I created, I lose the stylesheet link before the < / head > tag.

    Any suggestions on how I can fix this?

    Thank you for your quick response. I thought I had followed your instructions by creating a new document and save it as a template. The mistake I made was selecting a new basic HTML when I was selecting the new model basic HTML. This time, I got the correct tags, the copied on my model and it works now. Thank you for your help.

  • Pages export to Word using the model of NEWSLETTER, issue 1 of page spacing

    QUESTION: Anyone know if model NEWSLETTER (and or Museum Brochure) correctly export to .docx and how delete images or change the text boxes using these models so that I am still able to export properly?

    I used the NEWSLETTER model, whose Pages can export to .docx and then import to .docx (I don't know if that Word can do, but Pages indicates it would be).

    Problem: after the header of the newsletter, I removed the photo and have floating only the areas of text underneath.  I have two pages, the 2nd page export perfect (a page break separates it from the first).  On the first page, there are 12 small boxes in two columns under the heading who generously and easily fit on the first page.  It is not unlike the model I have, however, but with no photos.  I've seen many templates use these 'boxes' in support of the columns of text on a page, I don't think the floating box would be a problem.  However, I like the wish of floating boxes to learn how to use them so that they "work".

    I saw immediately that the text boxes, I added, when export and imported .docx, lose their place and float under the heading (NEWSLETTER) (superimposed text, bad page layout).

    I noticed the paragraph (carriage return, Enter) symbols, while I moved around text boxes, had become interlaced between the boxes, but not all - 1/2 at the bottom of page.  I then noticed that attempt to remove the superfluous paragraph runs in .pages (after repositioning all the boxes), but aggravated .docx, also the Pages do not leave even to remove the first symbol (it mystifies me, because the models do not appear to use paragraph at all except inside the floating boxes).

    Finally, I added enough symbols paragraph so that there was a conflict between each text box, but not as much as Word decide to add a blank page.  I had to make sure the columns are too wide - they should be 1/4 "part we will tell.  THAT APPEARED TO WORK.  Pages exported and imported it point by point I was happy.

    But when my Advisor job achieved and open in Word (the one for Windows 7), the SAME problem, I had before setting the transport returns appeared: the two decoders or four are overlapping the title, and set the person must have inserted transport returns before the first text box to move it all down (which seemed to work - but failed as an export and no not to use practice later).  'good work '.  Fortunately, I also have attatched a PDF export, however the person had asked to change their PLU using high government dell.

    QUESTION: Anyone know if model NEWSLETTER (and or Museum Brochure) correctly export to .docx and how delete images or change the text boxes using these models so that I am still able to export properly?

    Thank you hope that your next print job loose its staples.

    Well, we have said for years in this community if you want stressless, architecture native document exchange with Windows Word users that you need to use the most recent Word available on the Mac.

    Pages is not a clone of Word, and Apple does not guarantee that the open translation process / export from/to the architecture of document Word will remain faithful to the original of the document formatted.

    In response to your questions:

    1. If you have document objects in a model with x on their border, and then the object is locked. You visit the tab Pages to reorganize v5, and downstairs you can unlock these objects for further editing, or deletion.
    2. It is advice that we can give here will make sure Pages exports specifically to the word he already did not. The logic of translation is connected to demand, and it is the price of roulette.
    3. Continue the first paragraph.
  • Cannot use mathematical operations on the settings defined in the model

    We use BI Publisher 11.1.1.6

    We have a report that contains a few settings entered by the user.  The model defines variables to parameters like this:

    <? param@begin:loadsch;5? >

    I can see the $loadsch parameter in a field very well, using this code in a domain: <? $loadsch? >

    Note that the parameter is given a default value.  When you use the preview function in Word template designer, things work fine.

    The problem arises when a mathematical operation on the variable $loadsch.

    When previewing in Model Builder, I can display a field with the following formula: <? 1 + $loadsch? >

    But, when you view the report on the BI Publisher server, I get very informative typical error: oracle.xdo.XDOException: java.lang.reflect.InvocationTargetException

    Looking at the server logs, I see the following error information:

    Message from the incomplete xslt._XDONFSEPARATORS: decimal: null, grouping separator: null

    Error XSL:

    Further details < line 74, column 367 >: XML-23002: internal xpath (error)

    @Line 74 == > < / _P > < _Q > < fo:inline XML: Space = "preserve" font-family = "Arial" height = "9.0pt" police-family-generic = "swiss" white-space-collapse = "false" color = "#000000" style-name = the size of the 'Normal' font = "9.0pt" > 3: < xsl: variable xdofo:ctx = xdofo:ctx2 '17' = 'wrapper' name = "fv3" > < xsl: Value-Select = "1 + xdoxslt:one ($loadsch)" xdofo:field - name = '1 + $loadsch' / > < / xsl : variable > < xsl: value-of select = "xdoxslt:ms_format_number ($_XDOXSLTCTX, xdoxslt:one ($fv3), ' #, ##0.0')" / > < / fo:inline >

    Message from oracle.xdo.XDOException: java.lang.reflect.InvocationTargetException

    More details at oracle.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1233)

    at oracle.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:279)

    at oracle.xdo.template.FOProcessor.createFO(FOProcessor.java:1973)

    at oracle.xdo.template.FOProcessor.generate(FOProcessor.java:1143)

    at oracle.xdo.servlet.RTFCoreProcessor.transform(RTFCoreProcessor.java:124)

    at oracle.xdo.servlet.CoreProcessor.process(CoreProcessor.java:494)

    ...

    Caused by: oracle.xdo11g.xqxp.XQException: XPTY0004

    Someone knows how to fix this?  How can I perform mathematical operations on the setting?

    the error may be in operation as (number + string)

    then you can try

    
    

    or

    
    

    Further detail : 23002-XML: xpath internal (mistake)

    @Line 74 ==> <_Q>3:

    sure what error occurred by ""?

    any other code exists in your report?

    Thanks for posting more details

  • How and where can I find my Macbook Pro using the model number

    How and where can I find my Macbook Pro "using the MODEL number" NOT the serial NUMBER please...

    Hello world:

    I would like to know more about my MacbookPro using model # is if there is a website or a program that I can type my model # so she'll tell me more on my computer...?

    http://www.EveryMac.com

  • Can I use the drivers for model Satellite A100-012 to the model A100-599?

    Hello. I wanted to know that the drivers of the model a100 012 can be used to model a100 599?

    Configuration for both models is the same.

    Hello

    I compared these two units, and it seems that the A100-012 is a part of the PSAA9E series and the A100-599 belongs to the PSAARE series.
    So generally, these are two different notebooks and I m do not know if the drivers work.
    But who knows sometimes laptops are delivered with the same hardware and maybe you are a lucky man and some unique drivers will run

  • Is there an API that returns the model number or any other identifier for a module installed, I can use to identify the characteristics of this module?

    For example, I'll call you

    DaqSystem.Local.GetPhysicalChannels (PhysicalChannelTypes.AI, PhysicalChannelAccess.External)

    For a list of connected devices.  The data in the table back looks like this:

    cDAQ1Mod4/ai0 (etc.)

    It tells me that I have a CompactDAQ chassis, which is good, and an analog module in the slot Module4.  What I need to know is not just that there is an analog module in the slot to #4, but also of its ability (voltage, temperature, voltage, etc.) so that I can use the correct DAQmx task for this type of module.  All this has to be discovered during execution.

    Otherwise, I'll have to provide a configuration utility when the user program needs to determine which module is plugged that slot - and will it change by moving it to another location, you must enter these details again.  I want to avoid this by making the material more discoverable as possible.

    I can remember an API - and that is my hope.

    * beep *.

    Hello

    I could understand the syntax for you. It's here.

    Device blah = DaqSystem.Local.LoadDevice ("cDAQ1");
    foreach (String dev in bla. ChassisModuleDeviceNames)
    {
    Label1. Text += "\n" + DaqSystem.Local.LoadDevice (dev). ProductType;
    }

    This displays the model number of all modules of the cDAQ in the chassi. I hope this helps.

    Kind regards

    Perry S.

  • HP 1287c Windows 7: windows 7, try to use the model of hp 1287c hp 5302 keyboard does not

    have a hp 1287c windows 7 tries to use the model of hp 5302 keyboard does not respond

    try to use the old Hp keyboard model 5302 was for windows 2000 did not know if could use when I plug computor does not recognize he wonding if possible to work?

    45fmj

    Hello

    Well, the keyboard is now very cheap, the converter may not work correctly. After 16 years of him please give a rest.

    Kind regards.

  • How to use the model instead of RP pspice to create the new component?

    Hi, I need to create the model of opa890 of TI, but I found no spice I find model pspice, how to use it to create the new template part.

    Fouda, salvation

    I took a quick glance to the component but for some reason, the model pspice does not correctly applied to the component. The second problem was that the pins have been mapped properly. I've done the component for you with the model and print and attached it to this message. You just need to add it to your database of click with the right button on the component, and then clicking on save to DB component.

    If all goes well, you should start to see the results of the component. I hope this helps.

    Best regards

  • Access to information USE testsocket in the model of batch processing

    Hello

    I have a custom reminder pre-batch TS 4.0, which fills in the serial numbers, part numbers, etc for the DUT being tested (using a model of batch processing). These variables are found in the pre-batch settings. However, I can't understand how to access these values further reminders (SequenceFilePostStepFailure, for example).

    In the pre-batch sequence, I can access the serial number for UUT4 using Parameters.ModelData.TestSockets [4]. USE. Serial number. But I can't find the object of ModelData when you don't the pre-batch and tried to look in the root, runstate, hand, sequence, etc., without a bit of luck.

    Any thoughts?

    Thank you

    Chris

    You can find it at:

    RunState.Root.Parameters.ModelData

    There will be only at runtime, and only when you actually run using the model of batch processing.

    Hope this helps,

    -Doug

  • What is a good way to use the queues for the model of consumers/producers?

    Hi all

    I am following the model of consumers/producers to use the queue to synchronize the following process: the producer is a loop to produce a number N, I will put each number generated in a table and after each 5 numbers generated, I put the table in the queue and pass it on to the consumer. I have to wait the use by consumers of the data and it will then remove the item from queue so that producers will have the chance to produce another 5 numbers. As I put the maximum size of the queue one, I expect that the producer and the consumer turns to produce / consume all five numbers and the opportunity to another. Here is my code

    When the checkbox is false, the code will be

    For the first 5 numbers, product will generate every thing right and put it in the table, and it's going to pass the array to the quere so that the consumer will have the chance to loop through the table. I except the procude loop will continue only when the queue is available (i.e. all items are deleted), but it seems that once the consumer starts the loop loop of the product will continue (if the indicator x + 1 and x 2 will be changed to numbers). But this isn't what I want, I know there must be something wrong, but I can't say it is.

    dragondriver wrote:

    As you say in 1, sequency structure to enforce the order of execution, that's why I put it here, in this example, the simple question, I replace the complete code with increase in the number, in the real case, the first markers + 1 and + 2 must be performed in this order.

    Mikeporter says:
    1. get rid of all the structures of the sequence. None of them are nothing but apply a work order which would have been the same without them.

    So even if you delete the sequence structure, there will be a fixed & defined order and it is because LabVIEW follows the MODEL of FLOW OF DATA.

    Data flow model (more precisely in the context of LabVIEW): a block diagram node runs when it receives the required inputs. When a node is running, it produces output data and transmits data to the next node in the path of the data stream. The flow of data on the nodes determines the order of execution of the VIs and functions on the block diagram (click here for reference).

    Now in your code, just remove the sequence structure will not make you order will be going to stay the same, but you need to do some very minor changes (as thread of the error in loop, before that he go to the node "Élément Dequeue").

    Come to the main point: it's a good way to use the queue for the consumer/pmodel that?
    The model you are using (and qualifying as consumer/pmodel) is much too deviated from the original consumer/pmodel which model.

    dragondriver wrote:

    For the second, Yes, it's my fault for delete, though. I'm actually the example of model of producer/consumer design pattern, but I do not pay attention to the while loop in the part of the consumer.

    While loops (two producers & consumers) are the essential part of this architecture and cannot be deleted. You can start your code using standard model.

  • CUC - uses the model of eggs of 1000 users for users of 1100?

    Hello world

    According to http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/connection/10x/suppor...

    If I select the model of the EGGS for 'Platform Overlay for up to 1,000 virtual users'
    -Means that the user account and the mailbox in the UCA should not exceed 1000 UESRS?

    If I have 1100 UESRS and very very low use of voicemail, I can still using this model of EGGS "CUC 1000 user?

    Thanks in advance

    Sam

    Hello

    According to my understanding, surpassing the number of users speciied in EGGS will not raise any errors. However, given that the product has been tested with some settings for optimum performance, exceeding the specified limit is not recommended and very probably is not supported by the TAC in the case of any performance issues.

    Manish

    -Does the rate of useful messages-

  • Change the model of phone using BAT button

    Hello

    Is it possible to use BAT to change the 'model of phone button' which is attributed to several phones?

    You cannot use BAT for updating the model of phone on existing phones button. However, you can set up the model of phone button on phones that you add by using BAT, so you can export the phones that you want to change, remove them from the CCM and add them using bat with the model of phone updated button.

    I hope this helps. If so, please indicate the position.

    Brandon

  • I am trying to perform a static check on the model. When I double click the model and go to the tab control... There is nothing to select in the knowledge module. I want to use CKM here... but nothing appearing in the drop-down menu. The global KMs are no

    I am trying to perform a static check on the model. When I double click the model and go to the tab control... There is nothing to select in the knowledge module. I want to use CKM here... but nothing appearing in the drop-down menu. The global not supposed to KMs the listed here?

    Hello

    You have imported the whole CKM in modules of knowledge?

    If not, import ckm and do it.

    Kind regards

    Gangareddy.k

Maybe you are looking for