Current date of birth for my column is null getting error....

Hi All..
i am calucating the current date of birth for my column which is date field and accept nulls (cust_dob) in my table.
select cust_dob,Add_Months(
to_date(cust_dob, 'dd/mm/yyyy'),
Months_Between(
trunc(sysdate, 'year'),
trunc(to_date(cust_dob, 'dd/mm/yyyy'), 'yyyy')
) as current_dob from m_customer_hdr
when i execute my query in toad. it is showing the result. but when i scroll down to see data it thow error as
ORA-01858: a non-numeric character was found where a numeric was expected...
Thanks in advance..
Abdul rafi

What datatype is cust_dob datatype. Somehow I have a feeling it is DATE. If so, expression:
to_date(cust_dob, 'dd/mm/yyyy')Implicitly converts cust_dob to a string using session nls_date_format and then converts it back to date using 'dd/mm/yyyy' format. Now if NULL dob are fetched first, you might get something like:
SQL> ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-RR';
Session altered.
SQL> SET SERVEROUTPUT ON
SQL> BEGIN
  2      FOR v_rec IN (SELECT  TO_DATE(cust_dob,'mm/dd/yyyy') cust_dob
  3                      FROM  (
  4                             SELECT TO_DATE(NULL) cust_dob FROM DUAL UNION ALL
  5                             SELECT TO_DATE(NULL) cust_dob FROM DUAL UNION ALL
  6                             SELECT TO_DATE(NULL) cust_dob FROM DUAL UNION ALL
  7                             SELECT sysdate cust_dob FROM DUAL
  8                            )
  9                   ) LOOP
10        DBMS_OUTPUT.PUT_LINE('DOB = "' || v_rec.cust_dob || '"');
11      END LOOP;
12  END;
13  /
DOB = ""
DOB = ""
DOB = ""
BEGIN
ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at line 2So if column CUST_DOB is DATE, use:
select cust_dob,Add_Months(
cust_dob,
Months_Between(
trunc(sysdate, 'year'),
trunc(cust_dob, 'yyyy')
) as current_dob from m_customer_hdrSY.

Similar Messages

  • I cannot share photos with anyone ,for i select someone i get error code 400.

    I cannot share photoss with anyone for when ii try to select someone i get a error code 400.

    Version  9
    "domnic.rj23" <[email protected]> wrote:
    domnic.rj23 http://forums.adobe.com/people/domnic.rj23 created the discussion
    "Re: I cannot share photos with anyone ,for i select someone i get error code 400."
    To view the discussion, visit: http://forums.adobe.com/message/5781697#5781697

  • When I try to install the 'GOOD for enterprise" app, I am getting error 0x100001 during retireve settings step. I followed the step of reloading the OS to fix this as suggested in another thread but even after that I have the same problem. Please help.

    when I try to install the 'GOOD for enterprise" app, I am getting error 0x100001 during retireve settings step. I followed the step of reloading the OS to fix this as suggested in another thread but even after that I have the same problem. Please help.
    Regards,
    Nagarajan Kadhiresan

    if you using the same port, maybe this issue caused by your kingmax
    to make it fast, try your king max at other PC, if cant detect, please reformat your king max

  • Current date as deafult for Calender Day and user entry

    Hello All,
    There is a select option for Calender Day for a BW query.
    This Calender Day should have a default as Current Date and User entry is also possible.
    I have used a Customer exit and written the following code under i_step = 1
    data: v_currdt like sy-datum.
    clear: v_currdt, vfl_range.
             if i_step = 1.
              vfl_range-sign = 'I'.
              vfl_range-opt = 'EQ'.
              v_currdt = sy-datum.
              vfl_range-low = v_currdt.
              append vfl_range to e_t_range.
             endif.
    Please inform if this code is incorrect, because I am not able to see the date at all.
    Cheers,
    KP

    Hi
    Check with this code!
    Implemented for the same function as you require.-
    if i_step = 1.
      case i_vname.
        WHEN 'ZZZZZZ'.
          IF i_step = 1.
            REFRESH e_t_range.
            CLEAR l_s_range.
            l_date1 = sy-datum.
            L_S_RANGE-LOW = l_date1.
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT  = 'EQ'.
            APPEND L_S_RANGE  TO E_T_RANGE.
          endif.
      endcase.
    endif.
    Regards
    M.A

  • Modify DATE format only for a column

    DB table has two or more columns of DATE type of which a column representing "Date of Birth" should not be of the format of TIMESTAMP . When queried it should return "mm/dd/yyyy" format without 'hh:mm:ss' . The others should be as usual.
    This is to ensure no changes in the applications querying this columns
    Any hints appreciated
    Thanks

    It depends on NLS_DATE_FORMAT and NLS_TIMESTAMP_FORMAT that is set in the database or session and the datatye used in the table, here is an example:-
    U1@BABU>  CREATE TABLE TEST_TAB (DATE1 DATE, DATE2 TIMESTAMP);
    Table created.
    U1@BABU> INSERT INTO TEST_TAB VALUES (SYSDATE,SYSDATE);
    1 row created.
    U1@BABU>  COMMIT;
    Commit complete.
    U1@BABU> SELECT * FROM TEST_TAB;
    DATE1 DATE2
    22-DEC-06 22-DEC-06 11.44.18.000000 AM
    U1@BABU> SELECT * FROM NLS_SESSION_PARAMETERS;
    PARAMETER                      VALUE
    NLS_LANGUAGE                   AMERICAN
    NLS_TERRITORY                  AMERICA
    NLS_CURRENCY                   $
    NLS_ISO_CURRENCY               AMERICA
    NLS_NUMERIC_CHARACTERS         .,
    NLS_CALENDAR                   GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE              AMERICAN
    NLS_SORT                       BINARY
    NLS_TIME_FORMAT                HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY              $
    NLS_COMP                       BINARY
    NLS_LENGTH_SEMANTICS           BYTE
    NLS_NCHAR_CONV_EXCP            FALSE
    17 rows selected.
    U1@BABU> ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';
    Session altered.
    U1@BABU> SELECT * FROM TEST_TAB;
    DATE1 DATE2
    22-DEC-2006 11:44:18 22-DEC-06 11.44.18.000000 AM
    U1@BABU> SELECT TO_CHAR(DATE1,'MON-DD-YYYY HH24:MI:SS') DATE1, TO_CHAR(DATE2,'Month DD YYYY') DATE2
    FROM TEST_TAB;
    DATE1                DATE2
    DEC-22-2006 11:44:18 December  22 2006

  • Getting current date and timestamp for timezone

    I am getting the current date and timestamp using
    Date d = new Date();
    On the platform I'm using it is returning it in GMT time.
    I want to convert this into Eastern Time Zone for United Status.

    java.util.Date objects contain a count of milliseconds since the "epoch", which happens to be midnight, Jan 1 1970 GMT. However, they aren't intrinsically "in" any timezone.
    If you simply call Date.toString(), you'll get the date formatted for the current locale, including timezone.
    If you want a different format, you can use the DateFormat or SimpleDateFormat classes (recommended), or use Calendar to pull the various date components out. You have to physically set the timezone for each of these.
    To get a list of timezones supported by your machine, you can run this program:
    import java.util.Arrays;
    import java.util.TimeZone;
    public class TZDump
        public static void main(String[] argv)
        throws Exception
            String[] zones = TimeZone.getAvailableIDs();
            Arrays.sort(zones);
            for (int ii = 0 ; ii < zones.length ; ii++)
                System.out.println(zones[ii]);
    }And, here's a program that lets you compare the same date in different timezones:
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.TimeZone;
    public class TZDemo
        public static void main(String[] argv)
        throws Exception
            SimpleDateFormat fmt = new SimpleDateFormat("MM/dd/yy HH:mm:ss");
            Date now = new Date();
            System.out.println("Default TZ = " + fmt.format(now));
            String[] zones = new String[] { "EST", "EST5EDT", "PST"};
            for (int ii = 0 ; ii < zones.length ; ii++)
                fmt.setTimeZone(TimeZone.getTimeZone(zones[ii]));
                System.out.println("EST        = " + fmt.format(now));
    }

  • Need to show a data in weeks for stacked column

      I need to show the data broken down in weeks if you choose the start date and end date.   I have to show in a stacked column chart. I am trying to show the values if you choose for example last month i need to show it by weeks for example 
    week    user name   total approved first approved    last aprovedDate  totalitemsAdded
    week 1   XYZ                 3                10/01/2012       10/05/2012         5
    week2   XYZ                  5                 etc                      etc            
      etc
    week 3 
    Below is the code and the result  i am getting now . 
    Current Results
    UserName TotalApproved
    FirstApprovedDate LastApprovedDate
       TotalItemsAdded
    XYZ            9
               2011-11-19 16:56:49.960
         2011-11-19 18:18:20.783
                   2
    DECLARE @StartDate DATETIME
    DECLARE @EndDate DATETIME
    SET @StartDate = '10/1/2012 '
    SET @EndDate = '10/31/2012'
    ;with Items as(
           SELECT
                  UserName = Profile.Description,
                  TotalItems = COUNT(TransactionID),
                  FirstAddedDate = MIN(UTCDate),
                  LastAddedDate = MAX(UTCDate)
           FROM Transactiondatabase.dbo.transaction
                    JOIN Biography.dbo.Profile ON transaction.ProfileId = Profile.ProfileID
           WHERE 
                  Data like '%ItemAdded%'
                    AND UTCDate BETWEEN @StartDate AND DATEADD(dd,1,@EndDate)
           GROUP BY
                  Profile.Description 
    Approved as
           SELECT 
                  UserName = Profile.Description,
                  TotalApproved = COUNT(TransactionID),
                  FirstApprovedDate = MIN(UTCDate),--Demo
                  LastApprovedDate = MAX(UTCDate)                 
           FROM Transactiondatabase..transaction
                    JOIN Biography.dbo.Profile ON transaction.ProfileId = Profile.ProfileID
           WHERE 
                  Data like '%Approved%'
                    AND UTCDate BETWEEN @StartDate AND DATEADD(dd,1,@EndDate)
           GROUP BY
                    Profile.Description
    Select Distinct Approved.*, TotalItemssAdded = sum(distinct Items.TotalItems)
    from Items, Approved  
    Group by Approved.UserName, Approved.FirstApprovedDate, Approved.LastApprovedDate, Approved.TotalApproved
    using ssrs 2005 

    Hi Sunny04,
    If I understand correctly, you want to display the data by weeks in a stacked column chart. If in this case, we can add a calculated field named week to display the week name, and then group it. For more details, please see the following steps:
    Right-click the dataset to add a calculated field with the values below:
    Name: Week
    Calculated field: =DatePart(DateInterval.WeekOfYear,Fields!FirstApprovedDate.Value,0,0)
    Add Week field to category group area in a stacked column chart.
    Right-click Week field to open the Properties dialog box, modify the expression of Label to like this:
    ="week"&Fields!Week.Value
    Add TotalApproved or TotalItemsAdded field to data area in the chart.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to insert long text data in oracle for LONG column type??

    Anybody who can tell me what is best way to store long text (more than 8k) in Oralce table.
    I am using Long datatype for column but it still doenst let me insert longer strings.
    Also I am using ODP.Net.
    Anybody with a good suggestion???
    Thanks in advance

    Hi,
    Are you getting an error? If so, what?
    This works for me..
    Greg
    create table longtab(col1 varchar2(10), col2 long );
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using System.Text;
    public class longwrite
    public static void Main()
    // make a long string
    StringBuilder sb = new StringBuilder();
    for (int i=0;i<55000;i++)
    sb.Append("a");
    sb.Append("Z");
    string indata = sb.ToString();
    Console.WriteLine("string length is {0}",indata .Length);
    // insert into database
    OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl");
    con.Open();
    OracleCommand cmd = new OracleCommand();
    cmd.CommandText = "insert into longtab values(1,:longparam)";
    cmd.Connection = con;
    OracleParameter longparam = new OracleParameter("longparam",OracleDbType.Long,indata .Length);
    longparam.Direction = ParameterDirection.Input;
    longparam.Value = indata ;
    cmd.Parameters.Add(longparam);
    cmd.ExecuteNonQuery();
    Console.WriteLine("insert complete");
    //now retrieve it
    cmd.CommandText = "select rowid,col2 from longtab where col1 = 1";
    OracleDataReader reader = cmd.ExecuteReader();
    reader.Read();
    string outdata = (string)reader.GetOracleString(1);
    Console.WriteLine("string length is {0}",outdata.Length);
    //Console.WriteLine("string is {0}",outdata);
    reader.Close();     
    con.Close();
    con.Close();
    }

  • Changed Ulimits values for the Oracle user and getting error -bash: ulimit: max user processes: cannot modify limit: Operation not permitted when logging in.

    I'm trying to increate the ulimits for max user processes and open files for the oracle user.  I've set the values in limits.conf, /etc/profile and in oracle's environment scripts. Now when I log in as oracle I get the below errors. If I change the ulimits back to the original values errors go away but ulimits aren't changed.
    login as: oracle
    [email protected]'s password:
    Last login: Fri Mar  6 09:56:02 2015 from mtkadmin12
    You are logging onto an Oracle system.
    Kickstarted on: 2014-06-05
    -bash: ulimit: max user processes: cannot modify limit: Operation not permitted
    -bash: ulimit: max user processes: cannot modify limit: Operation not permitted
    [oracle@servername ~]$

    Thanks for the update.
    I modified the /etc/security/limits.d/90-nproc.conf and added a line for oracle and also modifed the oracle.sh file.  The ulimits are setting correctly when I su - oracle but they are still wrong when sshing in as oracle.
    [root@mtkdevorap11d-1 ~]# su - oracle
    [oracle@mtkdevorap11d-1 ~]$ ulimit -Ha
    core file size          (blocks, -c) unlimited
    data seg size           (kbytes, -d) unlimited
    scheduling priority             (-e) 0
    file size               (blocks, -f) unlimited
    pending signals                 (-i) 1030982
    max locked memory       (kbytes, -l) 94371840
    max memory size         (kbytes, -m) unlimited
    open files                      (-n) 65536
    pipe size            (512 bytes, -p) 8
    POSIX message queues     (bytes, -q) 819200
    real-time priority              (-r) 0
    stack size              (kbytes, -s) unlimited
    cpu time               (seconds, -t) unlimited
    max user processes              (-u) 16384
    virtual memory          (kbytes, -v) unlimited
    file locks                      (-x) unlimited
    [oracle@mtkdevorap11d-1 ~]$
    [oracle@mtkdevorap11d-2 ~]$ ssh mtkdevorap11d-1
    Last login: Mon Mar 16 13:04:16 2015 from mtkdevorap11d-2.conveydev.com
    You are logging onto an Oracle system.
    Kickstarted on: 2014-06-05
    [oracle@mtkdevorap11d-1 ~]$ ulimit -Ha
    core file size          (blocks, -c) unlimited
    data seg size           (kbytes, -d) unlimited
    scheduling priority             (-e) 0
    file size               (blocks, -f) unlimited
    pending signals                 (-i) 1030982
    max locked memory       (kbytes, -l) 64
    max memory size         (kbytes, -m) unlimited
    open files                      (-n) 4096
    pipe size            (512 bytes, -p) 8
    POSIX message queues     (bytes, -q) 819200
    real-time priority              (-r) 0
    stack size              (kbytes, -s) unlimited
    cpu time               (seconds, -t) unlimited
    max user processes              (-u) 16384
    virtual memory          (kbytes, -v) unlimited
    file locks                      (-x) unlimited
    [oracle@mtkdevorap11d-1 ~]$

  • Trying to refresh schema for BHOLD management agent. Getting error

    Greetings,
    I'm piloting the BHOLD suite to see if it will meet our company's needs.
    I added some attributes in the BHOLD core configuration pages (web site).
    Now in the FIM sync service, I need to refresh the schema to see them. The Schema refresh fails with the following error logged in the event log. Any ideas?
    -Doug
    Log Name:      Application
    Source:        FIMSynchronizationService
    Date:          1/15/2014 8:42:27 AM
    Event ID:      6801
    Task Category: Server
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      xxxxx
    Description:
    The extensible extension returned an unsupported error.
     The stack trace is:
     "System.ObjectDisposedException: Cannot access a disposed object.
    Object name: 'WindowsIdentityImpersonationFactory'.
       at Microsoft.AccessManagement.BHOLDConnector.Context.WindowsIdentityImpersonationFactory.CreateImpersonation()
       at Microsoft.AccessManagement.BHOLDConnector.DataAccess.IntegratedSecurityDataAccess..ctor(String serverName, String databaseName, String username, String password, String domain)
       at Microsoft.AccessManagement.BHOLDConnector.BHOLDConnector.GetDataAccess(KeyedCollection`2 configParameters)
       at Microsoft.AccessManagement.BHOLDConnector.BHOLDConnector.GetSchema(KeyedCollection`2 configParameters)
    Forefront Identity Manager 4.1.3114.0"
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="FIMSynchronizationService" />
        <EventID Qualifiers="49152">6801</EventID>
        <Level>2</Level>
        <Task>3</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-01-15T14:42:27.000000000Z" />
        <EventRecordID>110324</EventRecordID>
        <Channel>Application</Channel>
        <Computer>xxxxx</Computer>
        <Security />
      </System>
      <EventData>
        <Data>System.ObjectDisposedException: Cannot access a disposed object.
    Object name: 'WindowsIdentityImpersonationFactory'.
       at Microsoft.AccessManagement.BHOLDConnector.Context.WindowsIdentityImpersonationFactory.CreateImpersonation()
       at Microsoft.AccessManagement.BHOLDConnector.DataAccess.IntegratedSecurityDataAccess..ctor(String serverName, String databaseName, String username, String password, String domain)
       at Microsoft.AccessManagement.BHOLDConnector.BHOLDConnector.GetDataAccess(KeyedCollection`2 configParameters)
       at Microsoft.AccessManagement.BHOLDConnector.BHOLDConnector.GetSchema(KeyedCollection`2 configParameters)
    Forefront Identity Manager 4.1.3114.0</Data>
      </EventData>
    </Event>

    This version of the sync engine has a known issue with ECMAs when attempting to refresh the schema. The following KB article, for build 4.1.3441 of FIM 2010 R2, describes this issue. I believe it is synchronization service issue 7.
    http://support.microsoft.com/kb/2832389/en-us
    The builds of FIM R2 are cumulative. This is actually the latest version, build 4.1.3496. This version includes all of the fixes from previous hotfixes, including the above.
    http://support.microsoft.com/kb/2906832
    I had this same problem and after installing the 4.1.3441, the schema refresh on the BHOLD MA worked as expected.
    P.S.
    Also, I wouldn't populate all of the attributes on export. Several of these should have been hidden but weren't. If you populate bholdLastname or bholdFirstname, it can overwrite the value for bholdDescription, which is an important attribute. Also, by default,
    there are no attribute in BHOLD that these two actually sync up with.....................

  • New hp pavilion g4 worked for 30 days - now I get error msg when starting up

    Error msg reads - Product information not valid
    The following product information programmed into the system board is missing or invalid.
    System Board (00A) -     System Board CT Number
    Press enter to continue start up -
    get black screen after pressing enter
    Start up test fails

    http://h30499.www3.hp.com/t5/Notebook-PCs-Pavilions-Presario/System-Board-OOA-Product-Information-No...
    The problem you are having can only be fixed by an HP Field Tech. I am one and I've fixed this issue before. It's an advisory that's only distributed internally at HP. Put in a service ticket. Any tech that has the latest s/n changer can fix this. Once the tech has booted the s/n changer, they'll put the info in like always, only this time, there will be two extra options. For any technician reading this, it'll ask something related to a 25-digit hex value that says (hit enter if unknown.) Instead, enter 25 zeros and hit enter. Then, on the softstylus option, just hit enter to leave it at defaults. That completes the latest version of the tool. This should fix your problem.
    Dv6-7000 /Full HD/Core i5-3360M/GF 650M/Corsair 8GB/Intel 7260AC/Samsung Pro 256GB
    Testing - HP 15-p000
    HP Touchpad provided by HP
    Currently on Debian Wheeze
    *Please, help other users with the same issue by marking your solved topics as "Accept as Solution"*

  • Trying to install creative cloud for the first time and getting error code:1

    im trying to install creative cloud for the first time but im getting a error code:1
    what can I do?

    Creative Cloud Error Codes (WIP) | Mylenium's Error Code Database
    Mylenium

  • I installed bootcamp 4.0 4033, installed window 32 bit but can't install the drivers for some reason i keep getting error message. i have a macbook pro mid 2011 version. Please help

    I installed bootcamp 4.0 4033 so that I can install windows 7 32 bit on my mac.  Everything works fine until I try to install the drivers and I get an error message stating the version of windows does not work with the drivers I am trying to install.  I have a feeling somehow I am downloading 64 bit drivers when I need 32 bit.  I spoke to Apple and they said I can't use 32 bit windows.. but that is not what the support site says (it says I can as long as I use bootcamp 4, not 5).  Also, my bootcamp assistant is version 5.. I have no idea if that matters.  Help please.. been searching online for hours. 

    What model/year is your Macbook Pro? What operating system version?

  • I have just tried to convert a PDF file for the first time. Get error message-can't access service.

    I just purchased ExportPDF and have tried to convert a PDF file to *.docx and *.rtf for the first time.  In both cases I get a file that says there was an error is accessing the online service.  What do I do?

    Could you try these steps to alleviate the access issue you're having:
    Choose Edit > Preferences (Win) or Adobe Reader > Preferences (Mac)
    Click 'Online Services' on the left-hand side
    Sign out of our Adobe ID and sign back in.
    Try to convert your document again.
    If you continue to have trouble, please verify that you can access the service via the web interface.  To do this:
    Open a browser and navigate to http://exportpdf.acrobat.com/signin.html
    Try to log in with your Adobe ID (email address) and password
    Once logged in, follow the on-screen prompts to convert a file
    Let us know if you're still having trouble and we'll try to help!
    -David

  • I am trying to retrive the serial number for installation and I keep getting error codes.

    I am using theredemption code but its not working

    Hi Daniel ,
    Please refer to this link to retrieve the serial number for your product.
    https://helpx.adobe.com/x-productkb/global/find-serial-number.html
    I hope this will help.
    Let us know if you still get any error message.
    Regards
    Sukrit Dhingra

Maybe you are looking for

  • Is "Photoshop CC Features" extension compatible with PS CC 2014 ???

    Is "Photoshop CC Features" extension compatible with PS CC 2014 ???

  • Error Deploying a bean Oracle 8i release 2

    I cant seem to deploy my EJBBean, I have not used Oracle before, and have no clue how to proceed. The error I get when I use deployejb is D:\Oracle\tmp>deployejb -verbose -user System -password manager -service sess_iiop://localhost:1521:ORCL -descri

  • Hi all,Interface vs Abstract class

    Hi, All When We are going to use interface or an Abstract class,Can tell exactly Thanks in advance

  • Is it only me? TM + Indexing

    I am new to TM. The set up went very well. No problem whatsoever. But a couple of things: - It is backing up every hour for some minutes, 5/10 which means 10/20% of any hour I have this noise + the bus filled with data and the cpus are used. Is it po

  • An open letter to Warren Buckley (Managing directo...

    Mr Buckely,                  I have left BT because of the way the company treats its customers. I am now with another provider that not only deliver what they promised but more and they are so much cheaper than Bt.      I received your letter dated