date of update of the article page field

Hi all

I'm trying to update a date field in a table. It looks like something that should be very simple, but apparently it does not work for me.

It's trying to do: go look for a date on a DATE element (by using the date picker), add 30 days to that date and then update a date_field on my_table with the new date.

I tried a lot of different things, but I keep getting a NULL value or an error during the processing of the page.

Things I've tried:

declare

date date1: =: P2_MYDATE + 30;

Start

-Update my_table set date_field = date1 where ROW_ID =: P2_ROW_ID;

-Update my_table set date_field = to_date(date1,'dd-mm-yy') where ROW_ID =: P2_ROW_ID;

-Update my_table set date_field = to_date (to_char(date1,'dd-mm-yy'), 'dd-mm-yy') where ROW_ID =: P2_ROW_ID;

None of the above works so obviously I must be missing something

Any help is appreciated.

I guess the question is at the entrance that you pass. To debug you can change your code as shown below. In the code below, I assumed the P2_ROW_ID input is an INTEGER data type. If his thing then please change the declaration of the variable input_rowid as a result.

declare
  input_date    date;
  input_rowid   integer;
  invalid_input exception;
  error_message varchar2(4000);
begin
  input_date  := :P2_MYDATE;
  input_rowid := :P2_ROW_ID;
  if input_date is null or input_rowid is null then
     raise invalid_input;
  else
     update my_table
        set date_field = input_date + 30
      where row_id = input_rowid;
  end if
exception
  when invalid_input then
    error_message := 'User input is invalid' || chr(10);
    if input_date is null then
       error_message := error_message || 'P2_MYDATE is NULL' || chr(10);
    end if;
    if input_rowid is null then
       error_message := error_message || 'P2_ROW_ID is NULL' || chr(10);
    end if;
    raise_application_error(-20001, error_message);
end;
/

Tags: Database

Similar Questions

  • Apex: button to add dynamic date and user for the article page

    [warning... post newbie]

    I have a simple table of questions and actions.

    users change/update records using the form on a table with the report.

    There is a comments column to record the latest updates; users must add their name and the date at the top.

    I am currently using a button that calls a dynamic action to execute javascript to insert the date and the user at the top of the text in the field comments (UPDATES_NEW_ON_TOP)

    problems:

    1 Insert date works on firefox/chrome but not IE

    2. can't seem to find the right code to insert the currently logged in user name

    extract javascript below...

    Notes:

    -After reviewing the packaged applications I see more elegant ways to do this but we are going the long way to learn stuff

    -the JavaScript below is probably very poorly formed - apologies if it upsets anyones sensitivities of coding

    -open to any means to achieve the desired result

    beer on me for any assistance that you can give

    var d = new Date();

    var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",]

    "Jul", "Aug", "Sep", "Oct", "Nov", "December"];

    document.getElementById("P3_UPDATES_NEW_ON_TOP").innerHTML =.

    d.getDate () + ' - ' +.

    monthNames [d.getMonth ()] + ' - ' +.

    "" d.getFullYear () + ": [ID] +.

    String.fromCharCode(0)) (13) + string.fromCharCode(0)) (13) + P3_UPDATES_NEW_ON_TOP.value;

    ;

    Thank you all for your contributions and redirects

  • At what stage of the treatment we use a rule to update to apply logic to the way the data are updated in the database?

    Hello

    At what stage of treatment do you use a rule to update to apply logic to the way the data are updated in the database?

    Rahul

    Hello Rahul,

    Update the existing record or a data object

    Thank you

    edynamic expert Eloqua

  • I just bought a Canon 7 d, Mark II, new DellXPS and 5.2 of Lightroom.  The Lighthouse is not open the 7DMark II, but opens the older 7 d that I imported.  I checked the update of the home page and do not see one for the 7 5 d Mark II.  Please say what t

    I just bought a Canon 7 d, Mark II, new DellXPS and 5.2 of Lightroom.  The Lighthouse is not open the 7DMark II, but opens the older 7 d that I imported.  I checked the update of the home page and do not see one for the 7 5 d Mark II.  Please that's where - otherwise what.  I'm "waiting until what his doing."  Thank you.

    Upgrade to the current version, which is Lightroom 5.7.1. You can do it from the Lightroom Help menu and choose updates.

  • Multiple selection of records in table advanced to update in the Search Page.

    Hi all

    I write the code below, to select multiple records in table advanced for the update after clicking on the button update in the Search Page.
    I write this code in Processform request, but I got the exception when I run the code below.


    If (PageContext.GetParameter ("UpdateOnSeaBtn")! = null)
    {
    Am = (XxSupppacklistAMImpl) pageContext.getApplicationModule (webBean) XxSupppacklistAMImpl;
    am.saveRollback ();
    OAViewObjectImpl upDtVO = (OAViewObjectImpl) am.findViewObject ("PackingListSeaVO");
    PackingListSeaVORowImpl line;

    HashMap vParm = new HashMap();

    Row [] rows = upDtVO.getFilteredRows ("SingleSelection", "Y");
    int fetCount = upDtVO.getRowCount ();
    System.out.println ("Teh recovered rowcount is:," + fetCount);

    RowSetIterator multiIter;
    multiIter = upDtVO.createRowSetIterator ("multiIter");
    multiIter.setRangeStart (0);
    multiIter.setRangeSize (fetCount);


    for (int i = 0; i < fetCount; i ++)
    {
    Row = (PackingListSeaVORowImpl) multiIter.getRowAtRangeIndex (i);
    If (Row.GetAttribute ("SingleSelection")! = null)
    {
    If (Row.GetAttribute ("ItemNumber")! = null)
    {
    Object vitemNum = row.getAttribute ("ItemNumber");
    System.out.println ("The selected element Num is:," + vitemNum);
    vParm.put ("ItemNumber", vitemNum);

    pageContext.setForwardURL ("OA.jsp?page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG", / / here, I got the exception below)
    NULL,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    NULL,
    vParm,
    false, / / RetainAM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAWebBeanConstants.IGNORE_MESSAGES);
    }
    }
    }

    multiIter.closeRowSetIterator ();

    }
    }
    }

    could you, please, can someone help on this.


    I got below exception to the side server when it is run the code above.
    Error (125,48): method setForwardURL (java.lang.String, null, null, byte, java.util.HashMap, boolean, java.lang.String, byte) is not not in the interface oracle.apps.fnd.framework.webui.OAPageContext

    Kind regards

    Hello

    832859 wrote:

    for (int i = 0; i)<>
    {
    Row = (PackingListSeaVORowImpl) multiIter.getRowAtRangeIndex (i);
    If (Row.GetAttribute ("SingleSelection")! = null)
    {
    If (Row.GetAttribute ("ItemNumber")! = null)
    {
    Object vitemNum = row.getAttribute ("ItemNumber");
    System.out.println ("The selected element Num is:," + vitemNum);
    vParm.put ("ItemNumber", vitemNum);

    > pageContext.setForwardURL"OA.jsp.page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG",//here I got below exception

    NULL,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    NULL,
    vParm,
    false, / / RetainAM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAWebBeanConstants.IGNORE_MESSAGES);
    }
    }
    }

    -Here is you call pageContext.setForwardURL loop.
    >

    I got below exception to the side server when it is run the code above.
    Error (125,48): method setForwardURL (java.lang.String, null, null, byte, java.util.HashMap, boolean, java.lang.String, byte) is not not in the interface oracle.apps.fnd.framework.webui.OAPageContext

    -check 5th param should nt be vParm if it is null

    Finally... After the for loop ends call... y bcz assume this page grouped 10 rows can he navigate both on the next page...:

    pageContext.setForwardURL ("OA.jsp?page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG",
    NULL,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    NULL,
    NULL,
    false, / / RetainAM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAWebBeanConstants.IGNORE_MESSAGES);
    }

    Concerning
    Meher Irk

    Published by: Meher Irk on March 31, 2011 19:54

  • Field containing average function works only when the data are engaged on the same page. Does not work for fields on other pages.

    I'm having a problem with a field defined to calculate the average of eleven points fields (points 1 to 8 on page 1-9-11 on page 2). My original question was that it could exclude fields of points when they do not have information entered and adjust the average calculation (number of "divided by") accordingly.

    I had someone write JavaScript code for him, but I just found a small problem I don't know if it's something in the code or what the person who originally wrote the script cannot understand it either and suggested that I have post here.

    The middle area (located on the 2nd page of the pdf page two) seems to work exclusively with precision if at least one of the points of the fields on the 2nd page, 9, 10 (and 11) are engaged with the data. No values entered on the first page and only the first page, are for some reason any dividing by a more than expected. For example, if I fill the boxes 1, 2 and 3, it divides the total by four. If I filled just box 7, it halves. If I fill all 8 boxes on the 1st page, it divides by nine. It is corrected as soon as I get the points in one or more of the three boxes on the 2nd page points, suddenly the overall average is accurate. But if boxes 9, 10 and 11 contain no points, then the average is still inaccurate because the number of ' divide by "he uses is one more than what it should. I can't understand how to attach the form to this post, so I downloaded on Dropbox: Dropbox - used Evaluation.pdf.

    Under the direction of State: javascript came work to exclude the empty boxes when the points are entered in one of the three points of fields on the 2nd page (and more), but the average function is not accurate because it adds 1 to the number of ' divide by "in the calculation of the average If the points are only entered into the fields on the 1st page.

    Here's the code I entered in the 'Custom calculation Script' box in the 'Calculate' tab of the Properties menu of Test field:

    Initialize variables

    var num = 0;

    var sum = 0;

    Browse the input fields

    for (var i = 1; i < 12; i ++) {}

    var f = getField ("points." + i);

    If {(f.valueAsString)

    increment the counter to non-empty field

    NUM ++;

    Add the value of the running total field

    sum += + f.value;

    }

    }

    Calculate the average

    If {(num)

    Event.Value = sum / num;

    } else {}

    All fields are empty, then the empty value

    Event.Value = "";

    }

    I do not see that. Add the code of script debugging will display the results that each field is completed:

    Initialize variables
    var num = 0;
    var sum = 0;

    Browse the input fields
    for (var i = 1; i)< 12;="" i++)="">
    var f = getField ("points." + i);
    If {(f.valueAsString)
    increment the counter to non-empty field
    NUM ++;
    Add the value of the running total field
    sum += + f.value;
    }
    }
    Debug - display results as the form is filled;
    Console.Show
    Console.println (sum + "/" + num + "=" + sum/num);
    end of debugging;
    Calculate the average
    If {(num)
    Event.Value = sum / num;
    } else {}
    All fields are empty, then the empty value
    Event.Value = "";
    }

  • Update of the newly added field faulty/bad driving!

    Hi, I use APEX 4.1.1 on: 10 x e.

    It is an incredibly simple thing I do and yet I can not understand what the question... I am pulling my hair with the simplicity of what I'm trying to do and the ridiculousness of why it doesn't work! :(

    I have a form created by the wizard form/report. I have added a field in the source table and therefore added a page element to the form (with the "Source Type" column DB 'Source value or the expression' value field name, etc.) ... it will display the item in the table but will not update the field when I click on apply changes. There, somehow (I think that via in clicking previous/next buttons on the update form) has managed to update the value to one value of another record... now both records are the same (table test and there only 2 rows) or update the form no matter what I do.

    To test this question, I deleted a page element and recreated. It includes the same way - it will display the data in the table, but not update it. I am very confused: this is such a simple thing!

    Hello

    There is a bug in the APEX that attaches to the 4.2. The bug occurs if a page item is renamed and that you run your application in another browser or a tab (not started from the APEX manufacturer). In this case, the name change is not picked up for this session. To resolve this problem, you just have to log out of your application to create a new session.

    Concerning
    Patrick

  • So I can update my Oracle Java Applet plugin Development Kit 7, update 65, can you link me to the correct page of download of Oracle from your update of the Plugin page?

    When I accessed to periodically your Plugin Check and updates the web page in the past, I really appreciated that you connect to the right webpage updates of the Plugin of the seller when I clicked on the button update now red. "" This time, however, your Applet Java plug-in 'Update Now' button link I Oracle Java "Release Notes for updates to 7u65 ' rather than the usual download page. It seems rather unexpected for me, or any other user conscientious, to search for the appropriate file "JDK 7U65" download on the Oracle website.

    Thank you

    I usually use this page: http://www.java.com/en/download/testjava.jsp

    I hope that someone will fix the plugin check site.

  • R12.2.4 data lost after using the dialog Page and return to the calling page. (Help please!)

    Hi team,

    I'm new to OAF and works on a requirement to add some custom validation when the user clicks a button in a seeded standard page.

    The approach I took was to extend the seeded controller object managed this press event button and put my custom logic in the extended controller and substitute the standard controller through customization.

    The standard rate which was pressing the Complete button A Page, the user was taken to the next and epepinee page (Page B) some operations based on records that have been chosen Page A.

    Part of the custom validation requirement that was if some postings were not met, the user must be a pop-up asking if they really wanted to move forward and if they have selected Yes then continue with the seeded standard flow (transition to page B) and if they have NOT selected then just remain on the current page.

    I have used OADialogPage and to do this, in part, the question , I am running into is that when the user selects one or more records using a check box in a region of several record (table) and click the full page and if the validation fails then a modal page and the user made a selection i.e.either Yes or no modal page and when they return to the calling page (ex. Page A), all data (records) they chose previously is lost (the Page is refreshed). Based on what I see on this forum, I suspect it's because after having click Yes on the modal page and then return to the original page the processRequest fires again and the VO data is queried again and has all the parts on the page are lost. Since I am changing the flow in seedlings pages based on the intervention of the user I'm confused as to how this problem can be solved. that is, prevent the page refreshes or preserve the selections that were made before you navigate to modal page. Any help is really appreciated!

    My Code:

    ' Public Sub processFormRequest (OAPageContext oapagecontext, OAWebBean oawebbean)

    ...

    ...

    If (oapagecontext.getParameter ("completeOps")! = null) {}

    ...

    ...

    If (warnCount > 0) {}

    OAException message = new OAException ("not in order...", OAException.WARNING);

    oapagecontext.putDialogMessage (message);

    OAException message = new OAException ("XYZ Violated rule. Do you want to continue? ", OAException.WARNING);

    DialogPage OADialogPage = new OADialogPage (OAException.WARNING, message, null, "","");

    String Yes = oapagecontext.getMessage ("AK", "FWK_TBX_T_YES", null);

    String number = oapagecontext.getMessage ("AK", "FWK_TBX_T_NO", null);

    dialogPage.setOkButtonItemName ("ConYesButton");

    dialogPage.setNoButtonItemName ("ConNoButton");

    dialogPage.setOkButtonToPost (true);

    dialogPage.setNoButtonToPost (true);

    dialogPage.setPostToCallingPage (true);

    dialogPage.setOkButtonLabel (yes);

    dialogPage.setNoButtonLabel (no);

    oapagecontext.redirectToDialogPage (dialogPage);

    }

    If (oapagecontext.getParameter ("ConYesButton")! = null) {}

    Write Yes button Action code

    oapagecontext.putParameter ("completeOps", "Continue");

    }

    If (oapagecontext.getParameter ("ConNoButton")! = null) {}

    Write the code of the Action for the No button

    Dim errormsg = ' rule Violations have occurred. "

    throw new OAException (errormsg);

    }

    super.processFormRequest (oapagecontext, oawebbean);

    }

    I managed to work around this problem by adding a simple control in my controller processRequest method extended to avoid the call to super.processRequest incase lhen control returns to the page once the user has made a selection on the Page of the dialog box

    If ((oapagecontext. (GetParameter ("ConYesButton") == null) & (oapagecontext.getParameter ("ConNoButton") == null)) {}

    super.processRequest (oapagecontext, oawebbean);


    }


    Thank you!

  • How to make updates to the articles?

    In the old DPS that I can download all my articles on the folio generator and when I made a change in the article I could update them in the generator of folio with the click of a button. How do you do that in 2015 DPS? Are - do you have to re - save a new section file and then upload it again to the online portal?

    Yes, you must export the article file and download it again.

  • InDesign crashing on the update of the article in folio

    I'm trying to update an article in an existing folio and InDesign continually crashes to the stage of 'Writing PNG'.  I tried updating to the latest version, reboot, logout of folio Builder, rename the file or reissue of links there.  Nothing seems to work.

    Is it because of the update that was made yesterday? and is there a work around or a fix?

    I understood the question.  One of my buttons that is set to open a specific State makes the crash of the upload.

    I don't know why, but as soon as I delete it the article perfect update.

  • signature at the bottom of the final page field, how?

    I have a form that begins as a page, but can reach easily several pages.

    At the bottom of the final page their should be a digital signature field, how can I do this?

    I already tried different approaches, placing the signature field inside the master page doesn't seem to work because the signature field never even appears in this way. I also tried with several subforms, and then I tried the table approach that may include a footer on the last page only. But with the two approaches, I still have the same problem, the signature field can be placed inside, he runs after the final subform (or line) on the last page.

    Any help in this matter will be greatly appreciated!

    Thank you

    I did something similar to this for someone in the past, but it is on a sensitive form, so I can't share it. If you want to send me your form, I will on your form so you can see how it's done. If you do not have a link of attachment to send it to [email protected]

    Paul

  • Data to continue in the same page instead of the next

    Hi all

    I want data should be continued on the same page on the right side instead of expand page as below.
    Is this possible at all? I use a report of RDF (10g) and R12.

    ID COL2 COL3 ID COL2 COL3
    1 5 xxx xxx xxx xxx
    2 6 xxx xxx xxx xxx
    3 7 xxx xxx xxx xxx
    4 8 xxx xxx xxx xxx

    Thank you
    Stephanie

    I think you can use the column feature in word. Format the page in two columns.

    Go to the format--> columns--> presets (2 columns)...

    HTH...

  • Long text flowing incorrectly on the next page field

    Hi guys,.

    I checked the "allow Page Breaks in content" in a subform. I include a field of text in the subform and checked "Allow multiple lines" so if long text cannot fit in the text field in a page, it will continue to the next page. The problem is now in the second page content is not continue from the first page, but it is to copy the content of the first page.

    For example: 8 lines must be inserted in the text field. Only 5 lines can fit into the text box on first page. Then the line 6-8 should continue on the second page. Yes, the text field has 3 lines on the second page, but not line 6-8, it copies the line 1-3 on the first page.

    Anyone has any experience on this or can anyone help me?

    Christiaan

    South Africa

    This is your page 2 & 3.  See how 2 3 flowing

  • Option of Windows Update in the configuration page is stuck and 20-3-minutes to recover.

    Mr President.

    When I go to my windows update option in the Panel this page got stuck and take 20-3-minutes to recover from it. Kindly give me a solution so that I can easily update my pc

    OT: on automatic update of windows 8

    Hi Raymond,

    1. don't you make changes to the computer before the show?
    2. which antivirus program is installed on your computer?

    This problem may occur for various reasons as the programs of third at the origin of the problem.

    Method 1: I suggest you try the steps from the following link:

    Windows Update crashes when installing updates in Windows 8, Windows 7, or Windows Vista
    http://support.Microsoft.com/kb/2700567/en-us

    Method 2: I suggest you perform the clean boot. Clean boot helps eliminate conflicts of software that occur when you install a program or an update or when you run a program in Windows. You can also troubleshoot or determine what conflict is causing the problem by performing a clean boot.

    How to perform a clean boot in Windows
    http://support.Microsoft.com/kb/929135

    Note: Follow How to reset the computer to start as usual after a clean boot troubleshooting article KB929135 to reset the computer in normal mode.

    I hope this helps. Let us know if you have other problems with Windows in the future.

Maybe you are looking for

  • Re: Satellite A200 - need instructions & pictures to clean the cooling modules

    Hi guys I can't find them online I need pictures and instructions for my own model the A200 to pull out and clean the radiator? Not on google nothing simular enough for it to be useful to me... Also what is the advantage of upgrading to aloy heatsink

  • Phone music player causing restart

    I had my Atrix for about a month. The phone is fast and responsive which is really very good after having a dog slow phone before this one. But I have a love/hate to date relationship. A big problem is that my music player will not continue to play,

  • WAG54G v2 faulty LAN

    It seems there is a very common problem with these models works very well for a period and then for no apparent reason the wired ethernet ports stop working. I had 4 devices connected for 2 years without problem until last week when none of the devic

  • "COM surragate has stopped working".

    How is whenever I try to play a video on windows media player, it says COM surragate has stopped working? can you please help me fix it?

  • R32 - RecordNow update problem

    I'm a new here so Hello to all world I have preinstalled system in my laptop R32. Then I updated the XP system from a Microsoft web site and after that I updated the device from a Lenovo site by an update Vantage system think.  Some updates have been