Value using request validation

Apex 3.2

I have a create/update form with some fields of date.

I added validation to make sure that these are the date using the (the specified element is a valid date) standard validation type.

These have a query condition is contained in the expression 1

Expression 1 = SUBMIT, CREATE

All these work very well.

I need to add other validations, i.e. a single date must be greater than another date.

I used a validation function that returns a Boolean

If to_date (": P3_PROMOENDDATE, ' dd.mm.yyyy") > to_date (": P3_PROMOSTARTDATE, ' dd.mm.yyyy") then

Returns true;

on the other

Returns false;

end if;

These have a query condition is contained in the expression 1

Expression 1 = SUBMIT, CREATE

Now if I enter dates in the correct format, the 2nd validation above works, but if I get the wrong date format.

That is to say, ffff. Then 2nd validation errors

ORA-01858: a non-digit character was found here where was waiting for a digital

ErrorERR-1021 cannot run the validation of the "body of the function that returns a Boolean.

I tried to change the condition of no validations inline display and added the code to my validation, to consider the request.

If: REQUEST to ('CREATE', 'SEND') then

If to_date (": P3_PROMOENDDATE, ' dd.mm.yyyy") > to_date (": P3_PROMOSTARTDATE, ' dd.mm.yyyy") then

Returns true;

on the other

Returns false;

end if;

end if;

I still get the above error

Gus

Gus C wrote:

My date format is DD. MM YYYY

If I use this code

declare

date d;

Start

d: = to_date (: P3_PROMOENDDATE, ' MON-DD-YYYY "");

The mask format used here must be identical to the one used in the element.

Returns true;

exception

while others
then
If sqlcode between 1899 and-1800
then
-Date format error
Returns false;
on the other
-Unexpected error
lift;
end if;

end;

I get the error

ORA-01858: a non-digit character was found here where was waiting for a digital

When you use this code? This error should be caught by the exception handler in the block. It is likely that it is actually triggered elsewhere. Check the debug trace.

I expect the validation code to look like:

begin

  return to_date(:P3_PROMOENDDATE, 'dd.mm.yyyy') > to_date(:P3_PROMOSTARTDATE, 'dd.mm.yyyy');

exception

  when others
  then
    if sqlcode between -1899 and -1800
    then
      -- Date format error
      return false;
    else
      -- Unexpected error
      raise;
    end if;

end;

Tags: Database

Similar Questions

  • Presentation tabular popup lov display value erased during validation

    Hello Infantraj and Jitendra

    I have exactly the same problem as in your discussion here

    Presentation tabular popup lov display value erased during validation

    Could you please share what was the solution?

    Hi Mark,

    Just follow the steps described in the blog (Cluttermeleon: Oracle APEX - descriptions of disappearing Popup LOV key) which is given in the thread. Instead of Java script that is at the page level using

    function get_LOV_value (pLOV, pId) {}

    If (pId! = ") {}

    get var = new htmldb_Get (null, $v ('pFlowId'), 'APPLICATION_PROCESS is get_LOV_value', 0);

    get.addParam('x01',pLOV);

    get.addParam('x01',pId);

    Return get.get ();

    }

    }

    Thank you

    Infant Raj

  • How to use the validator for an inputtext inside the af: column

    Hi Experts ADF,

    Jdev version 11.1.1.7.0

    I created a datacontrol pojo based. And trained as a table in a jsf page. I have a column in which I have an inputText.

    Initially the inputText is a certain values as 0, 10 and 12 respectively.

    Now, I want the end user to change some values in this column and the validation range must be between 1 and 10000.

    But after using the validator if other lines have default values 0 then validation is triggered for all lines.

    Thank you

    AR

    Try to put the table in clickToEdit mode.

    Timo

  • Newbie - how to use a validator

    I would use the NumberValidator, but I don't know how.  I instantiated and set several properties:

      var numVal:NumberValidator = new NumberValidator();
      numVal.allowNegative = false;
      numVal.maxValue = "99999";
      numVal.minValue = "0";
      numVal.source = value;
      trace(???);
    
    

    I think I put min, max and no negatives.  In addition, I think that I put the number of input (in a variable called value) that comes in a string.  What I want to do is find the results, as evidenced by question marks.

    Maybe it wasn't the best ever... the MX:TextInput example I used only to be able to change the data I want to validate at runtime, if you remove the first line in the method validateVar (source.data = data.text ;) and the MX:TextInput that it will work and will conduct validation with 1 (data: 1).)

    Tag MX of the input text will be visible in the form, but as I said above it is not necessary. I don't know if its part of you question, but with private var source: Object = {data: 1}; I'm defining an object with a known attribute with the value 1, which later I use for validation.

    I'll post you a new example so it will be more clear...


    http://www.Adobe.com/2006/mxml"layout ="vertical">
       
            Import mx.validators.ValidationResult;
    Import mx.events.ValidationResultEvent;
    Import mx.validators.NumberValidator;
               
    private var source: Object = {data: 1};
    private function validateVar (): void
    {
    validator: NumberValidator var = new NumberValidator();
    Validator.source = source;
    Validator.Property = "data";
    validator.minValue = 10;
    var result: ValidationResultEvent = validator.validate ();
    trace (result.type);
    }
    ]]>
       

           

    Here you have no MX tags and validation will be performed with 1 (data: 1).

    If I assign values to tags existing MX, which raises an error if the input is bad?  I guess it would be.  But then I wouldn't need the validator at all.

    I don't know if I get this is good, but if you give the service response to MX tags, and each tag MX has a validator it does not raise an error (exception), but it will be validated and the MX:textInput will be 'invalid' (with a red square that surround it)

    If I wasn't clear with something let me know...

  • Cannot set attribute of the param element value using javascript in setAttribute

    When adding the items param via createFragment the javascript in setAttribute function does not set the "value" attribute It is necessary to set the nodetext to add this attribute to the value of the param element.

    Second, when using the method of the generated html code defines the 'value' to the innerHTML. HTML code resulting in the display by "Inspect the system" looks like this.

    < parameter id = "myID" > myValue < / param >

    Note: [the element close text < / param > is displayed correctly using inspect, but when using file-> SavePageAs the end text is not saved correctly.] I reported this in another question of moz. support FF.]

    function setparamAttrs (parmID, parmVal)
    {

    var gData = document.createDocumentFragment();
    
     var newNode = document.createElement("param");
     var textStr = document.createTextNode(parmVal);
     newNode.appendChild(textStr);
    
     newNode.setAttribute("id", parmID);
     //newNode.setAttribute("value", parmVal);  // this does not work
     //newNode.setAttribute("innerHTML", parmVal);  //this does not work
    
     gData.appendChild(newNode);
     document.body.appendChild(gData);
    

    }

    However, I was able to retrieve the "value", once it has been added using:

    var val = document.getElementById("parm0").value;)

    getAttribute ("value") does not work either.

    Finally, I added the param elements to my HTML code like this.
    < parameter id = "myID" > myValue < / param >. Then I tried to extract the value using document.getElementById("myID").innerHTML. No text has been returned. When I looked at the HTML document with inspect my HTML param element is displayed as < param id = "myID" > myVal. The closing text of the element has not the same when I use SavePageAs which I mentioned previously.

    Yes, this is the correct way to this code and it works for me without any problem.

  • How can I use my valid product key XP Pro SP2 with my drive OEM XP Pro SP3 and still meet the requirements of Microsoft Genuine?

    I had to wipe my hard drive due to a battle lost by a virus. My installation of XP Pro SP2 disk disappeared, so I used my XP Pro SP3 OEM disc to install Windows. When I used my valid product key XP Pro SP2 I was shocked to receive an invalid product key. I always ran Microsoft Genuine product and would like to know how to reach a genine advantage accreditation with my present prediciment. Any help would be appreciated and we thank you in advance.

    Hi KevinDitner,
     
    I'm afraid, but you can't do that. Your product key Original Equipment Manufacturer (OEM) should be used only for the laptop which came with it.
     
    You can get the CD of Windows XP Professional Service Pack 2 (SP2) by contacting the Support team customer Microsoft.
     
    More information on:
     
  • I am reorganizing the attribute value using javascript. see code below

    Hi all

    I am reorganizing the attribute value using javascript. see code below and suggest me

    EX: id = "to THE:1" reorganize to id = "to THE:2"

    myDoc var = app.activeDocument;

    var myGlueCodePath = app.filePath + "/ Scripts/XML rules/glue code.jsx";

    var myFile = File (myGlueCodePath);

    app.doScript (myFile);

    If (app.documents.length! = 0) {}

    var myRuleSet = new Array)

    new findObjAttribute ("//auq")

    );

    {with (MyDoc)}

    var elements = xmlElements;

    __processRuleSet (Elements.Item (0), myRuleSet);

    }

    }

    else {}

    Alert ("you have no open documents!");

    Exit();

    }

    function findObjAttribute() {}

    myIdName = "findObjAttribute";

    This.XPath = ("[/ / auq[@id]");

    This.Apply = function (myElement, myRuleProcessor)

    {

    elmName = myElement var .markupTag .name;

    {with (MyElement)}

    try {}

    var myAttName = myElement .xmlAttributes .itemByName ("id") .value;

    SS var = myAttName.replace(/[A-Z]+\:/,""); "

    var SSS = ss - 1;

    myAttName = myAttName.replace(/[0-9]/,sss)

    $.writeln (myAttName);

    } catch (e) {};

    }

    }

    }

    Your code re - order the value correctly, but you don't have the update attribute in the element.

    Try this,

    myAttName = myAttName.replace(/[0-9]/,sss);

    myElement.xmlAttributes.itemByName("id").value = myAttName;

  • Setting value using javascript on the form of tables created by APEX_ITEM

    I can assign the value using javascript on normal form of table as below:

    var vRow = pThis.id.substr (pThis.id.indexOf ('_') + 1);
    $x_Value ('f05_' + vRow, 'Value');

    However I can't do the same if the tabular presentation is dynamically created by APEX_ITEM.

    Some tips on how to do this?

    Thank you

    If this should not be something like:

    this.id.substring(4, 8)
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • need help to get the value using the REGEXP_REPLACE function.

    I am trying to extract the value placed between "< listitems >... < / listitems >" but I am unable to get these value using the REGEXP_REPLACE function.
    select REGEXP_REPLACE('<InputParameters></ParamSet><listitems>14545454</listitems></ParamSet></InputParameters>'
    ,'(<InputParameters>.*<listitems>)(.*)(</listitems>.*<InputParameters>)'
    ,'\2') from dual;
    required output:
     1454554
    Can someone please help me achieve this goal.

    Hello

    You forgot the / before the last InputParameters. If fix you that, your code will work.

    Here is a slightly different way:

    SELECT  REGEXP_REPLACE ( '14545454'
                     , '^.*?(.*?).*$'
                     , '\1'
                     )     AS listitems
    FROM    dual
    ;
    

    Least to type, the less likely you will have to make typos.
    If there are 2 (or more) elements of listitmes, 1 will be returned.

    From Oracle 11.1, you can also use REGEXP_SUBSTR. I have Oracle 10.2 avaialable now, so I can test the following, but I think you'd say:

    SELECT  REGEXP_SUBSTR ( '14545454'
                     , '(.*?)'
                     , 1
                     , 1
                     , NULL
                     , 1
                     )     AS listitems
    FROM    dual;
    

    When it comes with the text that is or looks to, XML, consider using XML functions.

  • How to filter values using variable presentation if it uses a multiselec

    Hi gurus,

    Could you pls suggest me here.
    I have a requirement like my version 10G OBIEE isn't filtering report values when we choose a value any in dash prompt.
    I tried to create a variable presentation in the prompt for filtering, but invites under control, he is given a MULTI SELECT.
    I need to filter the values today if select us any value from the command prompt, it does not choose any value.
    How to filter values using MULTI SELECT Here.Please suggest me here.

    Kind regards
    SK

    Functions applied on the columns must be the two places (in report and guest) and must affect is fast after the function applied in the report.

    In your case is prompt value before cast, it seems that it is the reason why it does not work.

    Mark correct/good so pls help.

  • How to accept multiple input values using plsql

    I am in a process of design of a small tool. The tool must accept several input values. I know that this can be done using sql.
    But nothing, I can enter multiple values using the loop in the loop would be carried out according to the number of times a user wants to enter the values.

    It is also very good, if I can accept all the values at once and some how to analyze!
    SQL> set serverout on
    SQL> accept strings prompt 'input strings (comma separated):'
    input strings (comma separated):abcd,xyz,massimo,this,is,a,string
    SQL> declare
      2  s varchar2(32000):='&strings';
      3  begin
      4    for r in (select regexp_substr(s,'[^,]+',1,level) str
      5                from dual
      6              connect by level <= length(s)-length(replace(s,',',''))+1) loop
      7        dbms_output.put_line(r.str);
      8    end loop;
      9  end;
     10  /
    old   2: s varchar2(32000):='&strings';
    new   2: s varchar2(32000):='abcd,xyz,massimo,this,is,a,string';
    abcd
    xyz
    massimo
    this
    is
    a
    string
    
    PL/SQL procedure successfully completed.
    

    Max
    http://oracleitalia.WordPress.com

  • How to extract the second sysdate value using the EXTRACT function

    Hello

    I want to extract the second sysdate value using the EXTRACT function.
    When I run the following query I get an error;

    SELECT extract (second OF SYSDATE) FROM dual;

    ORA-30076: field of invalid extract for the source of the extract.

    When I do to extract the month I get the correct result.

    Is there some necessary formatting by specifying the sysdate (or any other date value) in the query. ?


    Thank you.

    You can extract only the year/month / day, day

    SQL> Select extract(year from sysdate) from dual;
    
    EXTRACT(YEARFROMSYSDATE)
    ------------------------
                        2008
    
    SQL> Select extract(day from sysdate) from dual;
    
    EXTRACT(DAYFROMSYSDATE)
    -----------------------
                         20
    
    SQL> Select extract(month from sysdate) from dual;
    
    EXTRACT(MONTHFROMSYSDATE)
    -------------------------
                           11
    
    IF you enter Minute or Seconds
    
    SQL>  Select extract(minute from sysdate) from dual;
     Select extract(minute from sysdate) from dual
                                *
    ERROR at line 1:
    ORA-30076: invalid extract field for extract source
    but with timestamp you can get the seconds
    
    SQL> select EXTRACT(second FROM current_timestamp) from dual;
    
    EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
    ------------------------------------
                                  39.473
    
    SQL> select EXTRACT(second FROM current_timestamp) from dual;
    
    EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
    ------------------------------------
                                  57.474
    
    SQL> /
    
    EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
    ------------------------------------
                                  59.787
    
    SQL> /
    
    EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
    ------------------------------------
                                    .412
    
    SQL> /
    
    EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
    ------------------------------------
                                     .99
    
    SQL> /
    
    EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
    ------------------------------------
                                   1.458
    
    SQL> /
    
    EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
    ------------------------------------
                                   1.896
    
    SQL> /
    
    EXTRACT(SECONDFROMCURRENT_TIMESTAMP)
    ------------------------------------
                                   2.334
    

    Edited by: Viswarayar Maran on November 20, 2008 14:30

  • HFM 11.1.2.2 request Validation

    We have created an application of HFM (EPMA) and try to validate the application

    but we see an error when we validate the application

    The error is as below

    Error: There must be exactly one dimension with a value of 'A' for the property to use for the currency and exactly a dimension with a value of 'From' for the property to be used for the currency.

    Where can I find these properties and where to set these properties?
    We have tried to create new property, but it does not let us associate any dimension with it when creating new property

    Thank you

    ARP

    Hi ARP.

    You will need these properties added for the conversion of currencies (even if you don't use it).

    What you want to do in the library of Dimension EPMA, is click on the custom dimension 1, as shown below.

    Then in the Properties window, change "Use to change" from.

    Do the same for the personal 2 dimension and set it on to.

    After that, you should be able to deploy (assuming that no other problem of validation).

    Thank you

    Erich

  • Problem with a value using LOV Colon

    PLUG

    Background

    Normally, I wouldn't create a dynamic LOV which has two points of value (ie the 2nd column of the SELECTION)

    However, I use a dynamic LOV to choose the names of different collections of APEX_COLLECTIONS and display the collection selected in a basic report.

    This is used to help me build "excel analyzers" which are pure SQL based.

    (The interactive report is used to develop the SQL)

    Problem

    When I have the listener configured to put every Excel sheet in its own tab, Collection names are in the format:

    {Explorer of goods name}: {name of the journal}

    example:

    P63_FILENAME:SHEET1

    P63_FILENAME:SHEET2

    The colon seems to cause confusion within the APEX; I LOV setting "Page Action when Value Change ' value 'redirect and set the value" to allow an "auto-refresh".

    Actually, I only return the string "P63_FILENAME".

    My question:

    How can I correct the SQL for the LOV and/or the REPORT so that the colon is correctly encoded / decoded and will work?

    SQL for LOV:  (Name of the P62_COLLECTION_NAME element)

    Select distinct collection_name C_NAME

    , collection_name C_VALUE - I tried APEX_ESCAPE. HTML_ATTRIBUTE(), but also failed

    of apex_collections

    SQL for the base report:

    Select seq_id, c001, c002, c003, c004, c005, c006, c007, c008, c009, c010

    of apex_collections

    where collection_name = upper (: P62_COLLECTION_NAME)

    Dear Mike,

    "Page Action during change of value" value "Submit Page" seems to fix your problem - to keep the same setting, one option is to replace the colon in your LOV thus is at the request of report to something else (for example the feature underscores):

    SQL for LOV:

    Select distinct collection_name C_NAME

    , replace (collection_name, ':', '_') C_VALUE

    of apex_collections

    SQL for the base report:

    Select * from apex_collections

    where replace (collection_name, ':', '_') = upper (: P62_COLLECTION_NAME)

    Kind regards

    Peter

  • Type of application for extraction in request Validator

    Hello

    Is there a way to retrieve the request type (assign roles, Self assign roles, roles Remove etc...) in the validator of the application. I want different validation according to the type of application?
    Help, please.


    Thank you
    SID

    You can use the RequestTemplateService API:

    RequestTemplate reqTemp = reqTempService.getTemplate (requestData.getRequestTemplateName ());
              
    Logger.Debug (className, methodName, "Type of request: reqTemp.getModelName ()"+ reqTemp.getModelName () ');

    Thank you
    Suren

Maybe you are looking for

  • Secure connection failed, error code: sec_error_bad_signature

    I installed windows 10 today. Not when I go to sites such as amazon on google, I get an error. 'An error occurred during a connection to www.google.co.uk. Peer's certificate has an invalid signature. (Error code: sec_error_bad_signature). The page yo

  • Firefox 6 doesn't seem to work correctly with some Pogo games?

    Yesterday (17/08/11) Firefox automatically updated to 6.0 and now there are some games Pogo that doesn't load not right - it is as if the graphics are all faded and impossible to play the games. I went back to Firefox 5.0, and now there is no problem

  • Satellite M65: New Bios Update for Vista?

    I have a satellite M65 and the problem is that the current bios is not 100% compatible with windows vista. Indeed, vista has not detected my card (nvidia gforce go 6600) video as well.Now, his work as a vga adapter.The question is based on 100% of th

  • Satellite Pro A60: Blue screen - ATI2DVAG display driver. DLL in endless loop

    HelloLaptop is a Toshiba Satellite Pro A60 with ATI Mobility Radeon 7000 IGP video card, running Windows XP Professional and SP 2.During the start in most cases systems hang up with blue screen. I installed the latest drivers from http://uk.computers

  • How to access password protected external HDD PX1267E - 1 32

    Hello I just gave me this USB external drive to my parents who have been given by someone else, however, it is password protected and it does not meet the password factory. Is there a way I can be protected, or should I just trow away? Thank you