Insert a current date

hI.,
I am using jdev11.1.5
My scenario:
When user clicks the button the values should be inserted
i had used this coding in my AMImpl Method
        ViewObjectImpl gjh  = this.getGlJrnlHd1();
        Row gjhr1 = gjh.getCurrentRow();
        Row gjhr = gjh.createRow();
        ViewObjectImpl rcdh = this.getRecCustDocHd1();
        Row rcdhr = rcdh.first();
        System.out.println ("Current Value:"+rcdh.first());
        gjhr.setAttribute("GjhAppl", "ARM");
        gjhr.setAttribute("GjhBu",rcdhr.getAttribute("RcdocBu") );
        gjhr.setAttribute("GjhCreBy", "ADMIN");
        gjhr.setAttribute("GjhCreDate", "07/07/2010");
        gjhr.setAttribute("GjhDesc","Manuall");
        gjhr.setAttribute("GjhJrnlDate", rcdhr.getAttribute("RcdocDocDate"));
        gjhr.setAttribute ("GjhJrnlNo","20111665");
        gjhr.setAttribute("GjhJrnlSfx", "0");
        gjhr.setAttribute("GjhJrnlType","GJ");
        gjhr.setAttribute("GjhPeriod", rcdhr.getAttribute("RcdocDocPeriod"));
        gjhr.setAttribute("GjhPlant", "MATPLNT");
        gjhr.setAttribute("GjhReversal", "N");
        gjhr.setAttribute("GjhRevJrnlNo", "20111241");
        gjhr.setAttribute("GjhRevJrnlSfx","N");
        gjhr.setAttribute("GjhStatus","N");
        gjhr.setAttribute("GjhUpdBy", "ADMIN");
        gjhr.setAttribute("GjhUpdDate", "07/07/2010"); //I need to insert the current date
        gjhr.setAttribute("GjhYear", rcdhr.getAttribute("RcdocDocYear"));
        this.getDBTransaction().commit();Can anyone help me to insert the current date

try this
gjhr.setAttribute("GjhUpdDate",new oracle.jbo.domain.Date(oracle.jbo.domain.Date.getCurrentDate())); //I need to insert the current date

Similar Messages

  • How do I insert the current date to hidden field?

    I have a form for updating personal information.  There is a field in the table called "dateupdated" that I would like to have on the form as a hiddent field that will automatically get the latest date (now).
    Any idea's how I can set the hiddden field to current date?
    Thanks,  Dennis

    You don't need a hidden field to do that. Depending on the database you're using, you can either use a TIMESTAMP column (in MySQL) that is automatically updated, or you can use a SQL function to insert the current date.
    For example, in PHP, you can use NOW() like this in a SQL query:
    $insertSQL = sprintf("INSERT INTO date_test (created, message) VALUES (NOW(), %s)",
                           GetSQLValueString($_POST['message'], "text"));

  • LibreOffice Calc - insertion of current date returns strange result

    Hey,
    When i want to insert the current date with the command TODAY() i get a result like this:
    25.[~bu250i0t] Oktober 2011
    The [~bu250i0t] is obviously what annoys me! How do i get it away?
    Cheers

    Why the language? My mother tongue happens to be German, nothing wrong about that!
    I just want to get rid of the digits and letters within the date...
    Last edited by gunjah292 (2011-10-25 16:54:38)

  • Inserting Current Date with time stamp in oracle database

    Hi Experts,
                     I want to insert the current Date and time stamp in a field in the Oracle Database Table.
    I am able to insert date but i am not able to insert the date with time stamp. Any Suggestions??
    Thanks
    Naveen

    Naveen,
    Do you want to get current date (from sysdate) with a specific format or transform a value containing a date/time value to insert it in ORACLE ?
    Usually, you insert current datetimestamp in a date field using this :
    TO_DATE(sysdate,'dd/mm/yyyy hh:mi:ss')
    you may have to tweak the format pattern ('dd/mm....') according to your needs
    if you want to transform a date, use something like this:
    TO_DATE(your_date,your_format)
    but make sure your format is compliant with your date, ie
    TO_DATE('31/12/2008','MM/DD/YYYY') could raise error (litteral does not match) cuz ORACLE can't recognize 31 as a month pattern
    Chris

  • Insert Current Date into text Field

    Hi I was wondering if anyone knows how to insert the current
    date into a text field using ASP.NET C# page. When the page loads.
    Or better still insert current date into my database when the
    page is updated. using the insert Server behavier.
    I would be very greatfull for any help.

    To assign it to a text box you couls use the following in the
    onload
    function
    textbox.Text = DateTime.Now.toString;
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "cantmakeitwork" <[email protected]> wrote
    in message
    news:e9qhrv$crd$[email protected]..
    > Hi I was wondering if anyone knows how to insert the
    current date into a
    > text
    > field using ASP.NET C# page. When the page loads.
    >
    > Or better still insert current date into my database
    when the page is
    > updated.
    > using the insert Server behavier.
    >
    > I would be very greatfull for any help.
    >

  • Insert current date?

    Numbers Question
    Hi,
    is it possible, within a cell and without manually typing it in each time, to insert the current date? i.e. so that it updates automatically.
    Thank you, Daniel.

    Hi Daniel,
    Thanks for the greenie.
    For your next trick, try =NOW.
    Regards,
    Ian.

  • Insert current date, please?

    I want a way to insert the current date in an Illustrator document. *
    Why?
    I use an Illustrator template for my letter stationery. I prefer using Illustrator rather than Microsoft Word.
    I submit artwork to printing houses. I like to date stamp work I send off.
    If this feature already exists, I'd dearly like to know where the heck it is.
    If Adobe actually reads this, please show some sign of life.
    I have no idea whether Adobe actually gives a damn what customers tell them.
    I mentioned this a year ago and never got a single response, so am attemping again.
    I can't be the only user who would find this feature handy.
    Thank you,
    Mike Storer
    Los Angeles
    * I currently use CS 5.5

    Part of the $30 CS3-5.5 bundle (Mac only)
    • Tag72a - Automatically tag and update documents with User Name, Document Name, File Path, Print Time/Date and Save Time/Date.
    http://www.worker72a.com/pages/CS345.html

  • Can i get current date in XSL FO customized file with Apex 3.0??

    Hi Oracle staff,
    i have a problem with the insert of current date in customized layout's XSL FO file..
    I have just tried to insert current-time() function and js scripts....but nothing.....PDF,Word or HTML output file that's printed by Bi Publisher displays an error that says:"Content file not supported or damaged".
    Why???is Bi Publisher a XSLT processor that supports currrent date functions????.
    and if not.....how can i install a new processor in substitution of Bi Publisher/Apache FOP???
    Regards
    Emanuel

    Yes, you can click the title bar of any document (the down arrow) to access the current file name:

  • Displaying Current Date and Time in JSP

    Hi,
    I need to insert the current date time in Ms SQL Server Database using jsp page. The format of the code willbe
    insert into table(update_date) values ('2007-01-01 10:02:21');
    But i am not getting how to display the current date and time ie. 2007-01-01 10:02:21 using jsp.
    I have tried using
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    GregorianCalendar cal = new GregorianCalendar();
    String dd = sdf.format(cal.getTime());
    insert into table(update_date) values (dd);
    But it didnot get inserted data.
    Can anybody figure out with simple ideas.
    Thank You

    Why then are you trying to insert the current date on a table?
    To show the current date on the JSP you might try
    <%=new Date()%>Or the way you had it on your first post with the date formatter and then use the <%=%> tags. Anyway, it seems to me I'm not really understanding what you actually want to do :-p
    P.S. NOW() is a MySQL function too, not only MSSQL server (didn't even know it had it too ;-))
    mysql> insert into a(up) values (now());
    Query OK, 1 row affected (0.00 sec)
    mysql> select * from a;
    +------------+
    | up         |
    +------------+
    | 2007-04-09 |
    +------------+Message was edited by:
    benubach
    Message was edited by:
    benubach

  • How to insert the current datetime?

    Hello everyone,
    I'm beginner in this world, sorry for my simple question.
    I wanna insert the current date and time on the database after my application has started the stored procedure.
    I have to insert the following format for datetime column: 03/19/2015 00:00:00 (i.e. MM/DD/YYYY XX:XX:XX AM/PM)
    Is it correct to use this line?
    TO_DATE(SYSDATE, 'MM/DD/YYYY HH24:MI:SS')
    My SYSDATE example:
    SELECT SYSDATE from DUAL;
    3/19/2015 5:43:37 PM
    CREATE OR REPLACE PROCEDURE "BD"."PROC" (
    p_varCONTACT_INFO NVARCHAR2,
    p_varDAILY_FROM NUMBER,
    p_varDAILY_TILL NUMBER,
    p_varGRUPO_DESTINO VARCHAR2,
    p_varPROTOCOLO VARCHAR2,
    p_varMCDU VARCHAR2,
    p_varCLUSTER_N VARCHAR2,
    p_varGRUPO_ORIGEM VARCHAR2,
    p_varRP_DESTINO VARCHAR2,
    p_varMOTIVO_QUEDA VARCHAR2,
    p_varSWITCH_DESTINO VARCHAR2,
    p_varACCOUNT_NUMBER_IVR VARCHAR2,
    AS
    BEGIN
    INSERT INTO BD.TA_CALLBACK
    RECORD_ID,
    CONTACT_INFO,
    CONTACT_INFO_TYPE,
    RECORD_TYPE,
    RECORD_STATUS,
    CALL_RESULT,
    ATTEMPT,
    DAILY_FROM,
    DAILY_TILL,
    TZ_DBID,
    CHAIN_ID,
    CHAIN_N,
    GROUP_ID,
    SWITCH_ID,
    PROTOCOLO,
    MCDU,
    GRUPO_DESTINO,
    RP_DESTINO,
    GRUPO_ORIGEM,
    MOTIVO_QUEDA,
    SWITCH_DESTINO,
    DATA,
    CAMPO1,
    CLUSTER_N
    SELECT
    NVL(MAX(record_id),0) + 1,
    p_varCONTACT_INFO,
    1,
    2,
    1,
    28,
    0,
    p_varDAILY_FROM,
    p_varDAILY_TILL,
    131,
    NVL(MAX(chain_id),0) + 1,
    0,
    8847,
    283,
    p_varPROTOCOLO,
    p_varMCDU,
    p_varGRUPO_DESTINO,
    p_varRP_DESTINO,
    p_varGRUPO_ORIGEM,
    p_varMOTIVO_QUEDA,
    p_varSWITCH_DESTINO,
    TO_DATE(SYSDATE, 'MM/DD/YYYY HH24:MI:SS'),
    p_varACCOUNT_NUMBER_IVR,
    p_varCLUSTER_N
    FROM BD. TA_CALLBACK;
    END PROC;
    Environment: Oracle 10g
    Best regards,
    Henrique Silva

    Hi,
    Well the session is the one that displays the date dataype as you want:
    SQL> select sysdate dt from dual;
    DT
    23-MAR-15
    SQL> alter session set nls_date_format='dd/mm/yyyy hh:mi:ss pm';
    Session altered.
    SQL> select sysdate dt from dual;
    DT
    23/03/2015 11:37:32 pm
    SQL> select sysdate + interval '6' hour as dt from dual;
    DT
    24/03/2015 05:37:59 am
    Regards.

  • Script for current date

    I have a document javascript that used to work. It prints the current date upon first opening the PDF into a field called Today. Thereafter, the date does not change no matter how many more times the PDF is opened.
    var f = this.getField("Today");
    if (f.value == "") f.value = util.printd("mm/dd/yyyy", new Date());
    I'm using Acrobat 9 Pro, and for some reason this script no longer works in version 9. If anyone can assist to correct this sript, I would greatly appreciate it.

    It works fine for me in Acrobat 9.2.0 (under Windows 7). If the field is empty when the form opens, it inserts the current date. If the field is not empty, it does not do anything.
    Are you absolutely sure that the field 'Today' is empty when you open the PDF?

  • Please help! Looking for script to insert current date on page.

    I currently use a Dreamweaver Extension that lets you insert
    current date and time on your web page.
    The problem is, I don't know Javascript and cannot edit the
    Javascript codes to "remove the time"
    I only need the current date that will change every day.
    Do you know where I can get this script, I goggled and got
    several but I'm looking for something authentic.
    Also is it possible to have your page validate when you use
    Javascript embedded in your HTML?
    Thanks everyone,
    Patrick

    quote:
    Originally posted by:
    Newsgroup User
    Webethics wrote:
    > The problem is, I don't know Javascript and cannot edit
    the Javascript codes
    > to "remove the time"
    > I only need the current date that will change every day.
    JavaScript generates the date by using the clock on the
    computer of each
    visitor to your site. If a visitor's clock has the wrong
    date, your site
    will also display the wrong date.
    > Do you know where I can get this script, I goggled and
    got several but I'm
    > looking for something authentic.
    I don't know what you mean by "authentic". Date generation in
    JavaScript
    is one of the most basic features of the language, so if it
    works, it's
    "authentic".
    > Also is it possible to have your page validate when you
    use Javascript
    > embedded in your HTML?
    Yes, but you shouldn't embed JavaScript in XHTML.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/
    So mr. Powers are there people that use Javascript Date in
    their page?
    Would you recommend it?
    I could use PHP but I don't know PHP,
    How do I come up with the string in this format, say,
    Wednesday, October 29th, 2008 that will change to a new day
    according to the server time and date.
    Thanks so much for your help and I have two of your books! I
    will be taking PHP classes in December.
    Patrick

  • Insert current date and time into Oracle date type field

    I have a JDBC current date and time insert into Oracle 9i that almost works. It submits the current date and a fixed time into the Oracle date type field. I am using Tomcat 6.0.20.
    For example if I insert the data at 7:24:04 PM on Feb 16, 2010 it will insert as: 16-Feb-2010 12:00:00 AM
    The date part works but the time always shows 12:00:00 AM no matter what date or time the data is inserted.
    Here is what I have for my JDBC inserts and I also tried something with DateFormat:
    PreparedStatement ps; Date mydate = new Date(new java.util.Date().getTime()); //insert statement here.... stmt.setDate(1,mydate);
    I also tried:
    PreparedStatement ps; java.sql.Timestamp mydate = new java.sql.Timestamp(new java.util.Date().getTime()); SimpleDateFormat fmt = new SimpleDateFormat(.... //insert statement here.... ps.setTimestamp(1,fmt.format(mydate));
    Both keep submitting the date into Oracle as 16-Feb-2010 12:00:00 AM
    Anyway to get the current date and time? For example if I insert the data at 7:24.04 pm today it should show as 16-Feb-2010 07:24.04 PM in Oracle.

    sportsMarkr wrote:
    Date mydate = new Date(new java.util.Date().getTime());Please see the javadocs for java.sql.Date and note the part that says "...to zero"
    [http://java.sun.com/javase/6/docs/api/java/sql/Date.html]
    If you want a date and time then use java.sql.Timestamp.

  • Javascript Question - How to Insert a Dynamic/Current Date into the Footer of a Scanned Document

    Hi!
    I am looking for help in finding a Javascript that would allow the insertion of a dynamic/current date into the footer of a scanned document at the time the document is printed.
    I am currently using Adobe Acrobat Professional 8.0 at my work and there has arisen a need to have a dynamic/current date in the footer on scanned documents when they are printed out on different days by different people.
    I am new to the Forum and I am also very new to Javascript and what this entails.
    Thank you in advance for your help and input!
    Tracy

    this.addWatermarkFromText({
    cText: util.printd("mmmm dd, yyyy", new Date()),
    nTextAlign: app.constants.align.right,
    nHorizAlign: app.constants.align.right,
    nVertAlign: app.constants.align.bottom,
    nHorizValue: -72, nVertValue: 72
    Will insert the current Monday/Day/Year as a text watermark at the bottom of every page of a document, 1 inch up and 1 inch in from the right corner.

  • Insert current date/time and username into form.

    Apologies for newbie question.
    I have a form based on table Customer, within the table I have username and modifiedDate columns. How can I populate these text fields with the current user and current date/time ?
    Thanks.

    Excellent, thanks for the fast response. I had this working and then tried in on a new form and now it fails to populate the desired fields.
    I have created a process named "Insert date and username", Type P/SQL anonymous block. On Load - After Header, Once Per Page Visit.
    select :APP_USER, to_char(SYSDATE,'DD-MON-YYYY HH24:MI:SS')
    INTO :P16_USERNAME, :P16_MODIFIEDDATE
    from dual;
    Sorry for the hand holding!
    Jason
    Edited by: Jason S (UK) on Apr 24, 2013 6:57 AM

Maybe you are looking for

  • What is the difference between (SEPA Structured) and (SEPA Unstructured)?

    Hi, Could you please teach me about "Format Payments (SEPA Structured)" and "Format Payments (SEPA Unstructured)"? 1.What is Format Payments (SEPA Structured)? Is (SEPA Structured) used with which case? 2.What is Format Payments (SEPA Unstructured)?

  • OBWW - Define Accounts for With Holding Tax to be paid over

    Hi All I am unable to activate Rules and assign accounts in TCode OBWW (Define accounts for with holding tax to be paid over) as the screen is greyed out. Please guide me Rgds KIM Khan

  • Cannot change calendar name

    Just upgraded to Lion.  In iCal I try to change name of calendar.  I type in new name but it reverts to old name.  I try to create new calendar with the name I tried to change the old one to, but after I type in the name and press return the new cale

  • COA Numbers invalid - read this for more news

    hello all, I've got news for everyone having problems with the vista upgrade,today (tuesday 6th feb 07) I finally got through to moduslink and the reason for coa numbers is because preinstalled software coa numbers will not be verified by microsoft.

  • Accidently Renamed Trash, now I can't empty it.

    i accidently renamed the .trash folder to trash. now i can't empty it. when i tried to rename it, it said that the folder name was already reserved. how do i get it back to normal?