Converting a char(8) to a date format field and doing a update NOT insert

Here is the sql ...
update oh_desc SET refdate = TO_DATE ('refchar', 'YYYYMMDD');
Here is the database layout ...
SQL> describe oh_desc;
Name Null? Type
CORP CHAR(3)
PEID CHAR(6)
REFCHAR CHAR(8)
REFDATE DATE
REF CHAR(10)
OHDESC CHAR(45)
I'm trying to fill out the refdate field (defined as date and empty) with the char field called refchar (char date defined as 'YYYYMMDD'.
I know I need to use the 'TO_DATE' sql but all examples I can find have a hardcoded string that is the input data instead of a field from a table.
I get the following error when executing the sql ...
update oh_desc SET refdate = TO_DATE ('refchar', 'YYYYMMDD')
ERROR at line 1:
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
Got any ideas ? Thanks :)

Remove the single quotes around refcar.
So the update should be:
UPDATE oh_desc SET refdate = TO_DATE(refchar, 'YYYYMMDD')

Similar Messages

  • What does initial do when used on a date format field

    Hi,
    When  a check of if initial is done on a date format field , does it check if the field is 00/00/0000 orit checks if its blank?
    Thanks.

    Check is done on value "00000000".
    Please try the following code, put a break-point on IF condition, t_date will have value  "00000000":
    DATA: t_date type sy-datum..
    IF t_date IS INITIAL.
      Write : 'test'.
    ENDIF.
    Hope this helps.

  • HT4108 can I use my IPAD with a data projector?  and does the data projector have to be an iOS compatible one?

    can I use my IPAD with a data projector?  and does the data projector have to be an iOS compatible one?

    You can connect via a cable or wireless using an Apple TV.
    http://ipad.about.com/od/iPad_Guide/a/How-To-Connect-Your-Ipad-To-Your-Tv.htm
    iPad Accessories: Connections for a TV or Projector
    http://www.dummies.com/how-to/content/ipad-accessories-connections-for-a-tv-or-p rojector.html
    You may be interested in AirPlay on the Apple TV:
    Apple - AirPlay - Play content from iOS devices on Apple TV
    http://www.apple.com/airplay/
    Alternately, there are Apple Digital AV Adapters for hardwired connections:
    iOS: About Apple Digital AV Adapters
    http://support.apple.com/kb/ht4108
     Cheers, Tom

  • How can i convert the firefox-history-timestamp in places.sqlite into a normal date format? The firefox-timestamp is not equivalent to the unix-timestamp, that's why I ask. I could not find a conversion function. Does anyone know something about this?

    As I opened the places.sqlite with an sqlite-editor I found out that firefox saves the last_visit_date via a timestamp which is 16 digits long. I realized that the first 10 digits are similar to the corresponding unix-timestamp but not equal. So.. how can i convert the firefox-timestamp into a normal date? Or into the corresponding unix-timestamp?

    Write a bash script or 'C' program to change the date format and then use the sql update function to receive the stdio output 'where date_field='embeded date value'.

  • Convert a String to java.sql.Date Format

    Hi,
    I am having a String of containing date in the format 'dd/mm/yyyy' OR 'dd-MMM-YYYY' OR 'mm-dd-yyyy' format. I need to convert the string to java.sql.Date object so that I can perform a query the database for the date field. Can any one suggest me with the code please.
    Regards,
    Smitha

    import java.text.SimpleDateFormat;
    import java.text.ParseException;
    import java.util.Date;
    public class TestDateFormat
         public static void main(String args[])
              SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
              System.out.println(sdf.isLenient());
              try
                   Date d1 = sdf.parse("07-11-2001");
                   System.out.println(d1);
                   Date d2 = sdf.parse("07:11:2001");
                   System.out.println(d2);
              catch(ParseException e)
                   System.out.println("Error format, " + e);
    See class DateFormat and SimpleDateFormat for detail.

  • Address (char type) to excel (date format)

    i have address 17-1-1 but after i export to excel it become date format.
    how do i solve this prob ?
    tks.

    As ssr has highlighted, this isn't a fault of Oracle but is standard functionality of Excel when importing data. Excel tries to intelligently look at the data and give the cell the correct format based on that data. Because your data looks like a date it assumes it is and will format it as a date according to your nationality settings on your PC.
    ssr suggested putting a quote before the data which is the correct thing to do.
    If the data is:
    '17-1-1rather than
    17-1-1Then excel sees the single quote and understands this to mean that you want the format of the data to be "text" rather than "date".

  • Date Formatting - Day and Month Switching Places

    I am starting to get really frustrated with this problem; at first it was just a nuisance, but now when I actually want and need to do something important with Numbers it has become a major headache.
    When I first select a formatting and enter a date it works fine. I enter, e.g., "1 Aug 2009" and Numbers formats it "1 August, 2009" as per my formatting selection. However, when I go to change the formatting to, e.g., "day of week, day month, year" my "1 August 2009" suddenly becomes "Thursday, 8 January, 2009" - it switches the day and month values around! This happens no matter which format I choose, and no matter what I do - whether I enter the day first or month first, American or European - it always switches them around when I go to change the format. It's infuriating!
    Does anyone have any suggestions? What am I to do?

    Welcome to Apple Discussions
    I believe the problem is that you have US formats for dates. Select the cells/columns that you want your date format to apply to then click the cell format inspector (the 42 in a box icon) & choose Custom… from the cell format drop-down. You will be presented with a box that allows you to make your own format. Click & hold on any of the little "lozenges" in the input bar & move them around. You may need to add a space to get the proper result.

  • Mailman - bounced "data format error" - Mailbox does not exist

    Hi gurus,
    All my mailing lists works great, except one of then...
    Its said: a lot of messages like this, several times:
    Mar 6 07:08:33 rossellimac postfix/pipe[2931]: 3F55D15F892: to=<[email protected]>, orig_to=<[email protected]>, relay=cyrus, delay=0.11, delays=0.04/0/0/0.07, dsn=5.6.0, status=bounced (data format error. Command output: alejandro: Mailbox does not exist )
    Also this error:
    3/6/09 8:18:20 AM lmtpunix[4844] AOD: user opts: get attributes for user: alejandro failed with error: -14479
    3/6/09 8:18:20 AM lmtpunix[4844] warning: unable to post message for user: alejandro, mail is not enabled for this user
    The computers halt for a minute... when I send an email to this list (general@) where "alejandro is a user"
    Please, some advice... I surf the web... and not always produce error...
    Thanks in advance.
    Message was edited by: alopezruiz

    ok

  • Date format accepted in new table but not in active table for DSO, BI 7.0

    Hi All,
    Need help from the experts, i was trying to load Flate file data in CSV(Coma separated) and cell type general for dates(yyyymmdd). everything was fine i have a routine for new fields in DSO for Fiscal week and Fiscal Quater which is calculating based on my Flate file date i.e delivery date(yyyymmdd).
    The New table of DSO means before activation everything was fine and all the logics and mappings working for the Fiscal week and Fiscal Quater and that can be visible, But after activation the same only the Fiscal week and Fiscal Quater is not showing data, its comming as blank and '000000' for all records.
    As the Fiscal week and Fiscal Quater is maintained as custmised InfoObject with data type NUM.
    Can you tell what i am missing, because i tried with different cell type also in CSV File.
    Thanks and Regards,
    Taps
    Edited by: Taps on Oct 1, 2010 1:21 PM

    Resolved...!!!
    Follow the link ...
    /people/maheshsingh.mony5/blog/2010/09/24/update-behavior-of-end-routine-in-transformations
    Regards,
    Taps
    Edited by: Taps on Oct 1, 2010 2:02 PM

  • Convert AS400 integer number to a date format MM/DD/YYYY

    Hi
    I need a formula for converting AS400 numeric date that is in this format 1110101 CYYMMDD to this format 01/01/2011
    I am using crystal reports 2008
    Thanks Fred

    This should do the trick...
    Local StringVar x := ToText({@AC Date}, "0");
    Local NumberVar c := (ToNumber(LEFT(x, 1)) + 1) * 10;
    x := RIGHT(x, 6);
    Local NumberVar y := ToNumber(ToText(c, "0") & LEFT(x, 2));
    x := RIGHT(x, 4);
    Local NumberVar m := ToNumber(LEFT(x, 2));
    x := RIGHT(x, 2);
    Local NumberVar d :=ToNumber(x);
    Dateserial(y,m,d)
    HTH,
    Jason

  • How to insert a record with date format field

    I tried to execute the query of the below but it showed error and hence i did research and found out i can add a date syntax in front to format it properly.
    INSERT INTO EMP (EmpNo, EmpName, Sex, DateOfBirth, Salary, DeptNo)
    VALUES ('E001', 'Alex', 'M', '2006-11-08', '1500', 'D001');
    When i executed the following query under SQL plus environment, it hang and gave no response. May i know how to solve this problem? Thank you
    INSERT INTO EMP (EmpNo, EmpName, Sex, DateOfBirth, Salary, DeptNo)
    VALUES ('E001', 'Alex', 'M', DATE '2006-11-08', '1500', 'D001');

    Normally when we execute a query, it will show the result or response whether it is fail or success or what the error message is. But my situation is that it showed nothing and no response, and cannot execute new query, i cant do anything under that environment and i can only off it by using end task.

  • Some data DVD's and External Hard Drives not recognized by Leopard only.

    1] Some data DVDs that were burned under Tiger do not show up in Leopard. Only a dialog box asking what I want to do with the blank DVD comes up when I insert the disk. On my Tiger computer, the disk shows up perfectly fine. It is a DVD+R being used on a MBP 2ghz... and was burned on that very machine in Tiger and would load fine in Tiger. Now nothing on the same computer in Leopard. I'm going to reburn the disk on my Mac Mini on a DVD-R, but still wanted to know any ideas or input as to why it won't recognize the disk.
    2] I also have an external USB2.0 HD. I formatted the disk using my G4 Mac Mini (which has Tiger) and it is not recognized on my MBP. In Disk Utility I try to reformat the drive, but it says that it cannot do so because the "resource is busy". I plug the drive back into the mac mini and it works perfectly fine. Why would this be and how do I correct it?
    Full updates on both OS's. No other problems with either computer that I know of.

    Unfortunately, commercial DVDs that you have bought 99.9% of the time will be copy protected and Apple's forum terms prohibit discussion of circumventing the copy protection.  In various places circumventing digital copy protection is potentially illegal even if you own and intend to keep the DVD.  Hence Apple do not wish DVD rippers etc discussed here.
    Another problem is that AppleTv cannot play back DVDs copied to an external drive as it does not understand the format.  So even if you can 'copy' your DVDs you then need to convert to h264 format to play on AppleTV.
    Video formats for AppleTv are limited.  They also do not support DVD like menu structures (thogh AppleTV 1 did with itunes Extras movies).
    If you have unprotected video you wish to convert eg home video on DVD, then something like Handbrake or MPEGStreamclip with Apple's MPEG2 component might do the job.  These programs are not DVD rippers but can process unprotected MPEG2 video.
    AC

  • Data Manager Packeage and Process chain si not working

    Hi All,
    I executed a data manager package which contain a process chain to revaluate the one of my Account dimension meneber Say  "Revenue". I am working on BPC NW 7.0
    steps I followed:
    1. I created a script logic file and created a custom process chain.
        process chain steps:
      a) Start variant
      b) Modify dynamically
      c) Run Logic
      d) Or and Clear BPC tables
    2. This process chain was included in data manager package.
    3. Data manager package was modyfied to include parameters and scipt logic file name.
    4. executed data package
    The issue is " when I execute Data manager Package" I dont get any error but when I View status I dont see any pachage running or completed. If I see Process chain, It is failing at first step of Modify dynamically..no clue?
    Could you please let me know what could be a issue?
    Cheers,
    SAC

    I encounter this problem, Do this Steps:
    I. First,check if your process chain is existing in the Library.
    II.If yes,follow the steps below:
    1. Edata - organize Package - Modify your Package.
    2.Check if you had the correct process chain.
    3.IF yes, Click View package at its right side.
    4.Expand the Task Folder and take note of the Task Name (e.g. ZBPC_PROT_RUN_LOGIC)
    5.click Advance,Compare the task name that you noted in the syntax TASKS
    (e.g. TASK(ZBPC_PROT_CF_RUN_LOGIC,SUSER,%USER%)
    6. It should be the same.
    Running package but not appearing any status happens when the system cannot find your process chain.
    hope this helps,

  • When does Date Modified field update in cmc  XI3.1

    In CMC > users and groups
    there is a Date Modified field, When does it update? Is there any document describe that?
    For example
    I have test that when I edit a user's properties the Date Modified fields update.
    When a user log onto CMC, some time the logon times is update as Date Modified
    some times is not? Why does this happen?

    Hello,
      If you update the the properties of the group or the user then the last modified date will change to the current date/time.  What kind of user do you have, Enterprise, Windows NT, Windows Active Directory or LDAP.  Sometimes a user doesn't exist until they actually log on to the CMS then their Last Modified date would change.  Have you consistantly seen this happen with a specific user, if so can you reproduce this on demand.
    Jorge

  • Converting given data to date format

    Hi
    I have one date field in forms and i want to convert the string into a valid date format whenever i pressed the tab.When i enter 1jan07 it should convert into 01-JAN-2007 when i press the tab.I tried the following code but its not working.I changed the format mask but no use
    select to_char(to_date(:DATA.BDATE,'DDMMYY'),'DD-MON-YYYY') into :DATA.BDATE from dual
    rgds
    shrey

    Hi Shrey,
    I have checked in one of my form with the format mask DD-MON-RRRR and its working fine.
    confirm whether the field is a Date field or a char???
    Regards

Maybe you are looking for

  • My computer always gets "restarted because of a problem." What should I do?

    Hi guys! So I got my Mac about a couple of years ago and it's been having problems lately! The biggest is probably it restarting unexpectedly. I did a clean restore just a few weeks ago and there's nothing in it now; however it still does it! I'm afr

  • XP via RIS installation on 32 Satellite Pro A200 laptops

    Hi, Can anyone help? I'm trying to install 32 laptops (Satellite Pro A200) via Windows 2003 Server Remote Installation Services. I've got past the problems with network cards and now have these working by adding the drivers into a $OEM$, $1, Drivers,

  • My sent mail will not open anymore

    I have removed a lot of sent messages(8000>3000) and my sent folder will not open anymore. For a couple of times I opened my Thunderbird but no respons. The cursor is still turning cirkels. What can you suggest? Thanx in advance Kees

  • How to valuate special stock E

    Dear all, we don't use production. We create a sales order for a ROH material and then we create a purchase order with account category assignment M. When we post the good receipt an FI document is created (Raw material Purchasing  vs Invoice receiva

  • Why Firefox doesn't support alt symbols with long codes?

    For example, I try to type symbol 'ґ' using Alt+1169. But instead of this I see char 'С' (cyryllic). Also I noticed that (e.g.) Alt+1 = Alt+257, Alt+2 = Alt+258, etc, i.e. cyclically. Opera has not such problem. Thanks.