Function to get character

Hello,
Is there any function in sql that will determine my data in a field got characters in it. Eg: I have a charcter datatype field called userdept. I am using to_number to convert it to number. Now I need to check whether any data in userdept got charcter in it and if so convert it to null or number? I cannot change the datatype to number.
Any help is highly appreciated.
Thanks

You will need to create a function of your own to validate. if you search this forum, you can find many other examples for this type of requirement.
SQL> create or replace function check_number(p_in in varchar2) return number is
  2  begin
  3    if (to_number(p_in) = p_in)
  4    then
  5      return(1) ;
  6    else
  7      return(0) ;
  8    end if ;
  9  exception
10  when value_error
11  then
12    return(0) ;
13  end ;
14  /
Function created.
SQL> select check_number('123.34') from dual ;
CHECK_NUMBER('123.34')
                     1
SQL> select check_number('12A3.34') from dual ;
CHECK_NUMBER('12A3.34')
                      0
SQL>

Similar Messages

  • I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it this about and how do I get my product back

    I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it this about and how do I get my product back

    Hi there
    I have version 5.7 and every time I opened it I was told that updates are available and to click on the icon to access these.  Instead it just took me to the
    adobe page with nowhere visible to update.  I then  sought to download lightroom cc and this is when I could not access the 'develop' section due to reduced
    functionality  It was apparent that my photos had been put in cc but no way to access them unless I wanted to subscribe. 
    I have since remedied the problem as  my original lightroom 5.7 icon is still available on the desktop and have gone back to that.  I do feel that this is a bit
    of a rip off and an unnecessary waste of my time though.
    Thank you for your prompt reply by the way.
    Carlo
    Message Received: May 04 2015, 04:52 PM
    From: "dj_paige" <[email protected]>
    To: "Carlo Bragagnolo" <[email protected]>
    Cc:
    Subject:  I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have
    reduced functionality what it this about and how do I get my product back
    dj_paige  created the discussion
    "I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it
    this about and how do I get my product back"
    To view the discussion, visit: https://forums.adobe.com/message/7510559#7510559
    >

  • CE function to get distinct values from Column table

    Hi All,
    Could you please let me know the appropriate CE function to get the distinct values from column table.
    IT_WORK = SELECT DISTINCT AUFNR FROM :IT_WO_DETAILS;
    Thank you.

    Hi,
    If you have 10g, you can use Model( with model performance is better than connect by )
    Solution
    ========================================================================
    WITH t AS
    (SELECT '0989.726332, 1234.567432, 3453.736379, 3453.736379, 0989.726332, 3453.736379, 1234.567432, 1234.567432, 0989.726332'
    txt
    FROM DUAL)
    SELECT DISTINCT TRIM(CHAINE)
    FROM T
    MODEL
    RETURN UPDATED ROWS
    DIMENSION BY (0 POSITION)
    MEASURES (CAST( ' ' AS VARCHAR2(50)) AS CHAINE ,txt ,LENGTH(REGEXP_REPLACE(txt,'[^,]+',''))+1 NB_MOT)
    RULES
    (CHAINE[FOR POSITION FROM  1 TO NVL(NB_MOT[0],1) INCREMENT 1] =
    CASE WHEN NB_MOT[0] IS NULL THEN TXT[0] ELSE REGEXP_SUBSTR(txt[0],'[^,]+',1,CV(POSITION)) END );
    =========================================================================
    Demo
    =======================================================================
    SQL> WITH t AS
    2 (SELECT '0989.726332, 1234.567432, 3453.736379, 3453.736379, 0989.726332, 3453.736379, 123
    4.567432, 1234.567432, 0989.726332'
    3 txt
    4 FROM DUAL)
    5 SELECT DISTINCT TRIM(CHAINE)
    6 FROM T
    7 MODEL
    8 RETURN UPDATED ROWS
    9 DIMENSION BY (0 POSITION)
    10 MEASURES (CAST( ' ' AS VARCHAR2(50)) AS CHAINE ,txt ,LENGTH(REGEXP_REPLACE(txt,'[^,]+',''))+1 NB_MOT)
    11 RULES
    12 (CHAINE[FOR POSITION FROM  1 TO NVL(NB_MOT[0],1) INCREMENT 1] =
    13 CASE WHEN NB_MOT[0] IS NULL THEN TXT[0] ELSE REGEXP_SUBSTR(txt[0],'[^,]+',1,CV(POSITION)) END );
    TRIM(CHAINE)
    3453.736379
    1234.567432
    0989.726332
    SQL>
    ========================================================================

  • Any way to get Character Mode Report

    In our company a lot of reports were made in character mode. in prev version Developer Rel 2.1
    now Complete software is being compiled in 9ids.
    Company wants to get most of reports in character mode.
    I want to get character mode report at user end.
    pls help me

    one main and more important think
    in url password is display.[b]
    for hide the password follow thses steps
         user_name := get_application_property(username);
         pass := get_application_property(password);
         conn := get_application_property(connect_string);
         con_url := 'userid='||user_name||'/'||pass||'@'||conn;
    /* Convert the connect string into a hexadecimal character string. */
         FOR i IN 1..LENGTH(con_url) LOOP
              v_a := ltrim(to_char(trunc(ascii(substr(con_url,i,1))/16)));
         if v_a = '10' THEN v_a := 'A';
              elsif v_a = '11' THEN v_a := 'B';
              elsif v_a = '12' THEN v_a := 'C';
              elsif v_a = '13' THEN v_a := 'D';
              elsif v_a = '14' THEN v_a := 'E';
              elsif v_a = '15' THEN v_a := 'F';
         end if;
         v_b := ltrim(to_char(mod(ascii(substr(con_url,i,1)),16)));
         if v_b = '10' THEN v_b := 'A';
              elsif v_b = '11' THEN v_b := 'B';
              elsif v_b = '12' THEN v_b := 'C';
              elsif v_b = '13' THEN v_b := 'D';
              elsif v_b = '14' THEN v_b := 'E';
              elsif v_b = '15' THEN v_b := 'F';
         end if;
              con_url_temp := con_url_temp||'%'||v_a||v_b;
         END LOOP;
    path:='/reports/rwservlet?server=repserver4&destype=cache&'||con_url_temp||'&report='||rep_path);
    web.show_document(path);
    and enjoy your life:-)
    kuljeet pal singh

  • Is there a function to get the IP of this remote system

    Hello EveryBody
    Currently I have an application that runs on our network. When someone logs on to the network it checks there system and gets the pc name. I would like to also get the IP address of that system. As well I may later like to ping that computer.
    1) Is there a function to get the IP of this remote system?
    2) IS the a function to ping a remote system and receive back the response?
    Thanks a lot.
    R

    Hello EveryBody
    Currently I have an application that runs on our
    network. When someone logs on to the network it
    checks there system and gets the pc name. I would
    like to also get the IP address of that system. As
    well I may later like to ping that computer.
    1) Is there a function to get the IP of this remote system?
    2) IS the a function to ping a remote system and
    receive back the response?Is this lan only?
    Because if wan or internet then the remote computer would have to have an address that is reachable from your computer. For the internet this would mean it would have to be public. And for a wan the IP would have to be unique across the wan.

  • Server side function not get called after dispatching cairngorm event second time on same page

    Hi All,
    I am facing a urgent issue regarding cairngorm event. Actually my page contain 3 button add,delete,save
    and  clicking of any button I do the respected functionality. For ex:
    I click the add button & on clicking of add button I fire a cairngorm evnt & after getting response from server side that the record is added
    I displayed a message that the record is added & update the data source.
    After addition of the record , with out going to other page if I perform the same functionaly(Like adding another record) on same page the cairngorm
    event not call the server side function  -  after debugging I find out that cairngorm event  reach to the corresponding excutecommand function & called that function  but it is not calling my server side function & I also din't get any error message .
    I dont know why  the server side function not get called?. similarly if I try for delete or update case the same things happend. Only for the first time it works properly but not for the second  time.
    Could any of  you please tell me why the cairngorm event not calling the server side function.
    Thank you for your kind assistance.
    Regards,
    Ujjwal

    Okay, well I think I've worked out the problem.
    In ASP.NET we would typically bind repeating controls such as DataLists and Repeaters manually using <i>Control</i>.DataBind(), because we're usually using a separate class library containing collections for our objects. Seems the SAP Table control doesn't like this approach.
    I changed the code so that the databinding is specified on the control, and call the Page's DataBind() method and it all worked fine.
    One tip: because the collection I used to bind to is in a separate class library, I receieved a <i>BC306523: Reference required to assembly MyAssemblyName...</i> message, even though I had a reference to the assembly in my project and the DLL is being properly deployed. To fix this, you must include the following directive at the top of the component's ASCX file:
    <%@ Assembly Name="AssemblyName" %>

  • Idoc - Partner Function not getting captured.

    Dear all,
    I am using IDOC (type - /NFM/ORDERS05) to send a Purchase Order. The Idoc is getting created but the only a few partner function is getting captured from the Partners tab in the ME22n transaction. The remaining partner functions that are not captured are SP (Forwarding Agent) and ER (Employee responsible).
    Any bright ideas how to solve this problem.
    Points will be awarded.

    Hi Vivek,
    Thanks for your reply.
    1. Where do i have set the receiver port and the message type for each "partner fuction". We do this generally for a Partner Type. (Please clarify)
    2. If I remove the syntax check box then my PO is not getting created in ME21n transaction.
    3. I have checked the Partner types there is not problem with that.
    Regards,
    Gajanan.

  • Use SQL function to get the original order number using the invoice number

    Hi All,
    wondering is someone can help me with this challenge I am having?  Often I need to return the original order numbers that created the resulting invoce.  This is a relatively simple seriese of joins in a query but I am wanting to simplify it using a SQL function that can be referenced each time easily from with in the SELECT statement.  the code i currently have is:
    Use SQL function to get the original order number using the invoice number
    CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
    RETURNS nvarchar(200)
    AS
    BEGIN
    DECLARE @OrderList nvarchar(200)
    SET @OrderList = ''
    SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
    FROM  OINV AS T1 INNER JOIN
          INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
          DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
          RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
          ORDR AS T6 ON T5.DocEntry = T6.DocEntry
    WHERE T1.DocNum = @InvNum
    RETURN @OrderList 
    END
    it is run by the following query:
    Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
    From OINV T1
    Where T1.DocNum = 'your invoice number here'
    The issue is that this returns the order number for all of the lines in the invoice.  Only want to see the summary of the order numbers.  ie if 3 orders were used to make a 20 line inovice I only want to see the 3 order numbers retuned in the field.
    If this was a simple reporting SELECT query I would use SELECT DISTINCT.  But I can't do that.
    Any ideas?
    Thanks,
    Mike

    Thanks Gordon,
    I am trying to get away from the massive table access list everytime I write a query where I need to access the original order number of the invoice.  However, I have managed to solve my own problem with a GROUP BY statement!
    Others may be interested so, the code is this:
    CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
    RETURNS nvarchar(200)
    AS
    BEGIN
    DECLARE @OrderList nvarchar(200)
    SET @OrderList = ''
    SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
    FROM  OINV AS T1 INNER JOIN
          INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
          DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
          RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
          ORDR AS T6 ON T5.DocEntry = T6.DocEntry
    WHERE T1.DocNum = @InvNum
    GROUP BY T6.DocNum
    RETURN @OrderList 
    END
    and to call it use this:
    Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
    From OINV T1
    Where T1.DocNum = 'your invoice number'

  • DATE function to get name of day for a Date given?

    hi guys,
    can anyone tell me what is the DATE function to get the name of day for a date given
    (12/dec/2004)---returns SUNDAY

    Hi peter
    Your Query will return an error.
    SQL> select to_char(to_date('12/dec/2004', 'mm/mon/yyyy'), 'DAY')from dual;
    select to_char(to_date('12/dec/2004', 'mm/mon/yyyy'), 'DAY')from dual
    ERROR at line 1:
    ORA-01816: month may only be specified once.
    month is specified twice.
    select to_char(to_date('12/dec/2004', 'dd/mon/yyyy'), 'DAY')from dual;
    Regards
    Sasidhar.P

  • Function to get message payload by MESSAGE_ID

    Hello Experts,
    Can you please give me the name of the function to get message payload by MESSAGE_ID?
    I was trying to call SXMB_SELECT_MESSAGES, but it returnes just technical info about message (like sender, receiver, etc), but not the payload.
    Thanks in advance for your answers!

    Akshay, but the main (original) problem still remains: How I can get an access to System Error description (Connection timeout, Connction refused, etc)?
    If I will build a custom Alert in my UDF and then will call SALERT_CREATE to raise an Alert, than how will I fill the Alert Body with Alert Description?
    I can have either the "native" Alert, containing just the Alert Description or "custom" Alert, containing some business data. But I need both.
    So is there any way to access the System Error description in mapping?

  • Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Not a lot of details here, but my guess is this isn't working for you because you are wiring in the task to the Active Channels Property and not the actual Channel Name. I have attatched a screenshot of what I believe you are trying to do. The Task has 2 channels in it, so I need to index off one of the channels and wire it into the active channels input of the Channel Property node. Then I can read information about that channel
    Attachments:
    channel_name.JPG ‏69 KB

  • Function to get the last day of the current month

    Hi friends
    Now I need to know a function to get the last day of a month. I had between my notes that function but I do not find it and I think you can give the answer faster.
    Thanks
    Joel Pérez
    DBA Oracle

    I know emoticons are a bit naff but in the absence of a UBB markup to indicate humourous intent they do serve to indicate a joke. This is useful in a purely verbal domain like these forums, especially given that many participants don't have English as their first lanaguage and so often miss the wordplay.
    Cheers, APC

  • Function to get all the months name of a year from dual

    HI GURUS
    Is there any function to get all the months name of a year from dual
    thanks in advance

    What about this --
    satyaki>
    satyaki>select months_name
      2  from (
      3         select to_char(add_months(trunc(sysdate,'YEAR'),rownum-1),'MONTH') months_name
      4         from dual
      5         connect by rownum<=12
      6       );
    MONTHS_NAME
    JANUARY
    FEBRUARY
    MARCH
    APRIL
    MAY
    JUNE
    JULY
    AUGUST
    SEPTEMBER
    OCTOBER
    NOVEMBER
    MONTHS_NAME
    DECEMBER
    12 rows selected.
    satyaki>Regards.
    Satyaki De.

  • Date Function to get Previous week

    Is there a date function to get
    Let us say today is 23rd of Jun 2009
    I want a date function to get previous Thursday 18 Jun 2009
    and another function which get 7 days before which is Friday 12 Jun 2009.
    FYI: For the current week, I was able to use:
    select next_day(case to_char(sysdate,'Day') when 'Thursday' then trunc(sysdate-1) else trunc(sysdate) end, 'Thursday')
    from dual;
    select next_day(trunc(sysdate-7), 'Friday') from dual;
    I want something similar to that.
    Thanks

    No, not separate functions, but you can tweak next_day to get what you want:
    select trunc(sysdate) today,
           next_day(trunc(sysdate)-1, 'THURSDAY')-7 last_thursday,
           next_day(trunc(sysdate)-1, 'FRIDAY')-14 prev_2nd_friday
    from   dual;
    TODAY     LAST_THUR PREV_2ND_
    23-JUN-09 18-JUN-09 12-JUN-09

  • Is there any function module getting the cpu type?

    Is there any function module getting the cpu type?

    I guess the database server...
    I would like to get the SAP system cpu type as done in transaction st06 under system information.
    Thanks.

Maybe you are looking for