Problem in to_char function

hi,
when i am using select to_char(sysdate,'dd.mm.yy') from dual* then its giving the right answer 27.09.10.
but when i am replacing the sysdate with the particular date format of oracle that is select to_char('27-Sep-10','dd.mm.yy') from dual* then its throwing error.
My question is that dd-Mon-yy* is the default oracle date format. then if i replace sysdate+ by that format then why the error is thrown???
please help me out.
thanks.

user12780416 wrote:
hi,
when i am using select to_char(sysdate,'dd.mm.yy') from dual* then its giving the right answer 27.09.10.
but when i am replacing the sysdate with the particular date format of oracle that is select to_char('27-Sep-10','dd.mm.yy') from dual* then its throwing error.
My question is that dd-Mon-yy* is the default oracle date format. then if i replace sysdate+ by that format then why the error is thrown???
please help me out.
thanks.Because you are asking to to_char a character.
If you want to get a specific format out of an existing DATE data type (for display purposes) you would need to have a DATE to begin with.
TUBBY_TUBBZ?select to_char('27-Sep-10','dd.mm.yy') from dual;
select to_char('27-Sep-10','dd.mm.yy') from dual
ERROR at line 1:
ORA-01722: invalid number
Elapsed: 00:00:00.81
TUBBY_TUBBZ?select to_char(to_date('27-Sep-10', 'dd-mon-yy') ,'dd.mm.yy') from dual;
TO_CHAR(TO_DATE('27-SEP-
27.09.10
1 row selected.
Elapsed: 00:00:00.85
TUBBY_TUBBZ?In your case.

Similar Messages

  • Need help in to_char function

    Hi All,
    I'm using below sql query to get sysdate with time stamp.
    select to_char(sysdate,'YYYYMMDD HH24:MM:SS') from dual
    This gives me below result:  20130816 05:08:49
    Strangely, when I keep on running the same query, I notice after 60 seconds are complete, time stamp starts with  20130816 05:08:01 again.
    Am i missing something here..
    Thanks in advance

    Karthick_Arp wrote:
    Keep a simple thing in mind. Date stored in the DB does not have any format. Format need to be applied while you display. The default date format is specified by the NLS_DATE_FORMAT parameter. You have used TO_CHAR to display date in a specific format. But the problem is that you have converted DATE into string. So if its just for display purpose then set the NLS_DATE_FORMAT, do not use TO_CHAR.
    With respect to your issue You need to represent Minute as MI. You have represented it as MM (Month) That's why you see 08 always.
    " the problem is that you have converted DATE into string"
    No, the problem was that he was explicitly using an incorrect format mask, specifying months where he should have specified minutes.
    The problem inherently cannot be the result of converting a DATE into a string.  Dates are always converted to strings for presentation, either implicitly by using the controlling setting of NLS_DATE_FORMAT (which can be set at several levels) or explicitly by using the to_char function.  Oracle will always convert.  It has to.  Internally, a date is binary gibberish.  But computer screens and printers can only show strings of characters, so the DATE will be converted to a character string, by hook or by crook.  And the method of oracle making that conversion is exactly the same.  The only thing that varies is how the user chooses to make that specification.  And "not choosing" (by not using the to_char function) is still choosing ... choosing to rely on nls_date_format.

  • Problem in  using function module parameters in abap program

    i want to use the coding present in on one of the function module 'AS_API_INFOSTRUC_FIND'  i got the problem using the function module parameters in my abap program.
    these are the parameters inside fm
    ""Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(I_FIELDCAT) TYPE  AIND_FCAT
    *"             VALUE(I_FIELDS) TYPE  TABLE OPTIONAL
    *"             VALUE(I_OBLIGATORY_FIELDS) TYPE  TABLE OPTIONAL
    *"       EXPORTING
    *"             VALUE(E_INFOSTRUC) TYPE  AIND_DESC
    *"             REFERENCE(E_ALL_FIELDS) TYPE  TABLE
    *"             REFERENCE(E_MATCHING_FIELDS) TYPE  TABLE
    *"       EXCEPTIONS
    *"              NO_INFOSTRUC_FOUND
    i want to declare     E_ALL_FIELDS  parameter    in my abap program,
    i have declared as 
    data: E_ALL_FIELDS TYPE TABLE.
    but   the system throws error that
    'type of field 'TABLE'  is generic .no table line has been specified'.
    i want to use it in my abap program how can i declare in my abap program .

    You have to declare the table using any specific type.
    The type table in the FM is generic so you can pass any type you need.
    For instance:
    TYPES: BEGIN OF ty_fields,
             fieldname LIKE dfies-fieldname,
           END OF ty_fields,
    TYPES: TY_T_GLU1              LIKE GLU1                     OCCURS 0,
           ty_t_fields            type ty_fields                occurs 0.
      DATA: lt_info_struct_fields TYPE ty_t_fields WITH HEADER LINE,
            lt_matching_fields    TYPE ty_t_fields WITH HEADER LINE.
        CALL FUNCTION 'AS_API_INFOSTRUC_FIND'
             EXPORTING
                  i_fieldcat         = ft_fieldcat-fieldcat
                  i_fields           = ft_fields_filled[]
             IMPORTING
                  e_infostruc        = lv_info_struct_name
                  e_all_fields       = lt_info_struct_fields[]
                  e_matching_fields  = lt_matching_fields[]
             EXCEPTIONS
                  no_infostruc_found = 1.

  • Reg: error while converting a date datatype to the char using TO_CHAR function.

    Hello all,
    I'm trying to convert a date datatype to the specified format (i.e., by using vaariable using the to_char function in my sql,
    SQL:
    select 0 dummy,'select' from dual
    union all
    select a.COLUMN_ID dummy,
    (case a.DATA_TYPE when 'NUMBER' then '''''' || '||' || a.COLUMN_NAME || '||'',''||'
                      when 'DATE' then '''"''' || '||' || TO_CHAR(a.COLUMN_NAME,'&dateformat') || '||' || '''",''' || '||'
                      else '''"''' || '||' || a.COLUMN_NAME || '||' || '''",''' || '||'
                end)
    from DBA_TAB_COLUMNS a
    where a.OWNER = upper('&owner_name')
    and a.TABLE_NAME = upper('&table_name')
    union all
    select 998 dummy,''' ''' from dual
    union all
    select 999 dummy,'from &owner_name..&table_name;' from dual
    order by dummy
    error:
                      when 'DATE' then '''"''' || '||' || TO_CHAR(a.COLUMN_NAME,'DD-MM-YYYY') || '||' || '''",''' || '||'
    ERROR at line 5:
    ORA-01722: invalid number
    Please help me in resolving this, Thanks in advance.
    Regards,
    Konda.

    > ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests. (12204)
    This seems to be your specific network configuration.  It seems that your corporate network is blocking HTTPS requests which don't use port 443. Your ABAP system is configured to use a port other than 443. Either talk to your basis admins about changing your ABAP system configuration to use port 443 or talk to your network administrators to allow whichever port the ABAP system is running on.

  • Behaviour of to_char function in sqlplus versions 8.1.6.0.0 and 9.0.1.3.0 .

    Behavior of to_char function in sqlplus versions 8.1.6.0.0 and 9.0.1.3.0:
    Hello,
    We are migrating our apps between different environments and we observed the following behaviour:
    When using the command select to_char(sysdate,'D') from dual, this gives out a value of 4 in sqlplus version 8.1.6.0.0 (win NT). The same command gives out a value of 3 in sqlplus version 9.0.1.3.0 (win XP).
    The underlying software is Oracle Enterprise Edition Release 8.1.7.4.0 in both the cases. Why this difference in behaviour? Can anyone please advise me.
    regards,
    Srikanth

    The first day of week depends on the globalization parameter NLS_TERRITORY. Set it for the instance or for the session to AMERICA to get the week start on sunday. You can also set this in the NLS_LANG os variable (export NLS_LANG=american_germany.we8iso8859p1)
    SQL> alter session set nls_territory='germany'
    SQL> select to_char(sysdate, 'Day D') from dual;
    TO_CHAR(SYS
    Wednesday 3
    SQL> alter session set nls_territory='america';
    SQL> select to_char(sysdate, 'Day D') from dual;
    TO_CHAR(SYS
    Wednesday 4Kind regards
    Laurent Schneider
    OCM-DBA

  • To_char function help

    Hi All,
    I have run this query in my oracle database
    SELECT
    J.NAME,
    (CASE J.STATUS WHEN 'Completed' THEN COUNT(J.STATUS) ELSE 0 END) CURRENT_MONTH_COMPLETE,
    (CASE J.STATUS WHEN 'Pending for Process Engine' THEN COUNT(J.STATUS) ELSE 0 END) CURRENT_MONTH_IN_PROGRESS
    FROM
    CMN_SCH_JOBS_V J
    WHERE
    J.STATUS IN ('Completed','Pending for Process Engine') AND J.LANGUAGE_CODE='en'
    and to_char(J.START_DATE,MM')=12
    GROUP BY J.NAME,J.STATUS;I have a doubt regarding this
    to_char(J.START_DATE,MM')=12Basically to_char() function returns a string value, but when it is equated against a numeric value oracle should raise an error right, this query is running fine. Please tell why this is happening.
    Regards
    Praveen Vuppalapati

    What a strange query. I'd expect it to be either:
    SELECT
    J.NAME,
    J.STATUS
    COUNT(*)
    FROM
    CMN_SCH_JOBS_V J
    WHERE
    J.STATUS IN ('Completed','Pending for Process Engine') AND J.LANGUAGE_CODE='en'
    and to_char(J.START_DATE,MM')=12
    GROUP BY J.NAME,J.STATUS;... or ...
    SELECT
    J.NAME,
    SUM(CASE J.STATUS WHEN 'Completed' THEN 1 ELSE 0 END) CURRENT_MONTH_COMPLETE,
    SUM(CASE J.STATUS WHEN 'Pending for Process Engine' THEN 1 ELSE 0 END) CURRENT_MONTH_IN_PROGRESS
    FROM
    CMN_SCH_JOBS_V J
    WHERE
    J.STATUS IN ('Completed','Pending for Process Engine') AND J.LANGUAGE_CODE='en'
    and to_char(J.START_DATE,'MM')=12
    GROUP BY J.NAME;Ought to wrap the to_char() in a to_number as well, really.

  • Error thread java : problem with the function "resume 0x***"  (forum sun)

    One problem with the function of jdb occured when I tried to use it to
    pilot the processor with differents threads. In fact, I use a simple example with 2 threads.
    I stop the two threads with two breakpoint, and I want to resume one or the other (with the function "resume 0x****"), the one wich I resumed stop again on the breackpoint and I decide again to resume one or the other. All of that to obtain a tree of execution.
    I give you the code of the class and the code of jdb.
    CLASS: (it's just a object Room with a variable degre that I increment and decrement with two threads increase and decrease)
    public class Test{
         public static void main(String[] args){
              Room r = new Room();
              decrease de = new decrease(r);
              increase in = new increase(r);
              de.start();
              in.start();
    class Room {
         private volatile int degre=20;
         public void more(){
         degre += 4;
         public void less(){      
         degre -= 3;
    class decrease extends Thread{
    private Room room;
    public decrease(Room r){
              room =r;
    public void run(){
    try{ 
         while (!interrupted()){ 
              room.less();
    catch(InterruptedException e) {}
    class increase extends Thread{
    private Room room;
    public increase(Room r){
         room =r;
    public void run(){ 
         try{ 
              while (!interrupted()){
                   room.more();
    catch(InterruptedException e) {}
    JDB:
    Initializing jdb ...
    stop at Test:7Deferring breakpoint Test:7.
    It will be set after the class is loaded.
    runrun Test
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Set deferred breakpoint Test:7
    Breakpoint hit: "thread=main", Test.main(), line=7 bci=30
    7 in.start();
    main[1] stop at room:16
    Set breakpoint room:16
    main[1] stop at room:20
    Set breakpoint room:20
    main[1] resume
    All threads resumed.
    >
    Breakpoint hit: "thread=Thread-0", room.less(), line=20 bci=0
    20 degre -= 3;
    Thread-0[1] threads
    Group system:
    (java.lang.ref.Reference$ReferenceHandler)0x10d Reference Handler cond. waiting
    (java.lang.ref.Finalizer$FinalizerThread)0x10c Finalizer cond. waiting
    (java.lang.Thread)0x10b Signal Dispatcher running
    Group main:
    (decrease)0x146 Thread-0 running (at breakpoint)
    (increase)0x147 Thread-1 running (at breakpoint)
    (java.lang.Thread)0x148 DestroyJavaVM running
    Thread-0[1] resume 0x147
    Thread-0[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] print degre
    degre = 24
    Thread-1[1] resume 0x146 //It's here the problem, thread 0x146 have to stop on the //next breakpoint of decrease but nothing happen
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] clear
    Breakpoints set:
    breakpoint Test:7
    breakpoint room:16
    breakpoint room:20
    PS: I tried many other examples with other class and other kind of breakpoints, but, in any cases, on thread doesn't manage to resume. When I try with general resume (no specification of the thread), It works but it isn't interresting for me because I want to decide wich thread continue his execution.

    Hi,
    I have read the FAQ of the JMF.
    The problem was the jar files of the JMF were not in the JRE\BIN\EXT
    folder of the Java runtime!
    now it works!
    thanks
    Reg

  • Problem using two function based indexes at once!

    Hello Oracle!
    I've got problems using two function based indexes on geometries at once.
    The problem occures, when I use a spatial join between two geometries both using function based indexes.
    The test case:
    CREATE TABLE quad (centroid NUMBER);
    CREATE TABLE points (no NUMBER, point MDSYS.SDO_GEOMETRY);
    CREATE OR REPLACE FUNCTION getQuad (centroid NUMBER) RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC IS
    BEGIN
    RETURN MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(centroid-5,centroid-5,centroid+5,centroid-5,centroid+5,centroid+5,centroid-5,centroid+5,centroid-5,centroid-5));
    END;
    INSERT INTO USER_SDO_GEOM_METADATA VALUES('quad','tiedge.getQuad(centroid)',MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X', -100, 100, .0000001), MDSYS.SDO_DIM_ELEMENT('Y', -100, 100, .0000001)),NULL);
    CREATE INDEX quad_idx on quad(getQuad(centroid)) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    INSERT INTO quad VALUES (0);
    INSERT INTO quad VALUES (5);
    INSERT INTO quad VALUES (10);
    INSERT INTO points VALUES (1, MDSYS.SDO_GEOMETRY(1001,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1),MDSYS.SDO_ORDINATE_ARRAY(4,4)));
    ALTER SESSION SET QUERY_REWRITE_INTEGRITY=TRUSTED;
    ALTER SESSION SET QUERY_REWRITE_ENA[i]Long postings are being truncated to ~1 kB at this time.

    hi there,
    For a better audience for this question, I'd look at the database forum.
    guys on that will be a lot more familiar with FBIs
    thanks
    Barry

  • TO_CHAR FUNCTION IN ORACLE FORM

    HI,
    Table called A has column name col1
    col1
    12563.563
    52685.563
    05263.540
    I would like to use SUBSTR(col1,2,6) for insert values from A table to B table by Oracle form and following values are inserted in B table
    2563.5
    2685.5
    263.4
    If I use SQLPLUS it is inserting as my requirement like
    2563.5
    2685.5
    5263.4
    Third row should be 5263.5 instead of 263.4. In Oracle form may have internal coversion function to convert character value to number values, I do not want to convert the value to number. Both table columns are varchar2 column.
    What is the equal to_char function in Oracle form. If it is NLS_NUMERIC_CHARACTERS, please what are the parameters to be passed along with column.
    Thanks in advance
    Saravanan.

    Hello,
    If you don't want to take account any calculation on the decimal part, you could consider the Trunc() function instead of the To_Char():
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> select to_char(52685.563,'00000000.0'), trunc(52685.563,1) from dual
      2  /
    TO_CHAR(526 TRUNC(52685.563,1)
    00052685.6            52685.5
    SQL> Francois

  • Problem using LIKE function

    Hi Guyz,
    I am having small problem using LIKE function . The problem is I am using LIKE function in the WHERE clause
    to compare a column to a particular value, which gets this value from the front end. If the user has a single quote in the string he entered then the LIKE function is not working because of the single quote. Is there any way I can escape the single quote like we escape '%' and '_'.
    Thankyou.

    Mod_plsql supports bind variables, as do almost all front-end tools that deal with Oracle (and most other databases). I do not code mod pl/sql myself, but others here do, and I see bind variables in their code all the time (if I don't, they hear from me :-)).
    If you pass a bind variable, the quote problem goes away. As far as I know (which is not very far), you should be able to take the string with the quote directly from your input field, bind it to the variable in your query and have no problems.
    I suspect that the reson you are having issues is that you are just gluing strings together to create a sql statement. this is the wrong approach.
    The java term for what you are looking for is prepared statement, I'm not sure what the equivalent is i mod plsql, but that should give you a start.
    John

  • Problem with renameTo function

    Hello !
    I hava got a problem on renameTo function. I can rename the short file name (for example: REPORT.TXT to REPORT.ERR), but I can't rename the long file name (for example: XXX_REPORT_20040125.TXT to XXX_REPORT_20040125.ERR). The following codes I have been used :
    File f1 = new File("c:\\sunny\\data\\interfaces\\XXX_REPORT_20040125.TXT");
    File f2 = new File("c:\\sunny\\data\\interfaces\\XXX_REPORT_20040125.ERR");
    f1.renameTo(f2);
    Thanks.

    JDK version? 1.1.8? 1.2.2? 1.3.1? 1.4.2? else?
    Windows version? 3.11? 95? 98? 98SE? ME? NT 4? 2000? XP? 2003? else?

  • Problem with 'GetType' Function calling in MSVC++

    Hello
    I have problem with the function in TestStand API .
    When I call the function " GetType " with the following statements in
    a DLL called from TestStand (NI) implemented in MS VC ++
    , it does not work and this exception is caught by the ONLY ' try catch ' block
    to catch exceptions in TestStand API giving the error message
    " Unexpected operating system error".
    VARIANT_BOOL ok;
    VARIANT_BOOL hi;
    BSTR Name;
    PropertyObject *property = (*step_)->AsPropertyObject();
    ( *step_ is a STEP Object of type Step* *step_ )
    property = property->GetPropertyObject( "TS.SData", 0);
    enum TS:ropertyValueTypes i = property->GetType( "" , 0 , &hi , &ok
    , &Name);//Problem
    Please solve my problem.
    You can email me at [email protected]
    Thankyou very much.
    Best regards
    Fahad Ejaz

    Hello,
    The problem is that the Name is not initialized (the BSTR is defined as OLECHAR*). Thus, replace the
    BSTR Name;
    declaration with the following lines:
    char buf[1024];
    BSTR Name = _bstr_t(buf);
    This should solve the problem.
    Best Regards,
    Silvius
    Silvius Iancu

  • Problem with CONTAINS function

    Hi all!!
    i got a problem with contains function. i'm running oracle 11g.
    if i execute this query:
    SELECT x.lid as id,  x.sztitular as titular, e.szname as proName, x.szresumen  as resumen, b.sztitle  as catName,
    f.szname  as secName, d.szname  as cliName, x.datecreation as datecreation
    FROM CPR_PRACTICAL_CASE x,ctg_category b, CPR_CLIENT d, pro_product e, CAT_SECTOR f, CPR_PCASE_PRODUCT g, CPR_PCASE_SECTOR h,
    PRO_PRODUCTCATEGORY i WHERE  x.lid = g.lpcaseid and e.lid = g.lproductid and x.lid = h.lpcaseid
    and f.lid = h.lsectorid and x.lclientid = d.lid and i.lproductid = e.lid and  b.lid = i.lcategoryid
    AND x.szlocale = 'es-ES' AND  x.bavailable = '1'i get 1 row as result with the column sztitular = "rodillos de medidas"
    if i only add one more sentece to that query:
    AND CONTAINS( x.sztitular, 'rodillos',1) >0the query returns an empty set.. i really don't understand why because the term "rodillos" is present in the row's column called "sztitular"...
    i've put an index on that column:
    create index ITXT_TITULAR on CPR_PRACTICAL_CASE(sztitular) INDEXTYPE IS CTXSYS.CONTEXT;any help?
    many thanks!!!!
    Edited by: ElMazzaX on May 21, 2012 5:51 PM
    Edited by: ElMazzaX on May 21, 2012 5:53 PM

    How are you synchronising the index?
    http://docs.oracle.com/cd/E11882_01/text.112/e24435/ind.htm#i1008452
    Also see the Oracle Text forum:
    Text

  • Problem facing in Function module.

    Hi friends,
    Happy New year to all.
    I am facing the problem while crating Function module.
    As my requirement:
    I need to call this Function module in SAP-BW application area. I am creating this in BW side(SE37).
    The intenal table which i am passing to the function module will vary. The structure is not constant.
    Data is flowing from one table(source table) to another table(Destination table) . In BW if we want to refer the data in source table in START ROUTINE while loading, we use SOURCE_PACKAGE internal table.
    1) I am passing Source_package internal table as ITAB_SOURCE_PACKAGE. (this source_package strucute also not canstant, it will vary)
    2) passing second internal table as ITAB1, this structure also vary. I will declare this structure before calling the function module.
    In Function module Table tab i given as
    PARAMETER       TYPE           Associated Type
    ITAB1                   LIKE           ANY     
    ITAB_SOURCE_PACK   LIKE      ANY
    In Import tab:
    SOURCEINFOOBJECT           pass value
    In source code i written as
    DATA: WA_SOURCE_PACK like line of ITAB_SOURCE_PACK.
    DATA: WA_ITAB1 like line of ITAB1.
    LOOP AT ITAB_SOURCE_PACK INTO WA_SOURCE_PACK.
      READ TABLE ITAB1 WITH KEY SOURCEINFOOBJECT = WA_SOURCE_PACK-SOURCEINFOOBJECT
      INTO WA_ITAB1.
      IF SY-SUBRC NE  0.
        WA_ITAB1-SOURCEINFOOBJECT = WA_SOURCE_PACK-SOURCEINFOOBJECT.
        INSERT WA_ITAB1 INTO TABLE ITAB1.
      ENDIF.
    ENDLOOP.
    (Note: this is piece of code)
    While checking i am getting as error
    Field "ANY" is unknown. It is neither in one of the specified tablesnor defined by a "DATA" statement. "DATA" statement. "DATA" statement.
    For this what i need to do.
    As i am not very good in ABAP, pls help me.
    Thanks & Regard
    MRK

    Hi,
    u have to do like this..decalre itab1 and ITAB_SOURCE_PACK in the tables parameter...
    so change like this
    In Function module Table tab do like this
    PARAMETER TYPE Associated Type
    ITAB1
    ITAB_SOURCE_PACK
    In Import tab:
    SOURCEINFOOBJECT pass value
    In source code i written as
    DATA: WA_SOURCE_PACK type ITAB_SOURCE_PACK.
    DATA: WA_ITAB1 type ITAB1.
    LOOP AT ITAB_SOURCE_PACK INTO WA_SOURCE_PACK.
    READ TABLE ITAB1 WITH KEY SOURCEINFOOBJECT = WA_SOURCE_PACK-SOURCEINFOOBJECT
    INTO WA_ITAB1.
    IF SY-SUBRC NE 0.
    WA_ITAB1-SOURCEINFOOBJECT = WA_SOURCE_PACK-SOURCEINFOOBJECT.
    INSERT WA_ITAB1 INTO TABLE ITAB1.
    ENDIF.
    ENDLOOP.
    Regards,
    Nagaraj

  • What is the use of To_date, to_char functions?

    what is the use of To_date, to_char functions?
    while i am using these in my day to day activities but never able to know the exact working of tehse.
    Message was edited by:
    437022

    Dates are stored and manipulated as coded (binary) values that always contain "century, year, month, date, hour, minute second"
    We don't want to see the date as stored. We want to see the characters (digits) that make up the date. So we use to_char(the-date-value)
    We want to tell the system a date, but have a heck of a time entering the binary. So we input the characters (digits) that make up the date and tell the system to convert that to a binary 'date' using to_date(our-string-that-respresents-dates)
    The magic Oracle has added is the format codes (see chapter 2 of the SQL Reference manual for the complete list). We can get the system to print out dates and times, including day of week (and so on) using format codes.
    The default format is to show us the date but not the time. Which leads a lot of people to believe that the time is not stored.

Maybe you are looking for

  • Driver Problem in Windows 8.1 pro

    Hello, I have a asus eee pc 1050cx laptop which had windows 7 starter. I upgraded it to windows 8.1 then I realized that metro is crashing and is because of the graphics driver. I need help to sort this out. I have Intel Atom CPU N2600 1.60 ghz. 

  • Why do eBay item listings no longer change colors after being viewed?

    Need some help with a problem – in the past, when I opened a specific listing on eBay, it changed color from blue to red when I got back out of the listing. As of late, they do not change and remain blue. As I do 20-30 music title searches daily, the

  • Dispacher and server0 is not started during NW2004s installation

    Hi, Dispacher and server0 is not started during NW2004s installation. SAPInst is stopped on the step of the 'Start java instance'. SDM is 'running' but dispacher and server0 is 'Starting framwork'. So I configured the some parameters via configtool b

  • JNI performance question

    I just wrote a C++ dll that mimicks the function of buffered reader. However, it is 3 times slower to perform the i/o operations using JNI than using Java's classes. Also, using the exact same code, the c++ is almost 2 times faster writing and almost

  • Photoshop Elements not working right after not using for several months?

    Have Photoelements #10 on this computer. Have been away, using #10 on another computer, now back and PhotoElements #10 is NOT working properly?