Number masking

Hi,
I am using Oracle 10 g.
I have a column of credit card numbers and i wanted the numbers to be masked. I want the first 6 numbers to be remain as it is along with last 4 numbers . The data between first 6 digit and last 4 digit should be replaced with xxxx
for example
---CVI-USD94.00/1234567891097193T/1115/N194940*34739292 ---update to CVI-USD94.00/123456XXXXXX7193T/1115/N194940*34739292
CCDC123456789109719/0213/A001781                                   -update to CCDC123456XXXXX9719/0213/A001781
---C AAA 1234567891234567 ---update to C AAA 123456xxxxxx4567
CCVI/1234567891097193D0613/N0000                                   update to CCVI/123456XXXXXX7193D0613/N0000
--CCVI/123456XXXXXX7193D0613/N0000                                   - Nothing to do
NONREF-YW12345                                                                nothing to do
---EXT000380801812 -- nothing to do
The length of credit card number can be any length but in all the cases it should only replace the value between first 6 digit and last 4 digit with xxxx
I can use the below mention query, for only 4th scenario
SELECT regexp_replace('-C AAA 1234567891234567','(.*?)([0-9]{6})([0-9]+?)([0-9]{4}$)','\1\2xxxxxx\4') FROM DUAL;
Note- I am not looking for Encryption or Decryption technology. This will be one time update in the table and the number of data in table runs in milions
so it has to search the table and update it wherever it is no present in above format.
Thanks in Advance
Edited by: sandm on Apr 13, 2012 5:33 AM

Exact one-to-one replace :SQL> l
  1  with t as (
  2  select 'CVI-USD94.00/1234567891097193T/1115/N194940*34739292' str from dual
  3  union all select 'CCDC123456789109719/0213/A001781' from dual
  4  union all select 'C AAA 1234567891234567' from dual
  5  union all select 'CCVI/1234567891097193D0613/N0000' from dual
  6  union all select 'CCVI/123456XXXXXX7193D0613/N0000' from dual
  7  union all select 'NONREF-YW12345' from dual
  8  union all select 'EXT000380801812' from dual
  9  )
10  select
11  str,
12  case
13       when p1!=p2
14       then p1||RPAD('x',lgth-length(p1)-length(p2),'x')||p2
15       else str
16  end rstr
17  from (
18       select str
19       ,length(str) lgth
20       ,regexp_replace(str,'^(.*?\d{6})\d*(\d{4}.*)$','\1') p1
21       ,regexp_replace(str,'^(.*?\d{6})\d*(\d{4}.*)$','\2') p2
22       from t
23* )
SQL> /
STR                                        RSTR
CVI-USD94.00/1234567891097193T/1115/N194940*34739292          CVI-USD94.00/123456xxxxxx7193T/1115/N194940*34739292
CCDC123456789109719/0213/A001781                    CCDC123456xxxxx9719/0213/A001781
C AAA 1234567891234567                              C AAA 123456xxxxxx4567
CCVI/1234567891097193D0613/N0000                    CCVI/123456xxxxxx7193D0613/N0000
CCVI/123456XXXXXX7193D0613/N0000                    CCVI/123456XXXXXX7193D0613/N0000
NONREF-YW12345                                   NONREF-YW12345
EXT000380801812                               EXT000380xx1812
7 rows selected.Might be a lot worse performance wise...

Similar Messages

  • External Phone Number Mask issue in CUCM 8.6

    I'm having an issue with External Phone Number Masks in CUCM 8.6
    Until recently our DID ranges were all in the 301-713-nnnn range.  Using the EPNM worked successfully providing CallerID.    We have now added some DIDs with the prefix 301-427.
    I have set the Route List Detail Configuration to:
    Use Calling Party's External Phone Number Mask*  Off
    Calling Party Transform Mask   3014279999
    However, when I run debug isdn q931 on the gateway the Calling Party Number = '3017139999'.
    It appears that the mask 3014279999 is being changed to 3017139999 by Call Manager,  but I do not know where this is happening.   
    I do not have any translation  or transformations set.

    Here is my understanding of the Caller ID.  You can set or change the ID in 4 places:
    1.  The DN - set the External Phone Number Mask on the DN on the phone device e.g. if the DN is 1234 and the EPNM is 301713XXXX , the caller ID becomes 3017131234
    2. The Route Pattern - you can check the box to use the EPNM set in 1 or leave unchecked and set a mask here in the same way as 1.   A mask set here will overwrite the mask in 1. In my case I want to use the EPNM and I have the option unchecked and no transformation
    3. The Route List (Route List Detail) - you can set Use Calling Party's EPNM to ON or OFF or Default.  ON means use the DNs EPNM.  If set to OFF you can set a mask here and this will overwrite the mask in 1. and 2.   I my case I have this set ON to use the DNs EPNM
    4. On the Gateway - on the endpoints you can set Caller ID DN in Call Routing Outbound Calls.  This setting overwrites the masks from 1., 2. and 3.   You need to reset the gateway (not just the endpoints) for changes to take effect.   In my case this is blank.  It did have a value of 301713XXXX.  When I removed this I failed to reset the gateway to the setting was still active causing my issue

  • External Phone Number Mask Question

    We have several phones with NonDID number on them.  Our route pattern is setup to use an external phone number mask of the sites main number (1112223333).  However on two of the phones, we would like to have a different number displayed (1112224444). We have tried to do this by entering this number (1112224444) into the extranal phone number mask of the DN on the 2 phone.  This did not work, the main number (1112223333) is still being displayed (caller ID).
    We know that we can just remove the external phone number mask from the route pattern and then enter one (external phone number mask) into every dn.  But, is there an easlier way to accomplsish this (there are currently 50 phones at this site)?

    Unless the checkbox for use the external calling party number is checked in the RP it's useless to set it on the phone.
    You're sending the main number because most likely the checkbox is unchecked and as you mentioned you have hardcoded that mask.
    Other than copying the RP, creating new partition and modifying CSS from those 2 phones, I would just check the checkbox on the RP and use BAT to change the external calling party mask on the DNs.
    HTH
    java
    If this helps, please rate
    www.cisco.com/go/pdihelpdesk

  • Want External Phone Number Mask to say "Unknown Caller" Is this Possible?

    When a user dials an external # is it possible to have it show on Caller ID as "Unknown Caller"?
    I have deleted the # that is currently in the External Phone Number Mask, and left it blank, but the Coporate# now shows when he dials out.
    This is something that only needs to be setup for 1 user, not the entire company.

    There will always be some number/name displayed. If you do not put in a number in the outside mask, the number/name associated with the smart trunk will be displayed.
    You might talk to your local phone company and see if they can restrict the numbers or a single phone number. If they can do that on even one number, you can put it into the mask for all of your phones.
    Two other problems you might have with this. One, a lot of people (I do) block calls from phones that do not display a phone numbers.
    Another problem you are going to run into is when someone calls "911" by accident. The Police/fire will try to call back to the number for the smart trunk. And since most often is not on a phone. They will send cars or trucks to the address listed for those smart trunks. Usually the billing address for your company.

  • Use External phone Number mask * Calling party Transform Mask @ Route patt

    Having an issue with CLID at RP level. Lets say I have two phones. One phone is configured with an External phone number mask of 1112223333 and the other one does not have an external number mask set. When a call is placed to the PSTN, Phone one needs to display its external phone number mask. Phone two since nothing has been added under external phone mask needs to be 1112224444.
    I configured the RP to "Use External Phone Number mask" and set the Calling Party Transform mask to 1112224444. I figured that if an external phone number mask was specified under the DN that it will route it to the PSTN and if nothing specified under the DN it will default to 1112224444 according to the setting in the RP.
    When I configured this, no matter what I do the calling party transform mask takes priority and the external phone number mask is never used. Is there a way around this? I tried it at the RL level and it does the same thing.
    Does anyone have any other ideas other than adding an external phone number mask for every phone.

    Thats what I thought. Why can't they add that as a feature in the next release of CM? It seems like it could be simple to do. Check for External Phone number mask, if nothing is specified, then check for calling party transform mask. If true set Calling Party transform Mask as CLID and route to RL or something like that..
    thanks

  • External Phone number mask

    I have to enter external phone number masks on a number of different phones. when I do this the number then appears on the top line of the LCD screen, can I stop this?

    Sorry, no, this cannot be changed.
    adignan - berbee

  • [POSDM] Credit card number masking

    Hi Experts
    We have a requirement to mask the credit card number on display (i.e. POS workbench) BUT show full card number on data level for BW data processing.
    I am able to mask the card number on display through the config below:
    Cross Application Component --> Payment Cards --> Make Security Settings for Payment Cards. (Masked Display and Encrypted When Saved)
    Appreciate if you can kindly guide me to the setting for allowing to show the full card number on data level.
    Moreover, I have searched in the note here that Installation of the encryption library "SAPCRYPTOLIB" is needed. Is it true?
    PCI Implementation - Logistics - SAP Library
    Thanks a lot for your help.
    Dominic

    Hi Lam,
    Your question is not clear,
    You can achive the BW data processing from following IMG settings,
    Here we can do the Enrichment/Modification of Data During Update to BW for masked credit card details,
    Credit card details in BW (POS ANALYTICS) can be achived from the below datasource,
    Thanks and Regards,
    Ramesh D

  • SSN number masking in SWIA transaaction

    Hi,
    The requirement Is to mask the SSN number in SWIA transaction,
    I would like to know how achieve it.
    Note: There are no Enhancements available, its 4.7 so no enhancement framework is also not available.
    Thanks in advance,
    Praveen

    You can use the following GuiXT script to mask that particular block
    del G[Selection Using Work Item ID]
    Kanagaraja L

  • Save a phone number without the input mask

    Hi,
    I actually have 2 related issues that I hope you might be able to help me with.
    I have a form linked to an interactive report, so when I click a record, the form is populated with the record's data. I just started using the new text field masked input plugin to handle phone number formatting, etc., which Patrick recommended.
    The plugin works nicely when a phone number being displayed from the source is 10 characters. The input mask I'm using is (999) 999-9999. However, I also have phone numbers in records that don't include the area code. When I select one of those records, the phone number field is blank. I would like it to display 999-9999, and be right justified. Is there an easy fix for that?
    My next problem occurs when I try to save the record. The process tries to save the phone number, including the mask, (14 characters), to the table. I only want to save the number to the table, excluding the mask. I'm sure there is a way to do this but I haven't found it yet.
    Thanks in advance for any help,
    Gary

    This is my solution to parsing the number only from the masked phone number:
    1) Create a field, 'P1_PHONE_MASKED', with a phone number mask: (?***) 999-9999
    2) Create a hidden Database Column like: 'P1_PHONE' It will initially hold the value of the record's phone column.
    3) create a javascript function in the page's before header section, between the space tags, to strip out all non-numeric values and update the hidden field:
    function remmask(src,tar){
    var mystring = $x(src).value;
    mystring = mystring.replace(/\D/g,'');
    $x(tar).value = mystring;
    4) Place the function call in the from in the HTML Form Elements Attributes of P1_PHONE_MASKED: onBlur="javascript:remmask('P1_PHONE_MASKED','P1_PHONE');"
    Now, anytime you change the value in P1_PHONE_MASKED, P1_PHONE gets updated with just the number values from P1_PHONE_MASKED.
    You can also add validation to the function to ensure that the length of the phone number is either 7, no area code, or 10, including area code. Normally, the mask should handle validation, but as you can see, to make this work, I had to make the mask more flexible, to allow for alpha numeric values in the first 3 positions and to allow for either 7 or 10 characters. Unfortunately, that means a user could enter something like XXX12 and the mask won't reject it.
    Partial solution to displaying ( ) 999-9999 in the masked input field P1_PHONE_MASKED when initially selecting a record for display.
    1) Make the Source Type for P1_PHONE_MASKED "SQL Query"
    2) Insert a query similar to the one below into "Source Value or Expression"
    SELECT
    CASE
    WHEN length(METAREPO.CONTACTS.CONTACT_PHONE) = 10
    THEN
    METAREPO.CONTACTS.CONTACT_PHONE
    WHEN length(METAREPO.CONTACTS.CONTACT_PHONE) = 7
    THEN
    '___'||METAREPO.CONTACTS_2011.CONTACT_PHONE
    END
    FROM METAREPO.CONTACTS
    WHERE METAREPO.CONTACTS.CONTACT_ID = :P1_CONTACT_ID
    This will display 7 digit phone nubers as follows: (___) 999-9999 in the masked field: P1_PHONE_MASKED.
    I wanted to use spaces between the () to make it perfect, but I'm unable to get this to work. I've tried things like:
    ' '||METAREPO.CONTACTS_2011.CONTACT_PHONE
    LPAD(METAREPO.CONTACTS_2011.CONTACT_PHONE,3,' ')
    Both of which work in PL/SQL Developer, but not in Apex. I believe this is because HTML collapses spaces by default.
    I would like very much to resolve this last issue. Any suggestions?
    Regards,
    Gary

  • Telephone Number Edit Mask in jsff

    Is there any adf component that supports telephone number masking?
    We already have a javascript for the TN masking feature. To put it to use we need to generate the HTML output like this
    <INPUT onkeypress=handleMaskKeyPress(this); oncut=handleMaskCut(this); onpaste=handleMaskPaste(this); id=rangeFrom onkeydown=handleMaskKeyDown(this); ondrag=cancelMaskEvent(); onkeyup=placeMaskCursor(this); ondrop=cancelMaskEvent(); onfocus=placeMaskCursor(this); onclick=placeMaskCursor(this); maxLength=12 onselect=placeMaskCursor(this); value=" - - " name=rangeFrom mask="###-###-####" autoComplete="off" cursorPos="-1">
    How to attach these custom attributes like mask and cursorPos along with client event handlers to <af:inputText />

    Hi,
    First say ur Jdev Version................
    U can validate in ADF in both Model and ViewLayer itself... In ViewLayer u can have Validators as regular Expression Validators
    Have a look into these first....
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_validateRegExp.html
    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31973/af_validate.htm#ADFUI827
    Regards,
    Suganth.G

  • Credit card number field in sales order

    Hi Friends,
    Can we configure this field so that it only retains the card number as xxxx1234 (last 4 digits.  Currently we have full visibility to customer card data to anyone who has SD display access in sales order.
    Thanks,
    Sree.Manam

    Sree,
    I'd suggest you have a look at OSS note 766703.  SAP has functionality for encrypting credit card number and note 766703 is an FAQ that references notes related to that functionality.  You'll find reference to notes that discuss how to activate the "masking" of the card number - which is what you describe.  Once you've implemented those notes you'll be able to have all execpt the last several digits of the card number masked with '*'.
    Regards,
    Eric Bushman
    VP, Solutions Engineering
    Paymetric

  • Serial number assignment in sales order

    Good afternoon,
    We have a requirement that we must assign a special number "mask" (<sequence number> - <sales doc item> - <sequence number per quantity>) in the moment of the raising of the sales order. I really dont know if in the standard we can do that. If not, is there an user exit that we can use in the sales order for such?
    Thanks in advance.
    Adriano Cardoso

    Hello Adriano
    Not fully sure about your requirement.
    But you can definitely assign Serial numbers to sales order items by selecting the item and  choosing  menu path Extras/Technical objects.
    Firstly you have to set up the Serial Number Profile ( T Code OIS2)  or use the standard delivered ones GG00/GG01. Both have the Serialization Procedure SDAU - Serial numbers in SD order and in case of GG00, the serial numbers are assigned automatically. I am not sure how automatic assignment works but you can test it. Of course, you need to specify the Profile  in the material master to use the functionality.
    Hope this helps.

  • Call Forwarding / Displayed Number on Forwarding target with H.323 Gateway

    Hi Community,
    i´m wondering if there is sort of a simple way to get this working properly.
    Scenario:
    Germany, variable dial plan, no fixed NANP, and we have ClipNoScreening ;)
    We use 0 for getting PSTN-dialing.
    We have internal DNs, for example a 6789, 4 Digits. We use external phone number mask on our lines, 123456XXX
    Our main number is 0123/456-xxx
    When i call outside everything is displayed fine on the called target, +49 123/456789.
    When i forward a call on my cellphone, with CFA target of 00111/222333444 (my cellphone example), and an internal colleague from within our office, is calling my office phone, everything is ALSO displayed fine.
    Now here comes the BUT:
    When someone calls from PSTN on my office-phone, i get displayed on my cellphone the +49 (0) 0xxxxxxxx, which means the caller number PLUS the added 0 from the gateway. Which is completely consequent and correct, since we add them on the gateway, when a call comes in, to be able to just answer directly on the office phone.
    The rule on the H323 gateway:
    voice translation-profile OUTGOING-VOIP
     translate calling 1
     translate called 2
    voice translation-rule 1
     rule 1 /^\(.*\)/ /0\1/ type subscriber unknown plan any unknown
     rule 2 /^\(.*\)/ /00\1/ type national unknown plan any unknown
     rule 3 /^\(.*\)/ /000\1/ type international unknown plan any unknown
    voice translation-rule 2
     rule 6 /4560$/ /6600/
     rule 9 /^456\(...\)$/ /6\1/
    voice translation-profile OUTGOING-POTS
     translate calling 3
     translate called 4
    voice translation-rule 3
     rule 1 /^00049/ /0/ type unknown national
     rule 2 /^0/ // type unknown subscriber
     rule 3 /^00/ /0/ type unknown national
     rule 4 /^000/ /00/ type unknown international
    voice translation-rule 4
     rule 2 /^00049\(.*$\)/ /\1/ type unknown national
     rule 3 /^000\(.*$\)/ /\1/ type unknown international
     rule 4 /^00\(.*$\)/ /\1/ type unknown national
     rule 5 /^0\(.*$\)/ /\1/ type unknown subscriber
    dial-peer voice 10456 voip
     translation-profile outgoing OUTGOING-VOIP
     destination-pattern 456.T
     progress_ind setup enable 3
     modem passthrough nse codec g711ulaw
     session target ipv4:<IP-OF-CUCM>
     incoming called-number .
     voice-class codec 1
     voice-class h323 1
     dtmf-relay h245-alphanumeric
     fax-relay ecm disable
     fax rate disable
     fax protocol pass-through g711ulaw
     no vad
     no supplementary-service h225-notify cid-update
    dial-peer voice 345000 pots
     tone ringback alert-no-PI
     translation-profile outgoing OUTGOING-POTS
     destination-pattern 0.T
     progress_ind alert enable 8
     progress_ind progress enable 8
     progress_ind connect enable 8
     port 0/0/0:15
     forward-digits all
    In case of forwarding the external call to an external device, like for example a cellphone, this is crap.
    Its obvious regarding the debugs all is working as designed ;), because my phone just forwards the full calling number including the added 0, since i put in to forward the originating calling DN.
    My question now:
    Can i simply correct this behavior somehow, also for international calls which would the 00 get added by the gateway?
    Many thanks in advance for some input,
    Andreas

    Hi Community,
    i´m wondering if there is sort of a simple way to get this working properly.
    Scenario:
    Germany, variable dial plan, no fixed NANP, and we have ClipNoScreening ;)
    We use 0 for getting PSTN-dialing.
    We have internal DNs, for example a 6789, 4 Digits. We use external phone number mask on our lines, 123456XXX
    Our main number is 0123/456-xxx
    When i call outside everything is displayed fine on the called target, +49 123/456789.
    When i forward a call on my cellphone, with CFA target of 00111/222333444 (my cellphone example), and an internal colleague from within our office, is calling my office phone, everything is ALSO displayed fine.
    Now here comes the BUT:
    When someone calls from PSTN on my office-phone, i get displayed on my cellphone the +49 (0) 0xxxxxxxx, which means the caller number PLUS the added 0 from the gateway. Which is completely consequent and correct, since we add them on the gateway, when a call comes in, to be able to just answer directly on the office phone.
    The rule on the H323 gateway:
    voice translation-profile OUTGOING-VOIP
     translate calling 1
     translate called 2
    voice translation-rule 1
     rule 1 /^\(.*\)/ /0\1/ type subscriber unknown plan any unknown
     rule 2 /^\(.*\)/ /00\1/ type national unknown plan any unknown
     rule 3 /^\(.*\)/ /000\1/ type international unknown plan any unknown
    voice translation-rule 2
     rule 6 /4560$/ /6600/
     rule 9 /^456\(...\)$/ /6\1/
    voice translation-profile OUTGOING-POTS
     translate calling 3
     translate called 4
    voice translation-rule 3
     rule 1 /^00049/ /0/ type unknown national
     rule 2 /^0/ // type unknown subscriber
     rule 3 /^00/ /0/ type unknown national
     rule 4 /^000/ /00/ type unknown international
    voice translation-rule 4
     rule 2 /^00049\(.*$\)/ /\1/ type unknown national
     rule 3 /^000\(.*$\)/ /\1/ type unknown international
     rule 4 /^00\(.*$\)/ /\1/ type unknown national
     rule 5 /^0\(.*$\)/ /\1/ type unknown subscriber
    dial-peer voice 10456 voip
     translation-profile outgoing OUTGOING-VOIP
     destination-pattern 456.T
     progress_ind setup enable 3
     modem passthrough nse codec g711ulaw
     session target ipv4:<IP-OF-CUCM>
     incoming called-number .
     voice-class codec 1
     voice-class h323 1
     dtmf-relay h245-alphanumeric
     fax-relay ecm disable
     fax rate disable
     fax protocol pass-through g711ulaw
     no vad
     no supplementary-service h225-notify cid-update
    dial-peer voice 345000 pots
     tone ringback alert-no-PI
     translation-profile outgoing OUTGOING-POTS
     destination-pattern 0.T
     progress_ind alert enable 8
     progress_ind progress enable 8
     progress_ind connect enable 8
     port 0/0/0:15
     forward-digits all
    In case of forwarding the external call to an external device, like for example a cellphone, this is crap.
    Its obvious regarding the debugs all is working as designed ;), because my phone just forwards the full calling number including the added 0, since i put in to forward the originating calling DN.
    My question now:
    Can i simply correct this behavior somehow, also for international calls which would the 00 get added by the gateway?
    Many thanks in advance for some input,
    Andreas

  • Creating a mask for field input

    I have a cfinput that requires the serial number for a piece of equipment.  The number is always something like J123M456789 where the J or the M could be any letter and the 123 and 456789 could be any number that is 3/6 characters.  The code i am using for my input is as follows:
    <cfinput type="text" name="IDnumber" message="You must enter an 11 character meter number" mask="A999A999999" validateat="onSubmit" validate="maxlength" required="yes" class="SERIAL"id="IDnumber" maxlength="11" width="240" minlength="11">
    I am still able to enter any number, any which way i choose. 
    Can anyone help?

    Woops, my bad
    Some of the validation is working.  It is forcing me to input a letter, 3 numbers, a letter and then numbers again.  The trouble is it will let me submit at any time.  In otherwords if I place 11 characters in the text field, they must be in the proper format however i cant get it to force me to enter exactly 11 characters.
    HELP!!!!!

  • Display Extension Number Instead of Switchboard Number

    Hi,
    We are using CUCM system in one of our branch office, we want to display extension number instead of switchboard number when we call external. But the telecom company said the dial information we send is "Unknown", need to be changed to "National Effective"... The voice gateway is C2951 and it's configured by vendor before; I can't find any configuration related to that, or maybe there wasn't any. Can someone help with this? Thanks.

    Make sure the phones have external phone number mask and under route pattern you have Use Calling Party's External Phone Number Mask - checked. Then follow the below to set the called party number plan:
    If its a MGCP gateway then under the route pattern>called party transfomrations> set the called party number type to local/national/international depending for the respective route pattern.
    Review: http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/admin/8_5_1/ccmcfg/bccm-851-cm/b03cldpt.html#wp1350852
    If its H323/SIP you can use translation rules. Review the below document:
    http://www.cisco.com/c/en/us/support/docs/voice/call-routing-dial-plans/61083-voice-transla-rules.html#type_plan
    -Terry
    Please rate all helpful posts

Maybe you are looking for