How do I enter dates in an INSERT or UPDATE statement?

I'm converting an application from MySQL to Oracle.
Given a table my_table with a column my_date defined as a datetime in MySQL,
this statement is valid:
UPDATE message SET my_date = '2009-06-22 22:40:00' WHERE id = 1
For Oracle, I've used DATE as the type. When I try to use the same statement, I get
ORA-01861: literal does not match format string
I've set NLS DATE_FORMAT to 'RRRR-MM-DD HH24:MI:SS'
Thanks very much for any help and guidance.
Regards,
Marty

mschechtman wrote:
UPDATE message SET my_date = '2009-06-22 22:40:00' WHERE id = 1
For Oracle, I've used DATE as the type. When I try to use the same statement, I get
ORA-01861: literal does not match format string
I've set NLS DATE_FORMAT to 'RRRR-MM-DD HH24:MI:SS'Try
UPDATE message
SET my_date = to_date('2009-06-22 22:40:00', 'RRRR-MM-DD HH24:MI:SS') WHERE id = 1Use to_date function to convert strings to date.
Regards,
Jo

Similar Messages

  • How can I enter data in an input schedule on a member in the EPM Add-On that is not a base member?

    Hello, all,
    how can I enter data in an input schedule on a member in the EPM Add-On that is not a base member?
    E.g. I want to implement a top-down-planning scenario and I have the following hierarchy:
    Europe
         Germany
         France
         UK
         Spain
         Italy
    How can I enter a value on Europe in an input schedule in order to allocate this value afterwards?
    Thanks in advance and best regards
    Gerd

    Gerd,
    It should be something like below -
    EuropeInput
    Europe
         Germany
         France
         UK
         Spain
         Italy
    EuropeInput shall be kept out of hierarchy and should be a base level member. Users will enter the numbers in this member. In your script logic, you will make use of this member to allocate the data in Bas(Europe) i.e. Germany, France, etc.
    Effectively, after allocation the same data will be rolled up to Europe.
    Many top-down planning would use such work-around as BPC doesn't allow writing to parent node.
    Regards,
    Ashish

  • How to show a data in Higher fonts with write statement

    Hi.
    how to show a data in Higher fonts with write statement
    I want to show a statement in large fonts with write statement.How can I do that.
    write : 'Company Address'.
    Regards
    Mave

    Mave,
      I would precribe you to use the FORMAT options available with the WRITE Statement.
    Because this allows us to differentitate between the HEADIngs and the LINEs in the report.
    Here u go dear:
      http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9e7135c111d1829f0000e829fbfe/frameset.htm
    Thanks
    Kam

  • How to retrieve all datas that lost when i update my iphone4 to that 6.10 ios. i tried to look at may i tunes in my computer but it seems that i forgot to perform back ups since i purchased this phone 2yirs ago.. pls send me an advice..thank u.

    how to retrieve all datas that lost when i update my iphone4 to that 6.10 ios. i tried to look at may i tunes in my computer but it seems that i forgot to perform back ups since i purchased this phone 2yirs ago.. pls send me an advice..thank u.

    All of the data should be on your computer, simply sync it back.
    If the update was done via iTunes on the computer, the first step in the process is a backup of the device.

  • How to keep entering data in web pages

    hi,
    i am using ADF 11g 2 release. I have remote application connect with ADF jar lib and local application. when i enter data to my local application and redirect to remote application and enter the data their also. But when I link to local app page via url view but I entered data is not there. I am not commited any page data. In remote app... alos link but there also no data. how to keep them??
    all page in taskflow and they connect with control flow case. I made Auto submit true and immediate true for text component.. but no any change.
    can not use any setting changes? Need java coding for both application??
    hoping chance..
    thanks.

    hi,
    I have developed ADF 3 web applications. 2 of them are connect as ADF jar lib files in other application. That application name is local application and other 2 mentioned as remote application(jar lib files). those are in taskflowcall. IN my Local Application which has Application Module. so I selected remote application's Application modules as Application Module Instances. Then in my Local Application DataControl which include that added Application Modules inside the local application DataControl. which are in nested. Remote application DataControl also appear in the local app DataControl.
    Problem is I want to save all applications data through my local application. therefore I link to first remote app and enter data but not commit ,then come back to local app.. and enter data and again goto first remote app again, BUT entered data Not there. so I want to keep them and save all 2 remote app data and local app data.
    DCDataControl dc = bc.findDataControl("TestRemoteAppDataControl"); // *<-- this is one of my remote application Data control name..*
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    am.getTransaction().commit();
    dc.commitTransaction();
    this code is not worked. BUT local app data only saved using below code...
    BindingContext bc =BindingContext.getCurrent();
    DataControlFrame dcf= bc.findDataControlFrame(bc.getCurrentDataControlFrame());
    Collection<DCDataControl> dcCol =dcf.datacontrols();
    for(DCDataControl dCDataControl : dcCol) {
    if(dCDataControl.isTransactionDirty()){
    try{
    dCDataControl.commitTransaction();
    catch(Exception e) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), null));
    e.printStackTrace();
    thanks ,hopping chance.
    any who know this??
    thanks.

  • How to identify which data has been inserted  to the table in specific date

    Hi,
    i created one table without data column.. i am inserting data in that table.
    i want which data has been inserted today..
    Please help.
    Thanks,

    If you are in Oracle 10g you can use ORA_ROWSCN.Note that unless the table was created with ROWDEPENDENCIES enabled, though, ORA_ROWSCN is tracked at the block level rather than the row level. So a block with one new row and many old rows could appear as having all been entered today.
    Justin

  • How to convert varchar to date datatype while insert or update in table

    Hai All
    I need to convert to varchar to date.
    I have two Tables T1,T2
    T1 Structure
    Code varchar
    Time varchar
    Date varchar
    T2 Structure
    Empname var
    Empcode var
    Intime date
    Outtime date
    Intrin date
    Introut date
    Att_date
    Now i need to move Time form T1 to T2 Intime,outtime,intrin,introut according some condition
    So now i need to convert Varchar to Date while insert or update
    I have tried something
    Insert into T1 (code,intime,att_date)values
    (code,To_date(Date||time,'dd-mon-yyyy hh24mi'),att_date);
    OR While update
    Update T2 set Outtime=To_date(Date||time,'dd-mon-yyyy hh24mi') where...
    I got an error Ora-01861
    Regards
    Srikkanth.M

    You didn't show any example of your date or time values, butyou might need to add a space between them, like
    To_date(Date || ' ' || time,'dd-mon-yyyy hh24mi')

  • How to Design a Page for Both Insertion and Updation

    Hi,
    I have Page where I need to populate a table from Standard PO/AP table and once the save is clicked on the table,
    the data shoudl be inserted in custoim table.
    Ex: Ui table wil have 3 columns and say 5 rows
    - PO#
    - Line#
    - Amount for 'X' purpose
    where PO# and Invoice# is populated and Amount is empty
    User will enter value in Amount column in all 5 rows and click on Save button.
    Now these 5 rows with 3 columns should be inserted into the custom table (PO#, Line# and Amount)
    How Can I design Model Objects for such a requirement?
    Thanks,
    Kamath

    You should create an EO on your custom table and a VO on your EO. As you insert records in the VO, corresponding rows are created as EO rows and when you commit (getOADBTransaction().commit()) in the AM everything would get committed to the DB.
    As far as subject goes of having a common page, everytime you can execute the VO with the bind parameters and check whether a row exists. If it does exist then update the VO Row (I expect the master record to be unique row). Otherwise create a new Row for the master and then correspondingly for the details row.
    Do let me know in case you need additional information.
    Regards
    Sumit

  • Updating a column using deleted/inserted during update statement execution

    I need to capture the old value while update statement is executed. I can not insert into temp table (there are many samples online where you can use OUTPUT clause to insert data in same table or another temp table)
    something like 
     declare @count table
        id int,
        changed varchar (50)
    insert into @count (id,changed) values (2,'T')
    insert into @count (id,changed) values (3,'T')
    insert into @count (id,changed) values (4,'T')
    select * from @count
    UPDATE @count
    SET id=5,
        Changed = GETDATE() -- here instead of date, I want to get inserted.id and  deleted.id
    OUTPUT inserted.id,
           deleted.id
        where id = 2
      SELECT *FROM @count
    Any help on this will be very much appreciated....

    I am not sure to follow your question but you can get the old value just by doing:
    UPDATE @count
    SET id=5,
        Changed =  id
    OUTPUT inserted.id,
        deleted.id
    WHERE id = 2;
    since SQL Server uses all-at-once operations.
    Microsoft SQL Server 2012 T-SQL Fundamentals
    http://shop.oreilly.com/product/0790145321978.do
    AMB
    Some guidelines for posting questions...

  • How to check if data is being inserted into table?

    Oracle 10.2.0.1.0
    I have a long running transaction, an insert based on select running from SQLPLUS. It is running for more than 2 hours as the volume of data is extremely high ( more than 2 million records ).
    How do I check:
    1) The volume of data that is already inserted?.
    This is to make sure the session is not "hung", but is actually inserting records into the table.
    Thanks

    I have a long running transaction, an insert based on select running from SQLPLUS. It is running for more than 2 hours as the volume of data is extremely high ( more than 2 million records ).
    How do I check:
    1) The volume of data that is already inserted?.If there is a commit statement then you can directly query the table for number of rows inserted.
    This is to make sure the session is not "hung", but is actually inserting records into the table.To confirm if it is running or not you can query dba view like dba_extents for that objects you can look into bytes or blocks which should increase if you query is running.
    Hope this helps
    Virendra

  • How can I enter data in a spreadsheet at the cursor

    I want to be able to take a reading from an instrument and put it into the cell where the cursor is currently located in Excel 2000.  I could use a mouse click or "Return" key to indicate that now is the time to take a reading and enter it into the cell.  The cursor would be moved manually to the cell where it is desired.
    Judd

    Hello,
    For formatting strings to be written to spreadsheets such as excel, see my post in the following thread - it includes an attached example:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=165067&query.id=23613#M165067
    Best Regards,
    JLS
    PS - it does not address writing to a cell which your cursor is in - it uses simple file i/o to write a spreadsheet formatted string/file, and this cannot even be written in this way if you already have the file you are writing to open in another program - usually the program blocks access (and reasonably so) when it opens the file.  You can of course write to a file and choose which cell a given piece of data will show up in when you open it in excel... this is just formatting the data correctly, and as you'll see in the thread linked above, this is rather trivial.
    Best,
    JLS
    Sixclear

  • How do I enter data in excel with a specified number of decimal points?

    I have several inputs that are being written into excel using the "Write to Spreadsheet file" vi. One of my inputs only writes to excel with 3 decimal points. I would like it to have four, how do I change this?

    Pop-up on the top input to the "Write to Spead...." labled "Format".
    Chnage it from the default of "%.3f" to "%.4f"
    Ben
    Ben Rayner
    Certified LabVIEW Developer
    www.DSAutomation.com
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How do I view data from OLAP DML program or statement?

    Hi
    I'm struggling to find any information on this topic anywhere on the net:
    How to view data produced by an Oracle OLAP DML program or statement.
    Background :
    I am using the latest AWM to create and maintain dimensions, cubes and measures. However, I've noticed that AWM, Discoverer OLAP, BI Beans, Excel Plug-In et al only provide a fixed set of formula and expressions.
    For example, I wanted to created a Standard Deviation (STDEV) on measure. After much searching I learnt that I could do this by creating a custom measure in AWM by importing a measure defined in an XML dcoument as it's not provided by AWM. The output in Discoverer OLAP on the surface seems to give the correct results, however when drilling from high level to lower level of time time dimension hierarchy Discoverer includes the parent value in the calculation and renders the values incorrect.
    My alternative is to use OLAP DML, as it provides a richer range of formuale and calculations possibilities and I was hoping to use this functionality to do create the measures. I have the distinct impression, however, that OLAP Worksheet is the only interface out there to do this.
    It seems very primitive and limited with regards to data output, almost like SQL*Plus in many ways.
    The burning questions I have are :
    1) Do I need to write DML programs to perform these custom measure calculations and add them to cubes or do I import the custom measures via AWM and XML?
    2) If the answer to question 1 is DML programming, is there a way of viewing the OLAP data output through a GUI interface without embedding the statements in SQL.
    3) Has anyone experienced or noticed the same problem with Discoverer OLAP, AWM Viewer that I mentioned above? i,e, statistical functions performed on whole dimension hierarchy rather than lower levels.
    I'm hoping someone out there knows what I am trying to do or get at. Keith, any ideas or suggestions?
    Thanks
    Kind Regards
    Greg

    Hi Greg,
    There are two ways to achieve what you want. Both require the use of custom calculations which cannot be created via the calculation wizard within AWM. To do this the easiest way is step outside of AWM and use the Excel Calculation utility that is on the OLAP OTN home page:
    Creating OLAP Calculations using Excel
    http://download.oracle.com/otn/java/olap/SpreadsheetCalcs_10203.zip
    Readme
    http://www.oracle.com/technology/products/bi/olap/OLAP_SpreadsheetCalcs.html
    (Oracle OLAP DML Reference contains a list of all the OLAP functions that can be used to create a custom calculation. http://www.oracle.com/technology/products/bi/olap/OLAP_DML_10.2.zip)
    The Excel tool lets you assign your own formula to a measure and then uploads that measure definition into your AW. It is possible to import a custom calculation template into AWM using the menu option on the Calculated Measure node of each cube, but it is safer to use the Excel Worksheet as this directly uses the public XML API and is always best to use a public API rather than hacking XML templates.
    There are two types of custom calculation:
    1) Formula: using a formula you can directly call any of the OLAP functions. For example to create a measure that returns the standard deviation for a measure then you would enter the following as the formula for your calculated measure:
    stddev(sales_revenue, time)
    The easiest way to test if the measure is working as expected is to use the data viewer within AWM.
    2) Programs - if the function you need is not provided or you want to do special processing to return a result you can create an OLAP DML program which can return a result. To do this use OLAP Worksheet to define the program and add a datatype to the DEFINE statement, such as :
    DEFINE PRG_SD_SALES PROGRAM DECIMAL
    In the program return the value you have calculated within your program. Within the program you can do just about anything but be aware that your program is going to fire for every cell within your virtual cube so it must be efficient and fast to execute. For a measure then you would enter the following as the formula for your calculated measure:
    prg_sd_sales(time, products, geographies, channels).
    The actual program code would look something like this:
    DEFINE PRG_SD_REVENUE PROGRAM DECIMAL
    PROGRAM
    argument T_TIME TIME
    argument T_PRODUCT PRODUCTS
    argument T_GEOGRAPHY GEOGRAPHIES
    argument T_CHANNEL CHANNELS
    variable D_RETURN decimal
    TEMPSTAT TIME, PRODUCTS, GEOGRAPHIES, CHANNELS
    do
    limit PRODUCTS to T_PRODUCT
    limit CHANNELS to T_CHANNEL
    limit GEOGRAPHIES to T_GEOGRAPHY
    limit TIME to T_TIME
    limit TIME add descendants using TIME_PARENTREL
    limit TIME keep TIME_LEVELREL 'CAL_MONTH'
    D_RETURN = stddev(SALES_REVENUE)
    doend
    return D_RETURN
    END
    This code computes a standard deviation the all months within the specified time range, at year level for all 12 months, at quarter level for the three months within the quarter ans returns NA at the month level.
    As the code executes within a implicit loop you can only change the status fo dimensions that for part of that implicit by using the TEMPSTAT command. To test the program at the command line use the OLAP Worksheet and the SHOW command to just return one cell of data, DO NOT SIMPLY USE THE RPR COMMAND because you will have to wait for the whole cube to be returned. If you want to use the RPR command make sure you limit your base dimensions first! You can use PRGTRACE to debug your program code it is not working as expected. Again, the easiest way to test if the measure is working as expected is to use the data viewer within AWM, although this will not return debug information so send all your debug output to a file to capture any errors and/or trace the execution flow.
    Hope this helps
    Keith Laker
    Oracle EMEA Consulting
    BI Blog: http://oraclebi.blogspot.com/
    DM Blog: http://oracledmt.blogspot.com/
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Samples: http://www.oracle.com/technology/products/bi/samples/

  • How do I make Date & Time image on webpage update when page is accessed?

    I added a date function to my webpage; but it does not update each time the page is accessed. When I open iWeb to work on pages, the date IS updated; but not when accessed on the internet. Any help will be appreciated!
    IMac Power PC G4   Mac OS X (10.4.6)  

    So all you want is the current date and time to be displayed on your webpage for viewers to see? Well then, one of those scripts should do the trick for sure.
    In terms of adding the javascript to your pages and having it show up in a particular location, it will involve some post-publishing editing of the HTML file for your Main page. And then everytime you change this Main page, you will have to redo your editing. It's not that big of a deal, but I just wanted to let you know.
    To add the javascript code to you pages, you will follow the usual procedure for adding external HTML to iWeb published pages...
    The general directions are as follows...
    1. Decide where you want your clock/calendar and know exactly what dimensions you need to display the whole thing.
    2. Insert a text box onto your page and adjust its size to exactly your dimensions.
    3. Type in some uniquely identifiable text like, "CALENDARCODE" without changing the font or anything else...just type it in.
    4. Publish your page with iWeb.
    5. Find the html file associated with your published page (either on your iDisk or in a folder depending on how you published) and open it in any text editor (like Microsoft Word, or Textedit, or anything that can display plain text).
    6. Scroll through the html file and locate your placeholder text, e.g. "CALENDARCODE".
    7. Replace the placeholder text with your javascript/html code and publish your page.
    That's it. You should see your Date and Time show up where you placed the text box. You might have to go back and edit the size of the text box to make it fit the Date and Time just right, but just follow the steps over.
    Please mark this reply as either "solved" or "helpful" with the little buttons in the title bar of this reply if you found it to be of any use.

  • How to restrict the data with Filter in Query - Updated the description

    Hi all,
    Free Characteristics: u2018Service Orderu2019 & u2018Statusu2019.
    Key Figures: u2018Response Timeu2019 & u2018Data Record Counteru2019.
    Calculated Key Figure: u2018Resp Time > 1 hru2019.
    Only u2018Plantu2019 is in ROWS and u2018Resp Time > 1 hru2019 & u2018Data Record Counteru2019 are in COLUMNS section.
    The report looks like the below:
    Plant---Resp Time > 1 hr -
    Data Record Counter
    100--1--
    2
    101--1--
    3
    After dragging the u2018Service Ordersu2019 from u2018Free Characteristicsu2019 , the report looks like the below:
    Plant---Service Order -
    Resp Time > 1 hr ---Data Record Counter
    100--111--
    1
    100--120--
    1
    101--130--
    1
    101--141--
    1
    101--150--
    1
    I want only records whose u2018STATUSu2019 is u2018Yu2019. The u2018STATUSu2019 is u2018Blanku2019 for Service Orders 12, 13 & 15
    and those records should not be there in the report.
    The report should be like the below:
    After dragging the u2018Service Ordersu2019 from u2018Free Characteristicsu2019, the report looks like the below:
    Plant---Service Order -
    Resp Time > 1 hr ---Data Record Counter
    100--111--
    1
    101--141--
    1
    After creating the Restricted KF u2018Countu2019 on u2018Data Record Counteru2019 by restricting u2018STATUSu2019 to u2018Yu2019 and
    dragging the u2018Service Ordersu2019 from u2018Free Characteristicsu2019, the Count shows ZERO :
    Plant---Service Order -
    Resp Time > 1 hr ---Count
    100--111--
    0
    100--120--
    0
    101--130--
    0
    101--141--
    0
    101--150--
    0
    If I keep the Filter (globally) on 'STATUS = Y' then it returns 'NO Data'.
    If I keep the u2018Service Ordersu2019 is in u2018Rowsu2019 and the Filter on u2018STATUSu2019 (u2018Yu2019) then it works fine, but the report should be based on PLANT.
    Thanks in advance.
    Reagrds,
    Venkat.

    Hi Gurus,
    Thanks for u r all prompt replies...
    Got the Solution...
    Actually no need to work at query level...
    iN Multiprovider.... we can select the WBS element Char for which ever cube data we want... just drop down the char in to the dimension which we need and R/click the Char select identification of participating char.. un-select the check box for char WBS element for the Cubes which we dont require the data......
    Thanks to all
    Cheers
    Lajwanth
    Edited by: Lajwanth Singh on Apr 27, 2010 10:41 PM

Maybe you are looking for

  • To export query from Access to Excel in Read/Write mode in VBA

    Below is the code which exports the query named 'LatestSNR' from Access to Excel; Public Sub Expdata() Dim rst As DAO.Recordset Dim Apxl As Object Dim xlWBk, xlWSh As Object Dim PathEx As String Dim fld As DAO.Field PathEx = Forms("Export").Text14 'p

  • Brush icon not displaying correctly

    Hi folks, I just installed CS4 on a lovely new Dell notebook with WUXGA display (1920x1200) and am having a problem that I have never seen before. When the brush tip is small (up to 35 px at 100%)  I see the entire circle defining it, but as I move i

  • PLM WEB UI - Personal Object Worklist for Material BOMs dumps in Portal

    We installed business package for PLM WEB User interface and we start playiong around with the POWL functionality. For some reason teh system ends in an error calling ....../sap/bc/webdynpro/PLMU/wda_wcc_myobj/ This is section Personal Object Worklis

  • User Name/Password Protecting a Directory

    I've seen this done without using a server-side scripting method, but instead using a configuration file to set a user name and password for a protected directory on an Apache server - where it throws back the prompt when trying to access it. Does an

  • Error when using sapgenpse import_own_cert to import a signed certificate

    We have installed a WebDispatcher and want to use SSL and executed the following steps: 1. Generate Self-Signed Certificate and CSR by: sapgenpse get_pse -p SAPSSLS.pse -r SAPSSL.req "CN=emsd3c.cs-apps.carestreamhealth.com, OU=IT, O=Carestream Health