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***

Similar Messages

  • 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!

  • How to store .doc file in oracle using jdbc

    Here is problem , storing microsoft excel file (or) .txt file to database(ORACLE) through JDBC .
    how to retrive

    Congratulations! You are the one millionth person to ask how to store files in databases without searching for previous threads.
    What do you win?
    A hearty smack in the forehead and a strenuous endorsement to use Google, search and find the answer.

  • 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

  • How to update information fields of a profile in Oracle UCM using RIDC

    Hi All
    I have a requirement in which i need to modify/update the metadata/information fields of a Profile in Oracle Webcenter Content(UCM).
    I found out that this can be achieved using RIDC api, but i have little knowledge about the same.
    If someone could suggest about how to retrieve and update the fields in UCM using RIDC or some other approach would be of great help.
    It's really important.Kindly help
    Regards
    ACM

    user13069455 wrote:
    Hi Jiri
    Even i have thought about the same as one of the approaches, but i was a bit apprehensive about using this one.
    I have few stupid queries regarding this:
    1)Will it expose the production database(connection details) to the environment?Yes. If you don't like the idea of giving connection to the database to a "third-party" program, you could go from the other side - create a UCM component (some kind of scheduled job), which will be a part of UCM, but do the same. It will be a bit more complicated, but might be considered more secure.
    2)Will it have any performance impact?I don't think there will be much impact - most of time, tables will be accessed in read-only mode (pulling the data out), so except few per cent of CPU and some memory it should not consume anything. Besides, you should be able to schedule upload to "quiet hours", if there are some
    3)Will it still be an integration with the UCM?Well, yes. It will be integration at the database level. But honestly, as long as it works, do you care how is it called?
    >
    Thanks
    ACM

  • How can we update data in LDAP server using PL/SQL.

    Hi,
    How can we update data in LDAP server using PL/SQL program.
    Is there any sample code for refrence.
    Thanks,
    Tarun

    Hi Justin,
    Thanks for your help. You got my correct requirements.
    Tim's example returning all the attributes of current user which is admin user. Please correct me if I am wrong.
    I have the following information:
    the admin user and password,server info , port and ldap_base for admin.
    I have uid and password for regular user, I am trying find the ldap_base for regular user, which may be different from adminuser.
    Please help me.
    Thanks,
    Edited by: james. on Jan 12, 2009 5:39 PM

  • How can I update data fields in a merged document ?

    Hi,
    I'm looking for a way to update the values of data fields in a merged document with a script just as you can do with the user interface.
    I don't find any method like "updateDataFields ()" in the DataMerge object.
    Si I try to invoke the menu action "Update Data Fields", but it fails. The script error message is: "Error 53762, the script is not active." On the contrary, the action works if I use the interface.
    Can anyone help me?
    Thanks in advance,
    FredIsnard
    PS : I work with CS5.5 and JavaScript.

    Hi!
    You might be looking for this one:
    DataMerge.mergeRecords (outputOversetReportFile: File )
    Merges records and produces an optional overset report.
    outputOversetReportFile: Data Type: File
    The path to the file in which to store the overset report. (Optional)
    Best regards,
    Andreas

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • How fast text search field in Oracle without using Intermedia?

    How fast text search field in Oracle without using Intermedia? Thank you, Paul.

    yes,it is overriden in VOImpl
    public void executeQuery()
            setQuery((new StringBuilder()).append(selectStmt).append(" order by ").append(getOrderByClause()).toString());
            OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl)getApplicationModule();
            OAApplicationModuleImpl _tmp = oaapplicationmoduleimpl;
            if(oaapplicationmoduleimpl.isLoggingEnabled(1))
                OAApplicationModuleImpl _tmp1 = oaapplicationmoduleimpl;
                oaapplicationmoduleimpl.writeDiagnostics((new StringBuilder()).append(getClass().getName()).append(".executeQuery").toString(), (new StringBuilder()).append(" Query:").append(getQuery()).toString(), 1);
            super.executeQuery();
    But I have extended VO and substituted the VO . In the substituted VOImpl, instead of executeQuery(),I have written
    public void customExecuteQuery()
              setQuery((new StringBuilder()).append(selectStmt).append(" order by ").append(getOrderByClause()).toString());
              executeQuery();
    Will this work,or do I need to do any changes?
    Thanks,

  • Error while updating Date Field on Process Form.

    Hi,
    I am using java code to pre-pop date on the process form.First I used a java code whic took java.sql.date as input and returned the same java.sql.date.But it gave an error that:java.lang.String cannot be converted to java.sql.date.......
    So I changed the java code and now it takes string as input and returns java.sql.date. This code works fine for Pre-pop adapter and the date is populated on the process form.
    But when i use the same code in a Process Task adapter to update the date, then it gives the following error:
    ERROR [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)' XELLERATE.ADAPTERS - Class/Method: tcAdpEvent/updateDataSetValuePost encounter some problems: Adapter Execution Error: updateDataObjFieldValuePost: error updating UD_OID_USR_DATE_OF_BIRTH
    ERROR [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)' XELLERATE.ADAPTERS - Class/Method: tcAdpEvent/updateDataSetValuePost encounter some problems: {1}
    Can anyone suggest any method to update date field on process form?

    Hi Abhi,
    Can you tell me how you have implemented populating an UDF based on Prepopulation of another UDF. I have a similar kind of requirement. It would be great if you share your code or relevant part of it.
    Regards,
    Sunny Ajmera

  • How to update single field

    Hi frnds,
                        How to update single field data in Z table .
                       I am taking data from screen, when i press update button  the data will store specific field data in Z table.

    Dear Rakhi,
    You can use the below syntax.
    Hope this would solve your problem.
      LOOP AT tpra INTO wpra.
        UPDATE zpra
        SET    pra2 = wpra-pra2
        WHERE  pra1 = wpra-pra1.
      ENDLOOP.
    In WHERE give KEY VALUES
    In SET give the particular value that has to be changed.
    Regards,
    Pintoo
    Edited by: pintoo2805 on May 18, 2010 7:10 AM

  • How to update 2 fields automatically rest manually on page

    Hello folks,
    I have got a question on how to update 2 fields in a table automatically (in my case this is one field for the user and one field for the correct date and time). This should happen automatically every time an user changes a row in the table. But it seems as if i cant change the fields i tried it with the changing of the textfield but he dont change the values in the database. I even tried a separate update statement but since this is set after the commitchanges() command it seems as if he ignores any following commands.
    So anybody a good idea how i can change easily these two data fields? I just cant believe that you must manually change the fields, thats not the use of these 2 fields.
    Thanks in advance for your help
    Acinonyx

    To be exact i have got a page with different fields which get their data from my database. Two fields which contain an userid and the other a date and time value should get updated automatically when the user changes something of the other values on this page and press a button which calls the commitchange method. But since this should happen automatically and not manually i cant put these changes in the database. The manual changes are saved without any problems but the automatical changes not. So my question is how can i change a value programmatically and make him save these canges in the database?
    I already tried to put the new values in the fields or even detailed in the database but i cant get him to update these two fields.
    Acinonyx

  • How to update key fields for table

    Hi,
    how to update key fields for a table.The update statement is not working for the same.
    Regards,

    Hi,
    See the below example.
    TABLES SPFLI.
    DATA WA TYPE SPFLI.
    MOVE 'AA' TO WA-CARRID.
    MOVE '0064' TO WA-CONNID.
    MOVE 'WASHINGTON' TO WA-CITYFROM.
    UPDATE SPFLI FROM WA.
    MOVE 'LH' TO SPFLI-CARRID.
    MOVE '0017' TO SPFLI-CONNID.
    MOVE 'BERLIN' TO SPFLI-CITYFROM.
    UPDATE SPFLI.
    CARRID and CONNID are the primary key fields of table SPFLI. All fields of those lines where the primary key fields are "AA" and "0064", or "LH" and "0017", are replaced by the values in the corresponding fields of the work area WA or the table work area SPFLI.
    Regards,
    raj.

  • How to display Date Calendar in Oracle BI Answers Prompts (parameter)

    I'm still new to OBIEE.
    How to display Date Calendar in Oracle BI Answers Prompts (parameter)?
    Thanks.

    Hi,
    While creating Dash Board prompt choose the control to 'Calendar'.
    I think it is not possible to provide 'Calendar' control using Prompts tab while creating request.
    It is possible to write Java Script for a Column of data type 'char'. So, cast the date data type to char.
    Go to: Column Properties --> Data Format
    Choose override default data format to view the available options in the drop down list.
    I would be very happy if anybody acknowledge me that I am wrong.
    -Vency

Maybe you are looking for

  • Performance Improvements in Report

    Dear ABAPers,      I am developing the Report.The Input parameters are Brand name , Month and Year.The data has to be selected from header tables , item tables and Sub item tables.So i am writing the select statement inside the loop because i could n

  • ITunes 10.5 Errors on Windows Vista 64bit

    Kay. This thing is REALLY racking my nerves. i've tried EVERYTHING the forums have said, at first i tried updating, reinstalling, restarting my laptop, etc. Then i tried uninstalling, reinstalling, repairing the files in the programs section. Now ive

  • How to set maximum number of data points displayed on waveform chart?

    I have a waveform chart set to x-autoscale, but after about 1000 data points, it begins to scroll again. How can I display all of the data points being collected, say 2000 points?

  • Why do my photo file size increases upon export?!?!

    This is driving me nuts. I have Aperture 1.5.2 referencing an iPhoto library. When I look at the metadata toolset I can see each photo's file size. I have all my photos already resized to fit in an 800x800px box. When I export through Aperture using

  • BBM on Playbook WITHOUT BBMBRIGDE after 2.1.9***-update??

    Hi, does anybody know,  if BBM can be installed and used on playbook Without installing bb-bridge, and after the latest PB- update 2.1.9***.?? Thanks  Solved! Go to Solution.