I want to update date field in oracle table using database adaptor

Hi Guys,
I want to update date in oracle table field which is 'DATE' type , but i am getting following error.
Pure SQL Exception.
Pure SQL Execute of update crp3apps.IFACE_SO_DATE_CHANGES set PROCESSED_DATE=? where CTRL_ID=? failed. Caused by java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string
The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead.
</summary>
</part>
- <part name="detail">
<detail>
ORA-01830: date format picture ends before converting entire input string
</detail>
i am formated the date using following code and assigned to one variable.
ora:formatDate(ora:getCurrentDateTime(),'dd-MMM-yyyy hh:mm:ss ')
this is update query
update crp3apps.IFACE_SO_DATE_CHANGES set PROCESSED_DATE=#date where CTRL_ID=#id
Please provide solution.
regards
janardhan

The thing is that XSLT often doesn't deliver the functionality required when it comes to times.
You suggest appening "Z" to the time but this means that the time is now in UTC time. What if the system from where the date is being converted is running in NZ using local time? Other systems that recieve the date (and correctly handle the time zone) will now have a time that is out by a number of hours.
You often can't ignore the time zone (drop the 'Z') as if you send the time to a system it has to either assume the time is local to it (which may not be the case... the other system coudl be in a different time zone) or assume the time is UTC (I think crossfire does this by default).
Typically can't just append a time zone (e.g. +11:00) either as many places have daylight savings so the value to appended is variable (you then need some way of determining what the value is... either Java Embedding or a Service).
As you mention it does depend on the use case but in many circumstances using Jaba Embedding, not as suggested above but with the appropriate Java.util.Calendar classes, is the best way to handle date and time in BPEL. Even still you need to ascertain the format of times external to the system and ensure you parse them correctly.
ANd even if you do all this you can still run into problems. I've seen a real world example where two systems which both handled time zones correctly and had previously been working together for quite a while, satrted reporting different times. It turns out that only one of them had had the most recent Java Time Zone patches applied and there had been a change in the dates for daylight savings here (Australia). Be warned!

Similar Messages

  • How to update date field in oracle using jdbc

    Hi all,
    In my database i have a column LAST_UPDATED_DTTM which is used to store last updated date . when i try to update using the following query stmt
    update MD_TABLE set LAST_UPDATED_DTTM= + " new java.sql.Date(c.getTime().getTime()) where PROD_ID=" + msdn ;
    ' c ' is instance of Calendar Class as below
    Calendar c=Calendar.getInstance()
    it gives the following error
    ORA009:Expected date got number
    can anybody please help with this?
    Thank you

    can't i do that without prepare statement?If you insist on stuffing that String, then format it in some convenient String format using SimpleDateFormat and call the TO_DATE function in Oracle, so that the database understands your Date too.
    ***Annie***

  • Updating date field in db table.

    Hi ,
      I need to update a table which has a date field the and its of type dats.
    i need to insert  the date from the flat file. If the date field is blank it is updating in the table like
    "  /  /     ". if the date is 3/5/2006 it is updating properly.
    if the date is blank the table should be inserted with null values . it should not have " /  /    " also.
    can anyone help me on this.
    Regards,
    Rose.

    Use WRITE statement to transfer date into dats field.
    DATA : v_date TYPE d ,
           v_date1 TYPE d.
    WRITE v_date TO v_date1.
    Regards,
    Shailaja

  • Problem updating date field on user table

    Hi,
    I am having difficulty updating the value for a date field on a user defined table.  All of the other fields update fine.  Below is the code I am using.  Does anyone have any suggestions?  I have tried updating to both a date variable or a string variable.  Thanks in advance for your help
    Dim d As Date
        d = CDate("01/01/2004")
        pRecord.GetByKey (editForm.Items("Code").Specific.String)
        pRecord.UserFields("U_CardCode").Value = editForm.Items("CardCode").Specific.String
        pRecord.UserFields("U_CardNbr").Value = editForm.Items("CardNbr").Specific.String
        pRecord.UserFields("U_CardType").Value = editForm.Items("CardType").Specific.String
        pRecord.UserFields("U_ExpDate").Value = d
        pRecord.UserFields("U_Name").Value = editForm.Items("Name").Specific.String
        pRecord.UserFields("U_CVN").Value = editForm.Items("CVN").Specific.String
        pRecord.UserFields("U_Addr1").Value = editForm.Items("Addr1").Specific.String
        pRecord.UserFields("U_Addr2").Value = editForm.Items("Addr2").Specific.String
        pRecord.UserFields("U_City").Value = editForm.Items("City").Specific.String
        pRecord.UserFields("U_State").Value = editForm.Items("State").Specific.String
        pRecord.UserFields("U_Zip").Value = editForm.Items("Zip").Specific.String
        If editForm.Mode = fm_UPDATE_MODE Then
            pRecord.Update
        End If

    I think I have figured it out.  The cardtype field (which I was also updating) has a list of valid values.  If I didn't specify a value for this field none of the other fields would update either.  I'm still not sure of the reason for this behavior.

  • Need to update custom fields in MSEG table using "BAPI_GOODSMVT_CREATE"

    Hi All,
    There is a requirement to update custom fields in table MSEG which are part of append structure. There is a option to update the custom fields using the one of the tables parameters "EXTENSIONIN". Anyone please advice how can I update the custom field thru EXTENSIONIN.
    Thanks in advance.
    cheers,
    Vijay

    see the help
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/4099948b8911d396b70004ac96334b/frameset.htm
    Regards
    Kiran Sure

  • How to insert/update Date field in Oracle with java code

    Dear All
    I have to insert/update a date column while creating a new item, but the problem is i am able to insert/update only date but i need both date and time along with AM/PM.
    By using these 3 lines i am able to insert/update only date.
    java.util.Date date = new java.util.Date();
    long dateLong = date.getTime();
    stmtPrep.setDate(33, new java.sql.Date(dateLong));
    Below code retrives the date exactly what i need but unable to pass in the statement:
    DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss a");
    java.util.Date d = (Date) new java.util.Date();
    String stringdate = formatter.format(d);
    String tmpdate = dateFormat();
    stmtPrep.setString(33, tmpdate); -- I tried with setObject as well but same error coming.
    Error is:
    ORA-01830: date format picture ends before converting entire input string
    Can u guide me how to get full date time with AM/PM?

    sasikrishna wrote:
    Dear All
    I have to insert/update a date column while creating a new item, but the problem is i am able to insert/update only date but i need both date and time along with AM/PM.
    By using these 3 lines i am able to insert/update only date.
    java.util.Date date = new java.util.Date();
    long dateLong = date.getTime();
    stmtPrep.setDate(33, new java.sql.Date(dateLong));That's by design. A java.sql.Date object matches an SQL DATE column (which doesn't include a time component). If you want something which matches an SQL TIMESTAMP colum (which includes both date and time components) then you should use a java.sql.Timestamp object.

  • Issue in Updating Date Fields in JDBC

    Hi Experts ..
      I am having issues in updating date fields in Oracle Database.
    My Sender Sends date in format 2007-05-19T14:34:55.0000000+02:00
    Can any one please suggest me how does the above format can be updated in JDBC with format 2007/05/19
    Thanks !

    Hi,
    See this Scree shot
    http://img517.imageshack.us/my.php?image=16324662pf7.jpg
    Take the Substring Function From Text Functionsand mention the position from 0 to 10 to take the Date alone from the Whole String which is getting in Source Field.
    And after that apply the Transform date Function fron Date Functions and mention the source date format and the target date foramt that needs to convert into.
    REgards
    Seshagiri

  • Update a field in bseg table

    Hi experts,
    i want to update a field in BSEG  table (field name is BUPLA).
    Using UPDATE statement i am going to update the bseg table.
    I know only update statement.
    This my immediate requirement.
    please give me suggesstion.

    Hi,
    If you want to update the existing table record or field.. it is always advisable to use MODIFY statement instead of  UPDATE.
    syntax: 
    fetch the BSEG data to internal table IT_BSEG and do you modificaltions.
    Loop at it_bseg.
        it_bseg- XYZ = 'ABC'.
        it_bseg-UVW = '123'.
       modify it_bseg transporting XYZ  UVW .
    endloop.
    MODIFY BSEG FROM TABLE IT_BSEG   (here it_bseg is the internal table)
    COMMITWORK.
    Modify always check in the database whether the record exists or not if it is there it will modify the existing one.. otherwise create a new record.... in Update statement.. there is always a chance of creating a new record.. instead of updating the existing one...

  • Updating EAN11 field in mara table through BAPI_MATERIAL_SAVEDATA

    Hi,
    I want to update EAN11 field in mara table through BAPI_MATERIAL_SAVEDATA could anybody please guide me how to achieve.
    it would be great if is there any sample code for the same.
    Thanks

    Please give the following fields in the lwa_uom structure as well
    lwa_uom -ALT_UNIT
    lwa_uom -NUMERATOR
    lwa_uom -DENOMINATR
    DATA: lwa_uom TYPE BAPI_MARM,
    lwa_uomx TYPE BAPI_MARMX.
    DATA: lt_uomx TYPE STANDARD TABLE OF BAPI_MARM,
    lt_uomx TYPE STANDARD TABLE OF BAPI_MARMX.
    lwa_uom-ean_upc = '123456' " enter the value here
    lwa_uom-ean_cat = 'abcd'.
    append lwa_uom to lt_uom.
    lwa_uomx-ean_upc = 'X'.
    lwa_uomx-ean_cat = 'X'.
    append lwa_uomx to lt_uomx.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
    unitsofmeasure = lt_uom
    unitsofmeasurex = lt_uomx.
    Edited by: Rahul Babukuttan on Dec 21, 2011 4:23 PM

  • Planning data to Oracle Tables Using ERPi???

    Hi All,
    We are using a Hyperion V11.1.2 having a scenario like
    we want ot load data in to Oracle Tables or GL Balance Tables from Planning Application using ERPi , but we are not loading data directly from GL Balance to Planning using ERPi, so can we load data from Planning to OeBS or Oracle Tables using ERPi???
    Are there any special adaptars or special way to load data back to OeBS GL Balance ???
    Regarda
    Kumar

    Hi ram
    let me know how can i upload oracle tables to XML
    regards
    Anand

  • Update a Table Field of QMEL Table Using Function Module

    hello Guru
    I want to update a field of QMEL table suing FM which was created by user. how to write code for that. i have some idea but it is not helpful for us.....
    Moderator Message: Searching the forums/Google is a good start.
    Edited by: kishan P on May 19, 2011 12:13 PM

    hi Ram,
    You can use update query on table setting particular field value...There is no Function module for it.
    Regards,
    Pawan.

  • Mainframe data loaded into Oracle tables - Test for low values using PL/SQL

    Mainframe legacy data has been copied straight from the legacy tables into mirrored tables in Oracle. Some columns from the mainframe data had 'low values' in them. These columns were defined on the Oracle tables as varchar2 types. In looking at the data, some of these columns appear to have data that looks like little square boxes, not sure but maybe that is the way Oracle interprets the 'low values' in the original data into varchar. When I run a select to find all rows where this column is not null, it selects these columns. In the results of the select statement, the columns appear to be blank, however, in looking at the data in the column using SQL Developer, I can see the odd 'square boxes'. My guess is that the select statement is detecting that something exists in this column. Long story short, some how I am going to have to test this legacy data on the Oracle table using Pl/Sql to test for 'low values'. Does anyone have any suggestions on how I could do this????? Help! The mainframe data we are loading into these tables is loaded with columns with low values.
    I am using Oracle 11i.
    Thanks
    Edited by: ncsthbell on Nov 2, 2009 8:38 AM

    ncsthbell wrote:
    Mainframe legacy data has been copied straight from the legacy tables into mirrored tables in Oracle. Not a wise thing to do. Mainframe operating systems typically use EBCDIC and Unix and Windows servers use ASCII. The endian is also different (big endian vs little endian).
    Does anyone have any suggestions on how I could do this????? As suggested, use the SQL function called DUMP() to see the actual contents (in hex) of these columns.

  • Want to update data in a view based on multiple tables

    Hi
    I am facing a problem i want to update data in tables using a view. As that view is based on multiple tables so i am unable to update data. i came to know we can update table from view only if view is based on single table. so if anyone knows any alternative please let me know.
    Thanx
    Devinder

    Devinder,
    The table can be updated through a view based on multiple tables, if and only if the table is a "key preserved" table. Rather than explaining myself, i avoided the burden of typing by finding the material in Oracle Docs and pasting it for you :-)
    If you want a join view to be updatable, all of the following conditions must be
    true:
    1. The DML statement must affect only one table underlying the join.
    2. For an INSERT statement, the view must not be created WITH CHECK
    OPTION, and all columns into which values are inserted must come from a
    key-preserved table. A key-preserved table in one for which every primary
    key or unique key value in the base table is also unique in the join view.
    3. For an UPDATE statement, all columns updated must be extracted from a
    key-preserved table. If the view was created WITH CHECK OPTION, join
    columns and columns taken from tables that are referenced more than once
    in the view must be shielded from UPDATE.
    4. For a DELETE statement, the join can have one and only one key-preserved
    table. That table can appear more than once in the join, unless the view was
    created WITH CHECK OPTION.
    HTH
    Naveen

  • Want to update one field in MIRO

    Hi Experts,
    During the MIRO transaction, I want to update "Assignment" field in "Detail" Tab according to purchase document number.
    I have to fetch data from Z table using Purchasing document number and update it in Assignment field when user post the document in MIRO.
    Please help me how to do this as i am very new to this moodule.
    Thanks
    Sameer Dhuke

    Hi
    Did you try changing the 'Sort key' in GL master to 010 - Purchase order number
    Thank You,

  • Update Date field automatically

    When a user is adding a new entry I want two of the fields in the table to be automatically updated without the user knowing (hidden fields), I want a current date and time to be entered into the Updated Date field and the :APP_USER to be entered into the Updated_by VARCHAR2 field.
    How do I go about doing this can I just put code to do so into the source of ITEMS or do I have to create a process?
    Thanks
    s

    S,
    Triggers are a good method, see this thread:
    Re: Table Trigger Syntax
    Jeff

Maybe you are looking for