Invalid Number Error Please help Urgent

Hi,
I am trying to create a report in discoverer where in I get an invalid number error for the statement
,DECODE(final.TYP,'Sales',to_char(final.future_supplpy),'B/O','B/O') sale_type.
We have the requirement that when TYP is Sales i need to display future supply and when the TYP is B/O i need to display B/O.
The query runs perfectly fine in TOAD but in Discoverer Desktop when i run the report i get an error message
invalid number.
Please help its urgent
Thanks
Ashwini

Hi Ashwani
First of all, your statement appears to not be handling anything other than Sales or B/O. Is that deliberate? If not, you need a default, catch all value at the end like this:
DECODE(final.TYP,'Sales',NVL(final.future_supply,to_char(final.future_supply),'B/O','B/O', default_value) sale_type
You also might want to make sure there aren't any NULL values in future_supply or in TYP and if there are you might want to consider using an NVL for these, like this:
DECODE(final.TYP,'Sales',NVL(to_char(final.future_supply,NULL),'B/O','B/O', default_value) sale_type
Also, when using DECODE you don't always need to use TO_CHAR as the DECODE conversion to a string typically takes place automatically. CASE is different as it insists that all results are of the same data type.
Hope this helps
Best wishes
Michael

Similar Messages

  • ERROR PLEASE HELP URGENT!!!!!!!!

    HI,
    I am getting following error
    REP-3000: Internal error starting Oracle Toolkit.
    when I try to run my reports through browser.
    can any one please help me.
    Its very urgent.
    TIA
    Rajesh

    I think knows Matrix reports very well Thiruchendhuran
    Selladurai
    Thanks
    Raja

  • B2B installation error=please help urgent

    Hi,
    I am getting below error at the time on intsallation of B2B in client machine.
    I have done the successful installation of j2ee and webcache.
    But during b2b instalation its getting struck at below configuration.
    Please find below error from log:-
    Launched configuration assistant 'Enterprise Manager Agent Configuration Assistant'
    Tool type is: Recommended.
    The command being spawned is: 'D:\oracle\product\10.1.2b2b/bin/emctl stop em'
    Exception occured during spawning :CreateProcess: D:\oracle\product\10.1.2b2b/bin/emctl stop em error=2
    Configuration assistant "Enterprise Manager Agent Configuration Assistant" failed
    Complete log:-
    Configuration assistant "Register DCM Plug-Ins With EM" succeeded
    Result code for launching of configuration assistant is: 0
    Launched configuration assistant 'Enterprise Manager Agent Configuration Assistant'
    Tool type is: Recommended.
    The command being spawned is: 'D:\oracle\product\10.1.2b2b/bin/emctl stop em'
    Exception occured during spawning :CreateProcess: D:\oracle\product\10.1.2b2b/bin/emctl stop em error=2
    Configuration assistant "Enterprise Manager Agent Configuration Assistant" failed
    Result code for launching of configuration assistant is: 1
    The OUICA command is launched from D:\oracle\product\10.1.2b2b\oui\bin\ouica.bat.-----------------------------------------------------------------------------
    *** Starting OUICA ***
    Oracle Home set to D:\oracle\product\10.1.2b2b
    Configuration directory is set to D:\oracle\product\10.1.2b2b\cfgtoollogs. All xml files under the directory will be processed
    Parsing configuration file config.xml ....
    Ended Parsing configuration file config.xml
    Start Processing configuration tool Oracle Database Upgrade Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\assistants\dbma\logs\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Buffer size for copying file is set to 2048
    Expanding source path D:\oracle\product\10.1.2b2b\assistants\dbma\logs\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\assistants\dbma\logs\*. Nothing will be copied.
    End Processing configuration tool Oracle Database Upgrade Assistant
    Start Processing configuration tool Oracle Database Configuration Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\..\admin\iasdb\bdump\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\..\admin\iasdb\bdump\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\..\admin\iasdb\bdump\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\..\admin\iasdb\cdump\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\..\admin\iasdb\cdump\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\..\admin\iasdb\cdump\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\..\admin\iasdb\udump\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\..\admin\iasdb\udump\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\..\admin\iasdb\udump\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\..\admin\iasdb\create\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\..\admin\iasdb\create\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\..\admin\iasdb\create\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\admin\iasdb\bdump\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\admin\iasdb\bdump\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\admin\iasdb\bdump\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\admin\iasdb\cdump\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\admin\iasdb\cdump\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\admin\iasdb\cdump\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\admin\iasdb\udump\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\admin\iasdb\udump\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\admin\iasdb\udump\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\admin\iasdb\create\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\admin\iasdb\create\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\admin\iasdb\create\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\rdbms\audit\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\rdbms\audit\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\rdbms\audit\*. Nothing will be copied.
    Preparing for copying D:\oracle\product\10.1.2b2b\assistants\dbca\logs\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\assistants\dbca\logs\*
    WARN: Could not find any file matching the expression D:\oracle\product\10.1.2b2b\assistants\dbca\logs\*. Nothing will be copied.
    End Processing configuration tool Oracle Database Configuration Assistant
    Start Processing configuration tool Internet Directory Configuration Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\ldap\log\oidca.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\ldap\log\oidca.log
    Adding the file D:\oracle\product\10.1.2b2b\ldap\log\oidca.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\ldap\log\oidca.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    Preparing for copying D:\oracle\product\10.1.2b2b\ldap\log\dipca.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\ldap\log\dipca.log
    Adding the file D:\oracle\product\10.1.2b2b\ldap\log\dipca.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\ldap\log\dipca.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    Preparing for copying D:\oracle\product\10.1.2b2b\ldap\log\dasca.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\ldap\log\dasca.log
    Adding the file D:\oracle\product\10.1.2b2b\ldap\log\dasca.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\ldap\log\dasca.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    End Processing configuration tool Internet Directory Configuration Assistant
    Start Processing configuration tool Directory Integration Platform Configuration Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\ldap\log\odca.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\ldap\log\odca.log
    Adding the file D:\oracle\product\10.1.2b2b\ldap\log\odca.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\ldap\log\odca.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    End Processing configuration tool Directory Integration Platform Configuration Assistant
    Start Processing configuration tool Infrastructure Schema Configuration Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\config\schemaload.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\config\schemaload.log
    Adding the file D:\oracle\product\10.1.2b2b\config\schemaload.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\config\schemaload.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    End Processing configuration tool Infrastructure Schema Configuration Assistant
    Start Processing configuration tool Ultra Search Security Configuration Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\assistants\opca\ultrasearchInst.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\assistants\opca\ultrasearchInst.log
    Adding the file D:\oracle\product\10.1.2b2b\assistants\opca\ultrasearchInst.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\assistants\opca\ultrasearchInst.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    End Processing configuration tool Ultra Search Security Configuration Assistant
    Start Processing configuration tool Delegated Administrative Service Configuration Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\ldap\log\oidca.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\ldap\log\oidca.log
    Adding the file D:\oracle\product\10.1.2b2b\ldap\log\oidca.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\ldap\log\oidca.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    End Processing configuration tool Delegated Administrative Service Configuration Assistant
    Start Processing configuration tool Single Sign On Configuration Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\sso\log\ssoca.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\sso\log\ssoca.log
    Adding the file D:\oracle\product\10.1.2b2b\sso\log\ssoca.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\sso\log\ssoca.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    End Processing configuration tool Single Sign On Configuration Assistant
    Start Processing configuration tool Infrastructure modo_sso Configuration Assistant....
    Preparing for copying D:\oracle\product\10.1.2b2b\config\infratool_mod_osso.log to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\config\infratool_mod_osso.log
    Adding the file D:\oracle\product\10.1.2b2b\config\infratool_mod_osso.log from the file path expanding...
    WARN: Source file D:\oracle\product\10.1.2b2b\config\infratool_mod_osso.log could not be found. Nothing will be copied for this file
    Number of file(s) copied is 0
    Number of directories copied is 0
    End Processing configuration tool Infrastructure modo_sso Configuration Assistant
    Start Processing configuration tool OPMN Configuration Assistant-start OPMN....
    Preparing for copying D:\oracle\product\10.1.2b2b\opmn\logs\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\opmn\logs\*
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\B2B~B2BServer~b2btst.fitl0036.tamro.com~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\B2B~OC4J_B2B~default_island~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\dcm-daemon~dcm-daemon~dcm~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\HTTP_Server~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\ipm.log from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\OC4J~home~default_island~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\ons.log from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\service.log from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\states from the file path expanding...
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\B2B~B2BServer~b2btst.fitl0036.tamro.com~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\B2B~B2BServer~b2btst.fitl0036.tamro.com~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\B2B~OC4J_B2B~default_island~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\B2B~OC4J_B2B~default_island~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\dcm-daemon~dcm-daemon~dcm~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\dcm-daemon~dcm-daemon~dcm~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\HTTP_Server~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\HTTP_Server~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\ipm.log to D:\oracle\product\10.1.2b2b\cfgtoollogs\ipm.log
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\OC4J~home~default_island~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\OC4J~home~default_island~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\ons.log to D:\oracle\product\10.1.2b2b\cfgtoollogs\ons.log
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\service.log to D:\oracle\product\10.1.2b2b\cfgtoollogs\service.log
    Number of file(s) copied is 8
    Number of directories copied is 0
    End Processing configuration tool OPMN Configuration Assistant-start OPMN
    Start Processing configuration tool OPMN Configuration Assistant-start HTTP server....
    Preparing for copying D:\oracle\product\10.1.2b2b\opmn\logs\* to D:\oracle\product\10.1.2b2b\cfgtoollogs
    Expanding source path D:\oracle\product\10.1.2b2b\opmn\logs\*
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\B2B~B2BServer~b2btst.fitl0036.tamro.com~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\B2B~OC4J_B2B~default_island~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\dcm-daemon~dcm-daemon~dcm~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\HTTP_Server~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\ipm.log from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\OC4J~home~default_island~1 from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\ons.log from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\service.log from the file path expanding...
    Adding the file D:\oracle\product\10.1.2b2b\opmn\logs\states from the file path expanding...
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\B2B~B2BServer~b2btst.fitl0036.tamro.com~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\B2B~B2BServer~b2btst.fitl0036.tamro.com~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\B2B~OC4J_B2B~default_island~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\B2B~OC4J_B2B~default_island~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\dcm-daemon~dcm-daemon~dcm~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\dcm-daemon~dcm-daemon~dcm~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\HTTP_Server~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\HTTP_Server~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\ipm.log to D:\oracle\product\10.1.2b2b\cfgtoollogs\ipm.log
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\OC4J~home~default_island~1 to D:\oracle\product\10.1.2b2b\cfgtoollogs\OC4J~home~default_island~1
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\ons.log to D:\oracle\product\10.1.2b2b\cfgtoollogs\ons.log
    Completed copying file D:\oracle\product\10.1.2b2b\opmn\logs\service.log to D:\oracle\product\10.1.2b2b\cfgtoollogs\service.log
    Number of file(s) copied is 8

    Please raise a SR with support though it looks like installation configuration/env issue.
    Regards,
    Anuj

  • Failed to get mod_osso global context error, please help urgently

    Hi All,
    I have installed Oracle 9ias Infrastructure successfully. I am trying to create new users for OID.I used the url: http://host:7777/oiddas to go to the Internet Directory page.Following the instructions to create new users for OID, I clicked on the Directory tab on the page.It gives an Oracle SSO error.When i checked the error log it says "failed to get mod_osso global context".Can anyone help me here.Thanks in advance.

    Hi,
    Wrap your data refs in {}:
    return lookupFunction('{price}');
    and ensure that you have Spry 1.6.1.

  • Invalid Path error - Please Help !

    I'm trying to setup a golden triangle with OS X 10.5.2 server, Windows 2003 AD and PPC/Intel clients running 10.4.11.
    Their is no problem on the AD side - clients register in AD ok, network accounts log in, server is joined as well.
    DNS - ping, changeip -checkhostname, lookups all work fine. DNS is hosted by Windows AD server. This LAN is not connected to the internet.
    *I've joined clients to OD using the IP address or the name (polk.nwts.nara), they've authenticated OK when binding (set as required), but do not get their managed preferences.*
    On the OD side, I created a group, set the preferences, and added the just joined workstation to the group. I rebooted the client, but none of the preferences showed up.
    I opened a terminal window and did the following:
    dscl localhost
    ls
    +this listed the directories+
    cd LDAPv3
    ls
    +this listed my OD server+
    cd myODserver
    cd: *Invalid Path*
    Starting Directory Access on the client, when I go to Search & Mappings and select a Record Type and Attribute, the search base is the same as on the server - cn=(record type), dc=polk,dc=nwts,dc=nara
    Soooo - what am I missing? I believe this error is indicative of why the clients aren't getting their settings, but can't figure out where the problem is. BTW, I can start Workgroup Manager from a client and access OD.
    Quick addenda:
    Setup mac server using "advanced"
    Joined it to AD domain, rebooted.
    Made it an OD Master. Rebooted.
    Kerberos is not started, have not added any records.
    Created group and set managed preferences for this group.
    Added clients by binding them to OD server. Added client to group.
    Rebooted client.
    Client authentication/contacts is AD first, then OD.

    Assuming that you are on Windows, most likely your registry is pointing to an invalid 'My Documents' location.
    See if this can fix it: https://fixitcenter.support.microsoft.com/

  • Object IO Stream ERROR  please help, urgent

    I am writing an applet + servlet to access MySQL database, the data are like order and order line,
    When I click Insert button, the data (both order and order line) insert properly,
    But when I want to reload them,
    I created a JFrame to show a list order _id , 
    When the user choose and click a JButton,
    It will call the applet to retrieve all data back,
    But the data were not recieved by servlet.
    Each time I want to access database, My applet will call the servlet and create new ObjectInputStream and ObjectOutputStream.
    The connection are below:
    public URLConnection getCon() {   
    URLConnection con = null;
    try {
    JOptionPane.showMessageDialog(null, urlSuffix);
    URL dataURL = new URL(protocol, host, port, urlSuffix);
    con = dataURL.openConnection();
    JOptionPane.showMessageDialog(null, "con = " + con);
    con.setRequestProperty("Content-Type",
    "application/x-java-serialized-object");
    con.setDoOutput(true);
    con.setUseCaches(false);
    catch (...) {      .....    }
    finally{
    return con;
    so It returns an URLConnection connecting to "urlSuffix" .
    Then I pass 2 String to the servlet , the mode and the sql
    Where mode is "INSERT" / "SELECT" idicating where should do next.
    When servlet recieve any data, it will put the value out to System.out,
    so suppose when it recieve "INSERT" , it will print "INSERT" into System.out
    To retrieve data,
    I used to create a new JFrame ,
    used the same method ,
    con.writeObject("SELECT");
    con.writeObject("SELECT * FROM TABLE");
    The order id were loaded, and let user to select the order from a JList,
    And THEN the user should click submit button,
    and call the Applet to retrieve data,
    //WHEN BUTTON CLICK call Applet.loadOrder( JList.selectedIndex())
    public void loadOrder(int i){
    con = getCon();
    ObjectOutputStream os = new ObjectOutputStream(con.getOutputStream);
    os.writeObject("SELECT");
    os.writeObject(sql)
    But the servlet gives no response to me (suppose it should print "SELECT" into System.out.
    The servlet cannot recieve any object,
    Why?
    I have try to use the JFrame to call INSERT< it works also, but not in retrieve data only

    flush() or close() the ObjectOutputStream. There are probably still bytes in the buffer.
    - Saish
    "My karma ran over your dogma." - Anon

  • Please help: Case Statement - ORA-01722: invalid number Error

    Hi All,
    I'm trying to use Case statement to recode Cancelled statuses into two groups
    'Reject' if the difference between first date and last date is less than 29 and
    'Accept' if the difference between first date and last date is greater than 30
    Here is my 'test' data:
    STATUS     FIRST_DATE     LAST_DATE
    Transfer     10/08/2011     10/09/2011
    Mover     10/08/2011     15/09/2011
    Cancel     10/08/2011     16/09/2011
    Cancel     10/08/2011     5/09/2011
    Here is the syntax
    select a.*,
    (CASE WHEN a.STATUS ='Cancel' THEN (round(a.LAST_DATE-a.FIRST_DATE))
    ELSE 0
    END) CAN_DAYS,
    (CASE WHEN 'CAN_DAYS' >29 THEN 'Reject'
    WHEN 'CAN_DAYS' <30 THEN 'Accept'
    END) Reject_Accept
    from test a
    The first CASE statement works fine and gives me this
    STATUS     FIRST_DATE     LAST_DATE     CAN_DAYS
    Transfer     10/08/2011     10/09/2011     0
    Mover     10/08/2011     15/09/2011     0
    Cancel     10/08/2011     16/09/2011     37
    Cancel     10/08/2011     5/09/2011     26
    but the second CASE produces ORA-01722: invalid number Error. It is something to do with the CAN_DAYS data type, Oracle doesn't see it as Numeric i think.
    The result i want to see would be
    STATUS     FIRST_DATE     LAST_DATE     CAN_DAYS Reject_Accept
    Transfer     10/08/2011     10/09/2011     0
    Mover     10/08/2011     15/09/2011     0
    Cancel     10/08/2011     16/09/2011     37 Accept
    Cancel     10/08/2011     5/09/2011     26 Reject
    Could someone please help me to fix the syntax?
    Thank you in advance,

    This seems to give you your desired results...
    with test as
      ( select 'Transfer' as status, to_date('10/08/2011') as first_date, to_date('10/09/2011') as last_date  from dual union all
        select 'Mover'             , to_date('10/08/2011')              , to_date('15/09/2011')               from dual union all
        select 'Cancel'            , to_date('10/08/2011')              , to_date('16/09/2011')               from dual union all
        select 'Cancel'            , to_date('10/08/2011')              , to_date('05/09/2011')               from dual
    select  status
         ,  first_date
         ,  last_date
         ,  CAN_DAYS
         ,  CASE
              WHEN CAN_DAYS =   0 THEN NULL
              WHEN CAN_DAYS <  30 THEN 'Reject'
              WHEN CAN_DAYS >= 30 THEN 'Accept'
            END  Reject_Accept
      from  ( select  status
                   ,  first_date
                   ,  last_date
                   ,  CASE
                        WHEN STATUS ='Cancel' THEN round(LAST_DATE-FIRST_DATE)
                        ELSE 0
                      END  CAN_DAYS
                from  test
    ;

  • Please help getting invalid number error.

    Hi Experts,
    My requirement is
    If DT_ID value of xmlmsg existed in the DT_ID of PART_ID_COLLES table then that record should be processd else should be skipped.
    And xmlmsg of PART_ID should start with "A" and followed only by the number then that record should be processed else should be skipped.
    And xmlmsg of DD_DAYS should contain only  the number and grater than or equal to 0 ,then that record should be processed else should be skipped.
    For that I have written this code.
    But if I pass dt_id as string value in xmlmsg I am getting invalid number error.
    DT_ID of PART_ID_COLLES table is number data type.
    SELECT xmlmsg.part_id part_id,xmlmsg.dd_days dd_days,xmlmsg.dt_id dt_id
                      FROM XMLTABLE(
                            XMLNAMESPACES(
                                'urn:schemas-microsoft-com:rowset' as "rs"
                              , '#RowsetSchema' as "z"
                            '/z:row[not(@dt_id=following-sibling::z:row/@dt_id and @part_id=following-sibling::z:row/@part_id)]'
                            PASSING p_dd_days_vals
                            COLUMNS
                                ITEM_NO             for ordinality
                              , dt_id    VARCHAR2 (20) path '@dt_id'
                              , part_id  VARCHAR2 (25) path '@part_id'
                              , dd_days  VARCHAR2 (20) path '@dd_days'
                           ) xmlmsg,
                           part_id_colles pic
                           WHERE REGEXP_REPLACE(TRIM(xmlmsg.dt_id),'^([0-9]+)$|.','\1') = pic.dt_id
                                 AND REGEXP_LIKE (UPPER(TRIM(xmlmsg.part_id)),'^[A][0-9]+$')
                                 AND (TO_NUMBER(REGEXP_REPLACE(TRIM(xmlmsg.dd_days),'^([0-9]+)$|.','\1')) >=0
                                 AND REGEXP_LIKE(TRIM(xmlmsg.dd_days), '^-?[[:digit:],.]*$') ;
    Sample message is
    <MESSAGES>
    <MESSAGE ID="12345">
      <MSG_ID>3026900</MSG_ID>
      <DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
      <POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
      <DT_LAST_QUEUED />
    <MSG>
    <WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
    <WORK_UNIT GROUP="dd_days" ACTION="ADD" AFFECTED="dd_days">
    <RECORDSET TABLE_NAME="dd_days">
    <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    <rs:data>
      <z:row dt_id="430" part_id="A5556689" dd_days="10"/>
      <z:row dt_id="550A" part_id="A8889965" dd_days="20"/>
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
      </WORK_SET>
      </MSG>
      </MESSAGE>
      </MESSAGES>
    Please help me.
    Thanks.

    Your code has ton of errors. Anyway:
    with part_id_colles as (
                            select 430 dt_id,xmltype('<MESSAGES>
    <MESSAGE ID="12345">
      <MSG_ID>3026900</MSG_ID>
      <DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
      <POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
      <DT_LAST_QUEUED />
    <MSG>
    <WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
    <WORK_UNIT GROUP="dd_days" ACTION="ADD" AFFECTED="dd_days">
    <RECORDSET TABLE_NAME="dd_days">
    <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    <rs:data>
      <z:row dt_id="430" part_id="A5556689" dd_days="10"/>
      <z:row dt_id="550A" part_id="A8889965" dd_days="20"/>
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
      </WORK_SET>
      </MSG>
      </MESSAGE>
      </MESSAGES>') p_dd_days_vals from dual)
    SELECT  xmlmsg.part_id part_id,
            xmlmsg.dd_days dd_days,
            xmlmsg.dt_id dt_id
      FROM  part_id_colles pic,
            XMLTABLE(
                     XMLNAMESPACES(
                                   'urn:schemas-microsoft-com:rowset' as "rs",
                                   '#RowsetSchema' as "z"
                     '/MESSAGES/MESSAGE/MSG/WORK_SET/WORK_UNIT/RECORDSET/xml/rs:data/z:row[not(@dt_id=following-sibling::z:row/@dt_id and @part_id=following-sibling::z:row/@part_id)]'
                     PASSING p_dd_days_vals
                     COLUMNS
                        ITEM_NO             for ordinality,
                        dt_id    VARCHAR2 (20) path '@dt_id',
                        part_id  VARCHAR2 (25) path '@part_id',
                        dd_days  VARCHAR2 (20) path '@dd_days'
                    ) xmlmsg
      WHERE REGEXP_REPLACE(TRIM(xmlmsg.dt_id),'^([0-9]+)$|.','\1') = pic.dt_id
        AND REGEXP_LIKE(UPPER(TRIM(xmlmsg.part_id)),'^[A][0-9]+$')
        AND TO_NUMBER(REGEXP_REPLACE(TRIM(xmlmsg.dd_days),'^([0-9]+)$|.','\1')) >=0
        AND REGEXP_LIKE(TRIM(xmlmsg.dd_days), '^-?[[:digit:],.]*$')
    PART_ID                   DD_DAYS              DT_ID
    A5556689                  10                   430
    SQL>
    SY.

  • TS2755 I recently upgraded my IPhone and for 1 person I began receiving this "7233375 Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code". I receive text from this person but cannot send. Please help. Thank you.

    I recently upgraded my IPhone and for 1 person I began receiving this "7233375 Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code". I receive text from this person but cannot send. Please help. Thank you.

    Hi there
    I’d be happy to help with this messaging error! This will be due to the device storing the number incorrectly. Please do the following to resolve the issue:
    Delete texts from both old number and new
    Delete any call logs including these numbers
    Delete old number from contacts
    Delete new number from contacts
    Restart device
    Send text to the new number directly (do not save as contact)
    Once the text sends successfully, you can then save as a new contact
    I hope this helps!
    Charise

  • Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code

    Hey, so my friend got a Galaxy s6 edge yesterday and gave me his new number. When I tried texting it I received this immediately after:
    Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code. Hey
    I can receive messages from this number as well as calls. I've become aggravated and am not sure what to do. Please help, thanks!

    Hi there
    I’d be happy to help with this messaging error! This will be due to the device storing the number incorrectly. Please do the following to resolve the issue:
    Delete texts from both old number and new
    Delete any call logs including these numbers
    Delete old number from contacts
    Delete new number from contacts
    Restart device
    Send text to the new number directly (do not save as contact)
    Once the text sends successfully, you can then save as a new contact
    I hope this helps!
    Charise

  • Keep getting an error message when trying to send some texts to valid numbers, "Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code.

    Does anyone know why I keep getting an error  message, "Error invalid number. Please re-send using a valid 10 digit mobile number or valid short code.  The numbers I'm texting to, are valid numbers.

    Did you ever get resolution to this problem?
    My coworker has the identical issue, including the number (+1 (1)(216)116-11) in the error reply.

  • I just bought iWorks Serial Number Key over the internet. When I use the key, iWorks tells me the key is invalid!! Please help. (I bought this iWorks from someone in Singapore. I am using it in Malaysia)

    I just bought iWorks Serial Number Key over the internet. When I use the key, iWorks keep telling me the key is invalid!! Please help. (I bought this iWorks from someone in Singapore. I am using it in Malaysia.). Thanks

    Downloaded the Trial version. It still says the serial number key is invalid. On the iWork page where I am suppose to enter the serial number key, the "Go Back" button is always BOLD, but the "Continue" button remains GREY all the time. The "Continue" button remains grey even after I have completed the key entry. I have to type the "Return" key on my keyboard to force enter the key. The message I get is still "Invalid key".
    I have called Apple. The first person helped by asking me to delete certain items in some Folders and it still did not work. I was then connected to a senior person, but I heard over the recording that there were 15 persons waiting on the line. I had to end the call because the wait will take too long.

  • I can't download the apple ios 5 for the ipad. after downloading around 10 % an error no. 3259 occurs. it's a network error. please help . it's urgent. i am having apple ipad 2 3G wifi

    i can't download the apple ios 5 for the ipad. after downloading around 10 % an error no. 3259 occurs. it's a network error. please help . it's urgent. i am having apple ipad 2 3G wifi.

    i switched off all the security settings and all the firewalls.
    i m unable to install any of the app on the ipad
    so i saw the apple support and it said to update the older version of my ipad.
    and niether am i able to download the update nor am i able to download any app and install it in my ipad2
    i also tried to download an .ipsw file (ios5 update) from torrentz bt i am also unable to install from that as itunes rjects that file and gives an error. and also tries to delete that file. plz anyone help urgently.

  • The account is invalid to access, please help me to connect to a new right email address. This is urgent for the pre-order, please respond as soon as possible.

    My email account is invalid to access, please help me to connect to a new right email address. This is urgent for the pre-order process, please respond as soon as possible.
    <Email Edited by Host>

    This is a user-to-user technical support forum. No one here can help you.
    Try
    https://expresslane.apple.com

  • Very Urgent: Invalid Number error

    We are getting an invalid number error on a date field in a Form that has run this procedure for two years. The query is something like select max(upload_date) from pfe_time_report where ssn = :block_update.ssn. We think that an invalid number has been inserted into the database but we can't find out where. Has anyone run into this situation before? This is a crucial enterprise application (3000 people won't get paid w/o it!)
    Thanks.

    Infact I also got this error, I solved this problem by removing NLS_DATE_FORMAT from the registry you can try out this option and see it does work.
    Rahamath

Maybe you are looking for

  • How to remove space below the table in smartforms

    how to remove space below the table in smartforms

  • Packaging wizard failed : unauthorized 401 ???

    Hello, At the end of the packaging wizard (10g) when I want to publish my new application, I receive the following message : WTG-20502 Packaging wizard failed 401 unauthorized Why ??? Thanks for your answers.

  • How to sync without losing artwork

    I turned on match on devices and now with itunes it's a pain to get artwork sync between itunes on imac and my ipod touch, The ipod loses a lot of album artwork. What did apple di with itunes? can't now drag an album to ipod touch and get it there wi

  • ESA setup - best practices

    I have 2 ESA (c370) running active/active setup. Currently each ESA configured to use only a single port for both inbound and outbound email. The other 3 ports are not in use. What are the best practices of setting up the ESA ? Sent from Cisco Techni

  • Published project running slowly

    Hi all, I am using Captivate 4 and publishing to Flash. One particular project I am working on is giving me some difficulty. When I preview the next 5 slides in Captivate it plays as I have set it up. However when I preview it in web brower or publis