How to add a number to a tank?

Hi all

11.2.0.3.11

AIX6

I want to blur a PAN (char10) by inverting it and add 1.

for example: if my pan is 0010000000 = 0000000101

But if I run

Select reverse (pan) + 1 of test2;

101

The result is truncated.

Help, please

Thank you very much

MK

Here's an example that uses the hash. Hashes however has no resemblance to the original data type (e.g., number), or the size of the original type. However, it is very robust and almost impossible to return to its initial value (it can not be decrypted as it is not an encrypted value):

SQL> create or replace function HashToken( token string ) return varchar2 is
  2          hashRaw        raw(200);
  3  begin
  4          hashRaw := DBMS_CRYPTO.Hash(
  5                  src => UTL_I18N.string_to_raw( token,  'AL32UTF8'),
  6                  typ => DBMS_CRYPTO.HASH_SH1
  7          );
  8          return(
  9                  UTL_RAW.cast_to_varchar2(
10                          UTL_ENCODE.base64_encode( hashRaw )
11                  )
12          );
13  end;
14  /

Function created.

SQL>
SQL> select empno, hashToken(empno) as EMPNO_2, ename, hashToken(ename) as ENAME_2 from emp;

    EMPNO EMPNO_2                        ENAME      ENAME_2
---------- ------------------------------ ---------- ------------------------------
      7369 j/Q9fKLPQ6dCVX8WVnrO58BR4k4=  SMITH      vHC+fzgEbmTdd58nbOSiD5kVPyY=
      7499 rRJNLGFCLljjoyCDgY6ApawJSZ8=  ALLEN      bhyulhEv4kncD7T5oATJ3AQxVgg=
      7521 JvRFANpJd/kA3EByBKSEHEzNhMM=  WARD      fH8yQl+gdsru2XH1VJyC/6iP0Os=
      7566 aPQt5PUO42M5ld3tql46s/4dkrw=  JONES      oXhzUyATAtZcdESGwelAcJ/uDv8=
      7654 BvuWQZCZ3jbVDyIb58+BK1BI35E=  MARTIN    87m4ei83fABuk18y3SXqVev39VE=
      7698 lVTy4fuRuKS6r2YPwoiJAKKWvzc=  BLAKE      fN5Vs6bpz2ENsgC2ucybWtyhZX8=
      7782 yMQ93RpW9dkhmvk8PNgKv+B3BC4=  CLARK      T5DhA/rK3QeH16aCjwlvbmZZWkc=
      7788 5lb3Wwnh30yxrL+IcGL20gOZmGU=  SCOTT      djT9yAqkAnz9XpZqvBtrS06hn74=
      7839 T+/M/+ljq9VtNWQ1OPHHXgwM2Y0=  KING      ULijOfgquc5sVb+OoQ2thRPp0UI=
      7844 1KTe23LiAsS+aiR+/4e53kYVr7E=  TURNER    4EPj0+vdr6pe2X99zE0jYob4rUo=
      7876 Xw8u1RpZIsHOGawJepxO7vVxpr0=  ADAMS      LS6yfh24g25EzU6U9YuJcoMx6N4=
      7900 NNUKH1bET552ol04d4qdqStL8n4=  JAMES      avxErzy9u2cY6NqHFaGVa4ldxdI=
      7902 090VmzHaIzD15LmqG6uZg2ttPRk=  FORD      flsH2Lu14KVbXUKEdtRpGz7pe0o=
      7934 g4zo8/4ZT6Zw0UTXOMZdKSdfLBw=  MILLER    JdWuOw4NrFEbqU4ze4jgiHU4sx8=

14 rows selected.

SQL>

This hash really won't work for columns that are not varchar, or too small.

An alternative is to use a sequence in a mapping table. The table mapping maps a PAN such as a sequence value. Then use the mapping table to replace all the column values of PAN with sequence values - while maintaining referential integrity and so on. For example

SQL> create table mapping(
  2          old_empno primary key,
  3          new_empno
  4  ) organization index
  5  nologging as
  6  select empno, rownum from emp;

Table created.

SQL>
SQL> select * from mapping;

 OLD_EMPNO  NEW_EMPNO
---------- ----------
      7369          1
      7499          2
      7521          3
      7566          4
      7654          5
      7698          6
      7782          7
      7788          8
      7839          9
      7844         10
      7876         11
      7900         12
      7902         13
      7934         14

14 rows selected.

SQL>
SQL> create table dev_emp
  2  nologging as
  3  select
  4          cast(e.new_empno as number(4)) as EMPNO,
  5          s.ename,
  6          s.job,
  7          cast(m.new_empno as number(4)) as MGR,
  8          s.hiredate,
  9          s.sal,
 10          s.comm,
 11          s.deptno
 12  from       emp s,       -- source
 13          mapping e,      -- id for employees
 14          mapping m       -- id for managers
 15  where      s.empno = e.old_empno
 16  and        s.mgr = m.old_empno (+);

Table created.

SQL>
SQL> select * from emp order by ename;

     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
      7876 ADAMS      CLERK           7788 1987/05/23 00:00:00       1100                    20
      7499 ALLEN      SALESMAN        7698 1981/02/20 00:00:00       1600        300         30
      7698 BLAKE      MANAGER         7839 1981/05/01 00:00:00       2850                    30
      7782 CLARK      MANAGER         7839 1981/06/09 00:00:00       2450                    10
      7902 FORD       ANALYST         7566 1981/12/03 00:00:00       3000                    20
      7900 JAMES      CLERK           7698 1981/12/03 00:00:00        950                    30
      7566 JONES      MANAGER         7839 1981/04/02 00:00:00       2975                    20
      7839 KING       PRESIDENT            1981/11/17 00:00:00       5000                    10
      7654 MARTIN     SALESMAN        7698 1981/09/28 00:00:00       1250       1400         30
      7934 MILLER     CLERK           7782 1982/01/23 00:00:00       1300                    10
      7788 SCOTT      ANALYST         7566 1987/04/19 00:00:00       3000                    20
      7369 SMITH      CLERK           7902 1980/12/17 00:00:00        800                    20
      7844 TURNER     SALESMAN        7698 1981/09/08 00:00:00       1500          0         30
      7521 WARD       SALESMAN        7698 1981/02/22 00:00:00       1250        500         30

14 rows selected.

SQL> select * from dev_emp order by ename;

     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
        11 ADAMS      CLERK              8 1987/05/23 00:00:00       1100                    20
         2 ALLEN      SALESMAN           6 1981/02/20 00:00:00       1600        300         30
         6 BLAKE      MANAGER            9 1981/05/01 00:00:00       2850                    30
         7 CLARK      MANAGER            9 1981/06/09 00:00:00       2450                    10
        13 FORD       ANALYST            4 1981/12/03 00:00:00       3000                    20
        12 JAMES      CLERK              6 1981/12/03 00:00:00        950                    30
         4 JONES      MANAGER            9 1981/04/02 00:00:00       2975                    20
         9 KING       PRESIDENT            1981/11/17 00:00:00       5000                    10
         5 MARTIN     SALESMAN           6 1981/09/28 00:00:00       1250       1400         30
        14 MILLER     CLERK              7 1982/01/23 00:00:00       1300                    10
         8 SCOTT      ANALYST            4 1987/04/19 00:00:00       3000                    20
         1 SMITH      CLERK             13 1980/12/17 00:00:00        800                    20
        10 TURNER     SALESMAN           6 1981/09/08 00:00:00       1500          0         30
         3 WARD       SALESMAN           6 1981/02/22 00:00:00       1250        500         30

14 rows selected.

SQL>

There are a number of variations on this approach that can be considered to be based on what must be hidden and volumes of data involved.

Tags: Database

Similar Questions

  • How to add the number of records at the foot of the page in the file

    Hello

    I need to get the number of footer lines in the file.

    I need to format footer below

    County: 14.

    How can I achieve this?

    Thanks for your ideas.

    Sébastien.

    Another option which is independent of the operating system would be to

    (1) put in place a refreshing variable that returns the number of rows

    (2) use the OdiOutFile tool to add the result at the end of the file required by passing the variable as the value in the TEXT of the tool parameter

  • How to add serial number

    Silly, but strange. I installed Acrobat XI and I was waiting for the serial number to come through e-mail after validation through Adobe. So I clicked on the "trail" version, thinking that I would like to add the series record subsequently through the HELP menu or similar.

    However, I can't find such a facility in the menu items. Do I have to wait until the end of the period of 30 days trail, wait to be asked and then enter my serial number for registration? It seems strange.

    Hi micaelas18599957,

    Please visit the link mentioned for details on how to activate Acrobat XI with the serial number below:

    Installation and activation of a product to try to buy &

    In addition, you can consult the following link to find your serial number:

    Quickly find your serial number

    Checking on your side now and then let me know if you need more assistance.

    Kind regards

    Ana Maria

  • How to add the number of the column by another county sql statement

    My problem is

    SELECT Count (DISTINCT num) OF tmp_table;

    the foregoing will return 13.


    UPDATE seq_table a SET a.currentvalue = a.currentvalue + 1 + (SELECT Count(DISTINCT num) FROM tmp_table;)  WHERE a.seq_type LIKE 'ABC% ';

    the result of updating should be = a.currentvalue + 1 + 13

    How is that possible? There is syntax error...

    Not sure if this was clear ;-), but there's a semicolon behind tmp_table and SQL does not understand that.

    Then

    UPDATE seq_table SET a.currentvalue = a.currentvalue + 1 + (SELECT Count(DISTINCT num) FROM tmp_table) WHERE a.seq_type LIKE 'ABC% ';

  • Add the number of rows

    Hello

    I am trying to get the character kerning to our document's report. I made the script without the number of lines, can you please guide me "how to add the number of lines with this script.

    Screen shot 2015-01-02 at 5.26.04 PM.png

    ~ Set variables

    myDoc var = app.activeDocument;

    var myDocPath = myDoc.filePath;

    var myDocName = myDoc.name;

    FND = new Array();

    FoundContents = new Array();

    totalArray = new Array();

    Try

    {

    var myColor = app.activeDocument.colors.item("KER").name;

    }

    catch (MyError)

    {

    myColor var = app.activeDocument.colors.add ();

    myColor.name = "URL";

    myColor. model = ColorModel.process;

    myColor.colorValue = [15, 100, 100, 0];

    }

    ~ End set variables

    Table start to search for URLS and apply color

    var doc = app.activeDocument,

    _stories = doc.stories;

    for (var i = 0; i < _stories.length; i ++)

    {

    var character = _stories [i] .characters;

    for (var j = 0; j < characters.length; j ++)

    {

    If (characters [j] .insertionPoints [-1] .kerningMethod! = "Metrics" & & .kerningMethod of characters [j] .insertionPoints [-1]! = "Optical")

    {

    If (characters [j] .insertionPoints [-1] .kerningValue < = - 51)

    {

    the characters [j + 1] .fillColor = myColor;

    characters [j] .fillColor = myColor;

    }

    }

    }

    }

    reportPage = new Array();

    reportContents = new Array();

    app.findTextPreferences = app.changeTextPreferences = null;

    app.findTextPreferences.fillColor = myColor;

    var myFoundColor = app.activeDocument.findText ();

    for (f = 0; f < myFoundColor.length; f ++)

    {

    var myFoundPage = myFoundColor [f] .parentTextFrames [0].parentPage.name;

    FND.push (myFoundPage)

    var myFoundContents is myFoundColor [f] .silence;.

    FoundContents.push (myFoundPage + "\t" + myFoundContents + "\r")

    }

    Try this,

    //~ Define variables
    var myDoc = app.activeDocument;
    var myDocPath = myDoc.filePath;
    var myDocName = myDoc.name;
    
    var result = [];
    try
    {
        var myColor = app.activeDocument.colors.item("KER").name;
        }
    catch(myError)
    {
        var myColor = app.activeDocument.colors.add();
        myColor.name = "URL";
        myColor. model = ColorModel.process;
        myColor.colorValue = [15, 100, 100, 0];
        }
    //~ End define variables
    //Array start for find urls and apply color
    var doc = app.activeDocument,
        _stories = doc.stories;
    for(var i=0;i<_stories.length;i++)
    {
            var characters = _stories[i].characters;
            for(var j=0;j
    

    Kind regards

    Cognet

  • How to add ID/batch number in the naming of the batch summary report and STD files generated by the sequence editor of

    Hello

    How to add an Id(which is inputted in the Configure Lot Setting) a lot in the naming of the batch summary and report STDF files generated by the Test Module of the semiconductor.

    Currently the default name is shown in the excerpt below

    Thank you

    Rovi

    Hi Rovi,

    Have you tried the recall of ConfigureLotSettings or some of the steps listed in Cusomizing behavior for batch parametersof edition?

    Kind regards

    John Gentile

    Engineering applications

    National Instruments

  • How to add contacts to my Apple Watch?

    Can someone explain how to add contacts to my Apple Watch 2, watch OS 3

    Hello

    Apple Watch is not a Contacts application and it is not possible to create new contacts on your watch.

    When make calls or send new messages, existing between in contact with instead are selectable via the phone and applications or Messages using Siri / the microphone to dictate a phone number:

    Instructions are available here:

  • How to increase the number of addresses in the BCC field?

    How to increase the number of addresses in the BCC of email field?

    What do you mean by increase in the number of addresses?  The CCC line will continue to accept addresses that you add them in there. Keep just by typing in the addresses separated by a semi colon ";

  • Add serial number in the Bios

    Hello, is it possible add serial number in the Bios information?

    I have a 1323el dv6

    You can try this (totally not tested by me):

    http://www.diypcguide.com/how-to-fix-system-board-OOA-or-missing-system-information-or-product-information-not-valid-HP/

  • How to increase the number of entries in MAC

    Hi everyone, I have a WRT 1900AC and I've reached the limit of 32 entries of MAC for filtering options, we have many more users who must be saved from MAC, anyone know how to increase the number of entries please?

    Tanks a lot, im going to read the info in the links, then ill try
    Tanks for help!

  • For a given file, how to add and change file properties on the Details tab, for properties that are not in the properties list?

    Now, I am aware of the modification of the properties of the file is simple in Windows 7 Explorer. Select a file, 'Properties', then tab "Details".  Some are not editable, and that's understandable.  Click on next to any area classified as year, Genre, Publisher, etc. and the apply.  No problems so far.

    Then of course in Explorer, when you right click on a column header, you get several choices of column beyond the usual that is displayed by default; Date, the Type, size, etc.  But, there is an option "More...", which has up to now, MUCH more useful properties to choose from, such as the model project, Department, job statusand so on.

    It's fantastic!

    But when you look into the details of any given file, none of these additional properties even are listed to be edited.  Why offer to view these details, if you don't change them, or add them to different files?  I must be missing something.  I do not need to add my own custom details, this additional list has a choice, that I need; If only I could edit the files to get this info.

    How to add and change these properties to files?  Word, Excel, MP4, AVI, JPG; I would add these properties, so I can set directly in the Solution Explorer, as you would by name or Type.

    Any help would be greatly appreciated!

    My experience is that most of these 'extra fields' no existence not as fields in the directory (folder) itself.  On the contrary, these fields exist in the target file itself. Each file type has its own format and established file except for the types of files that belong to Microsoft, Microsoft cannot control or arbitrarily change the format of a particular file type.

    For example, a ".jpg" file  The format of this file type allows a large number of areas such as comments, Tags, date taken, opening, device manufacturer and so on.  If you go into the properties on a .jpg file, you will see a lot of them and will be able to change.  After changing any of these fields, you will find that the file itself has been changed to contain this information (as can be verified by the parity of the file and to come check upward with a different checksum).  If you display one of these fields in Explorer and 10000 ".jpg" files in this folder, then Explorer must open each of these 10000 files to extract the data in the corresponding fields, you have chosen to display.  May take some time.

    Compare that to the same picture saved to a file ".bmp".  The ".bmp" format has no provisions for any of these fields, so you will not be able to view, save, edit, or sort by them.  If the editable fields are directly related to the type of file that is displayed.

    Microsoft has apparently interviewed a lot of file types and made a compilation of the editable fields in each type of file and the Union of the selected fields in which can be displayed and modified.   That's apparently what you see in the option «More...» ».   So, in summary, the file type determines which fields are available for editing and posting.

    HTH,

    JW

  • How to add libraries and Outlook to Windows search

    Win 7 64 bit (fully updated)

    For a few days the Windows Indexing has been crashing. Newspapers reported the index have been corrupted soon after it was created. I tried to disable the indexing of power off of the search, the system restarts and to restart the two once again a number of times without success. Convenience store reported an issued but did not define what it was. I decided to cut the search locations, and then add them back one by one. This process seems to have solved the problem (so far), but I have two problems:

    (1) I don't see how to add Outlook to the windows search index locations (it existed)

    (2) above, when you search for files by using the search box I might look for *.mp3 (for example).

    This would produce a result filed under the title "Music" (the categorization is probably by library) that the search box has been filled.

    Now I search for *.mp3 and it lists FAR FAR fewer files as the search request is typed and those it lists are in the section "FILES" (they are not yet classified files in my library of music).

    If I click on "See more results" are lists all the mp3 files in a window (i.e. indexed, but are not displayed and is summarized as the search are requested).

    My guess is that this issue is the result of the libraries are not included in Index locations. If it is correct, how can I get my library back in indexed locations?

    Solved.

    The fixit 'difficulty Windows Desktop Search when it crashes or not show results"available here;

    http://support.Microsoft.com/FixIt/

    solved the problem of mp3 filese appearing as search results are typed and added Outlook on search locations.

    After execution, it is necessary to add search by default return locations.

    I have a very strong suspicion that CCleaner caused search crashing. If you have the problem, try to uncheck options related to the MS Search and traces of indexing on the Applications of CCleaner tab then repair search.

  • How to add a VLAN to trunk on Cisco SF200-24 port

    Hi all

    I have question want to ask:

    I have Cisco switch SF200-24, I want to Setup VLAN as below:

    1 to 10 of Harbour = Vlan 100

    11 to 21 Harbour = Vlan 200

    22-24 Harbour = Vlan 300

    Port GE1 = Trunking (primary)

    Port GE2 = Trunking (secondary)

    How to add all the VLAN 100, 200, 300 go through primary and secondary circuits?

    What port should I connect to management switch?

    Thank you

    > How to add every VLAN 100, 200, 300 go through primary and secondary circuits?

    first set the ports as trunks via the "VLAN management'-> 'Settings of the Interface' - click on the corresponding port, click on the button"Edit"and select"Trunk"in the list.

    Once these (GE1 and GE2) ports as trunks, you can now assign all the VLANS you want through "Management of VLAN"-> "a Port VLAN membership." Select the first port (GE1), click on "join the VLAN" and select VLAN all desired from the list on the left and put them in the list on the right.

    and you're done.

    > Which port I can connect to management switch?

    the default management IP switch is part of the default VLAN1. If you want to keep access to the switch, assign "VLAN1" to one of the ports of access, or change management VLAN number other than 1 - but in this case remember to apply the correct IP settings in order to satisfy the subnet assigned to the new VIRTUAL LAN.

  • How to add more than one VPN in an existing VPN config

    Dear team

    I would like to ask your help fast... am not a Cisco guru, but I would like to know if I can get help on how to add a VPN to an existing one. My company already implemented a VPN site to site with a dealer or partners where they are or sharing some data them and make transactions, but the question is, I am now about to add 2 several other company so that I can create another tunnel VPN to each of them without risk of breakage or unplug the old one that is running. How can I do, can someone help me to implement it?

    Thanks in advance for your help.

    use Cisco 1841 version 7.

    1. now I want to know, is who should I ask for an IP access list? Should I create or I have to ask my partner to put it for me so I can put it in.

    The access list consists of the IP / subnets on your local network and the Remote LAN.  If the source of the ACL will be your local LAN and destination will be the Remote LAN.

    access-list 101 extended allow ip

    2. is the name given by my partner transfer or I have to create it myself.

    The name of game of transformation is locally important.  However, it specifies the encryption standards 2 phase so this part will have to be coordinated with the peer.

    Crypto ipsec transform-set RIGHT aes - esp esp-sha-hmac

    in the foregoing turn together, RIGHT is just a big local name so you can reference it in a card encryption.  ESP esp-ae-sha-hmac is the part of encryption that should be agreed between you and your counterpart. According to the image that you posted would use you esp-3des esp-sha-hmac.

    3. because I see that the strategy of the first customer VPN (partner) is set on 10 policy should I do also each VPN on 10 policy or the policy number is not serious.

    The policy number is a sequence number and is matched in a top to bottom fashion until a match is found.  If no match is found, then Phase 1 will not end and establish the tunnel.  This is important if you have several peers and some of them use different phase 1 settings.  If this is the case, you will need to use different sequence for each policy numbers.

    4. I have also seen that we have life time security association 2 phases one to use?

    Both are used, and they are both at their default values, you don't need to do any configuration for those.

    --

    Please do not forget to select a correct answer and rate useful posts

  • BlackBerry Smartphones BB8330 Bell v4.3.0.124 - how to add a '1' to the Canada or US long-distance numbers withput the smart dial option?

    Hello... I called Bell to find out how to add a 1 to my long distance numbers and they said go to options > numbering however my BB8330 has no chip / or display option smart dial under "options".  Currently my long distance numbers are programmed in contacts showing the 1-800-XXX-XXXX but when I dial number, the screen don't watch not '1' operator said that the number cannot be completed as composed, please check the number and dial... which means I actually have to dial the number with a '1' myself.  It's a pain.  What is the point of store the reference long distance with a '1' if I have to do this all the time?  Someone at - it a response?  Yet ONCE... my phone is not smart dial option. I tried to find it under other headings, but not luck and can't find anything online that helps so far.

    Thank you!

    Your phone has the option of smart dial.  From the home screen press the green phone button.  Then press menu button (to the left of the trackball) and go to Options.  Then select Smart dial.

Maybe you are looking for