How to update the password on the other table based on the mod

Hello

I need to update the password for the other table based on the mod.

I have two table 'user' and 'reset '.


User:

Username username password date_exp

s232322 Bobby John sdds4545df4r 10/12/2010
s454566 George Bill f444556gh76 07/14/2010
s343466 Bill Clinton fgf54tyujkkkhj 06/12/2011
.
.
.


Reset:

Series encrypt decrypt

fgf5656fg 0 Watellemon
1 dfggf5665 lime juice
dfdffd545 2 applesalad
3 54r4gggt airlines
construction of 4 hg44hh63
5 fgf4343yh security
.
.
.

How can I update the password of a table to another table "reset"?

Ex: query

Update user set password = (select Encrypt reset where mod (length (username), 10))


If mod (length (username), 10) is 0, it should take series "0" encrypt the password and update the password in the table "user".
If mod (length (username), 10) is 1, it should take serial '1' encrypt the password and update the password in the table "user".
If mod (length (username), 10) is 2, it should take series '2' encrypt the password and update the password in the table "user".
If mod (length (username), 10) is 3, it should take series '3' encrypt the password and update the password in the table "user".
If mod (length (username), 10) is 4, it should take series '4' encrypt the password and update the password in the table "user".
....


Please help me write an update query.




Thank you
Nihar

Hi, Nihar,

You almost had it! You just need to correlate the subquery for the main UPDATE statement, like this:

UPDATE     user_table     u     -- USER is a built-in function; it's not a good table name
SET     password = ( SELECT  encrypt
               FROM    reset     -- RESET isn't a very good table name, either
               WHERE   serial     = MOD ( LENGTH (u.username)
                                         , 10
                               )
             );

Tags: Database

Similar Questions

  • How to update the model of RDS for Windows Server 2012 collection?

    Hi team,

    I want to know how to update the collection of RDS model (model master sysprep) which is used to create the collection?

    I tried the below way but did not get the update of the collection of virtual machines.

    -Start the image of mater of sysprep

    -install the required components

    -resysprep the image and stop it

    -East went to the RDS Collection and added new virtual machines in collection (removed the old his)

    Once created, I opened a session in the machines, but I don't see the updates (I installed some software in the sysprep image however and no is not there in the virtual machines in the pool)

    Can someone let me know if I need to create a whole collection again or the way I do it is a proper way? If it's a good way what could be the reason why I get the new installed software model sysprep image in virtual machines created in the pool, based on the model?

    How do we actually updated for security and other regular patches updated in virtual machines? In my view, we use the same approach?

    Any suggestions will be appreciated.

    Kind regards

    original title: Windows Server 2012 RDS - model Sysprep update process and collection of creation

    Hi MS Expert 2010,

     

     

    I wish that you post your question in the TechNet Forums as it is addressed to an audience of it professionals.

     

    Check out the link-

     

     

    TechNet Forums

     

    Hope this helps!

     

  • How to update the drivers NVIDIA for Pavilion dv6755el.

    Hi, I know it please tell how to update the video card driver, in which rirectory GB installed, because I stood Blue Shield and microsoft has identified that the video card driver is not updated, I followed the procedure of upgrading HP but found no drivers. ? I downloaded directly from NVIDIA updated for my card, but I can't find where the original, but the installer says C:\Nvidia... Thank you

    I don't think it's asking you where to install, it can ask for a place to decompress the files, so just say ok the location by default, he suggests. If the installation does not continue after developing files, switch to that folder where it expanded their and find the Setup, the exe file and run it.

    .

  • refresh rate... How to update the drivers for the monitor in Vista

    How to update the drivers for the monitor in Vista

    You are welcome.

    Normally, you go to the Web site of the pre-installed drivers.

    But, if you have any problems, andf Forum hardware drivers is the best place to ask.

    See you soon.

    Mick Murphy - Microsoft partner

  • How mass update the display name for a group of existing emails?

    We were recently acquired and at the end of April will undergo a change of name of company official. Is there a way to mass update the display name for all or most of the emails without manual update of each individual file in the details by email? I know how to update the name of the company in the configuration > system management > company display settings > name of the company; However, this is only the default display name for e-mail messages that are created from that moment. It is not to update existing records, as I understand it. This will be a huge pain updates of each email for each existing campaign in the program generator, so if there is a solution, please let me know!

    sc * 2799241 * tr-j' thought that this might be the case. We will make do. Thanks for your reply.

  • How dynamically update the role of oracle using the trigger

    How dynamically update the role of oracle using the trigger:

    I have svmanger owner of schema in the database. There are five tables belonged to svmanager.

    Table A, B, C, D, E.

    I have a role that is played only to these tables under the scheme: SVMANAGER_READ_ONLY

    now, if I create a new table F under svmanager. the role that svmanager_read_only does not work is updated, so the user had assigned role cannot access table F.

    is there a way to create the trigger for this role dynamically update any when a table is created or deleted?

    Thank you.

    I really really really don't suggest to do this - it's a bad habit. If possible I'd just adding the grant as part of the steps to the role on the new creation of the table.
    But for fun here's how you can accomplish this:

    create or replace procedure execute_grant(v_ddl in varchar2)
    is
    begin
       execute immediate v_ddl;
    end;
    /
    
    create or replace trigger catch_create_table_trg after create on schema
    DECLARE
    
    ddl_job number;
    ddl_str varchar2(50);
    begin
       IF ora_dict_obj_type = 'TABLE' THEN
    
           ddl_str := 'GRANT SELECT ON '||ora_dict_obj_owner||'.'||ora_dict_obj_name||' TO SVMANAGER_READ_ONLY';
    
           dbms_job.submit(job => ddl_job,
           what => 'execute_grant(''' || ddl_str || ''');',
           next_date => sysdate+(5/24/60/60));
    
       END IF;
    end;
    /
    

    Test it

    create table F (id number(1));
    

    Validate

    select * from ROLE_TAB_PRIVS where ROLE = 'SVMANAGER_READ_ONLY';
    
  • How to disable the mode full screen

    The toolbar has disappeared. Can you tell me how to disable the mode full screen? Apparently this is going to give back me the toolbar.

    F11 activates / deactivates the mode full-screen.

    Versions of Firefox 3.6 + have a feature to allow the user to hide the Menu bar.

    Press the Alt key to temporarily show the Menu bar, then open view > toolbars and select menu bar, so it has a check mark.

    The F10 can also be used on most PCs to temporarily reveal the menu bar.

    https://support.Mozilla.com/en-us/KB/menu+bar+is+missing

  • How to disable the Mode wheel on a scientific calculator, HP 17 b

    Hello - this is my first post on this forum. I am a new user of the scientific calculator, HP 17 b (our office prefers to use this older version of the calculator). I would like to know how to disable the mode wheel. If anyone can help?

    Thank you very much

    PV

    Hello

    I would just add that even if the 17B is labeled as a "business/financial calculator", the Solver is powerful enough:

    fun with the HP-17b:
    http://www.hpmuseum.org/cgi-sys/CGIwrap/hpmuseum/archv020.cgi?read=185590

    Random number generator:
    http://www.hpmuseum.org/cgi-sys/CGIwrap/hpmuseum/archv019.cgi?read=160386#160386

    sum the digits of a number (see the last message):
    http://www.hpmuseum.org/cgi-sys/CGIwrap/hpmuseum/archv020.cgi?read=206484

    calculate the checkDigit for HP-17b:
    http://www.hpmuseum.org/forum/thread-4432.html

    What follows is mentioned for the 17BII, but may work on the 17b:

    Mark N-ladies:
    http://www.hpmuseum.org/cgi-sys/CGIwrap/hpmuseum/articles.cgi?read=1025

    MM INCHES, M-FEET, MILES KM conversion:
    http://www.hpmuseum.org/cgi-sys/CGIwrap/hpmuseum/archv020.cgi?read=198391

    Best regards.

  • How to activate the mode without failure in a game?

    U see sometimes games run faster in mode safe & probably, I like it but I don't know how to activate it in gaming applications only in games ok?

    How to activate the mode without failure in games?

    AI

    Most of the games do not work in safe mode, because safe mode loads only the system drivers and not the games so it is really moot to wonder if he would run faster.

    You can start in safe mode by pressing F8 during startup. You will see that the game does not load again.

  • using LIVE MAIL in Windows 7, the drafting by email, I'm in 'Overtype' mode and I don't want that. Anyone know how to disable the mode 'Overtype '?

    using LIVE MAIL in Windows 7, the drafting by email, I'm in 'Overtype' mode and I don't want that. Anyone know how to disable the mode 'Overtype '?

    by pressing the key on the keyboard switches between "insert" and "crush" I think.

  • Can Tecra 9100-how I update the graphics card?

    Hallo,

    I have a S3 Graphics Supersavagecard 16.0 MB display memory.

    It is not enough to play a game.

    How can I upgrade or buy nested one?

    Hope you can help me.
    Thank you
    Fabidou

    Hello

    Usually it of not possible to update the graphics card. You can't compare the laptop and desktop pc technology. The graphics card on the laptop is a small chip that attaches to the motherboard.
    Please read some other assignments in the forum on this topic

    Good bye

  • How to update the codec on laptop computer 2 open my files downloaded from the camcorder

    I recently bought a Sony HDR-TG7VE camcorder and have downloaded the software for it on my laptop, but I am not able to open the files after uploading video clips on my laptop.

    I contacted Sony and they said there is a problem with my laptop and I need to contact Toshiba to update the Codec.

    The message I get is "Windows cannot open this file. To open this file, windows needs to know what program you want to use to open it. Windows can go online to search automatically, or you can manually select from a list of programs installed on your computer.
    What do you do - use the web service to find the appropriate program
    -Select a program from a list of installed programs.

    I use windows vista business 32-bit operating system.

    The camcorder is an HD camcorder.

    It's really irresponsible response this manufacturer, cam.
    They offer products and they need to take care of you with that. It is logical that the recorded files should be open on every desktop or laptop PCs.
    According to their logic everyone who ACE this cam and who want to watch movies on PC should contact PC manufacturers support. It's really crazy.

    I don't know anything about this cam but normally you should have a few dist software with software that can help you to watch the movies or perhaps to convert files in other format and watch movies with standard players like Windows media player or VLC player.

  • How to update the drivers

    How to upgrade drivers for windows 7?

    Hi John,.

    Thanks for posting in the Microsoft community.

    John, I understand you want to know the method to update the drivers on your Windows 7 computer.

    There are 2 ways you can update the drivers.

    Method 1:

    You can visit the manufacturer of the peripheral site and download the drivers for the model you own. You can then double-click on the file and install the drivers.

    Method 2:

    You can use the automatic update option in Windows to update the drivers.  Visit the link and follow the steps which provides article.

    Update drivers: recommended links

    http://Windows.Microsoft.com/en-us/Windows7/update-drivers-recommended-links

    You can also check this link for more information.

    Updated a hardware driver that is not working properly

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    Let us know if you need additional assistance.

  • How you update the document in your model agreement with all changes made in Adobe sign?

    Hello

    I successfully Setup Adobe sign in my sandbox SFDC, created templates with merge mapping and mapping of data... it's all coming together nicely.

    I start sending an agreement, click on "Preview of the signed document or position fields", update all the fields in my agreement (define the length of field, drop down / drop-down list of values... etc.) and send my agreement must be signed. My question is: how to upgrade the document in the model to account for all of the updates I just did this document/contract? I do need to update the fields whenever I send the agreement?

    As long as a Salesforce administrator I was looking for in Salesforce for the answer, but I didn't know that you can add templates to Adobe sign on the dashboard. Once you add a template, you can change all the fields of the form (and the formulas, rules of validation... etc) from the tab 'manage '.

  • How to update the name of the provider

    We have employees and suppliers. The type of provider that "'provider used to process the payment of fees in internal employees" "

    Now we have updated the existing employee environment. Now, how to upgrade the provider with the middle name. Is there a standard competitive program updated the supplier according to the employees.

    There is an emergency room that will be shared with you earlier for standard provider, but to employees type provider, you can run 'Employee-update program'.

    This program at any time update the provider name of type used in the corresponding employee records. The program updates only the provider name (the name of the employee update).

    Two following information is not automatically updated:

    1. home and Office Supplier site addresses (update of office location and address employee home)

    2. Inactive Date field for the provider and for the sites of suppliers (updated if a termination date has been entered)

    If the program updates all records, it produces a report that lists each employee who has been updated by the program provider. It lists the previous value and the value of the new, updated. The report is sorted by provider name.

    Thank you

    Oubous khalid

    NOTE: If you consider your question/problem answered/resolved, please, rate this answer as Correct or useful.

    This will help for the rest of the guests to easily find the correct answers. Thank you!

Maybe you are looking for

  • Drive recovery system for Satellite L40

    My sister recently bought a Satellite L40, what it was asked was, is the Windows Vista restore disk provided with the laptop as the system recovery disk, or if she needs to burn a separate recovery disk and how she was going to do this. Thank you

  • W32tm Windows Server time is off by 3 minutes. Perhaps.

    I have my Windows servers get their time to our primary domain controller, which is configured for synchronization with 0.north - america.pool.org. If I make one w32tm /stripchart /computer:0.north-america.pool.org Time that all the computers are on.

  • Wireless series ENVY 110: invitation envelopes printing

    I use Print Shop on my MAC computer.  I would like to address the envelopes of invitation on the ENVY 100 printer.  He said to me that I use paper wrong size when I put the envelopes in the printer. How to program the printer to accept E-6 envelopes?

  • BlackBerry Smartphones Heellpp! Locking my Blackberry

    Hello, I'm new to BlackBerry, and I want to know how to password lock my Blackberry Torch. I put a password, but I assumed that it did not close the phone when I pressed the lock button on the top of the BlackBerry. But, I have to select "Password lo

  • Unable to connect to a wireless network with Droid Maxx

    I have a Microsoft wireless router. My laptop and a smartphone from Samsung can connect to the internet without any probplem. However, two smartphone Motorola Droid Razr Maxx can stay in touch. The phone can find the network, will connect for a fract