Update without cursor [message #649368] |
Wed, 23 March 2016 12:44 |
|
Sam D.
Messages: 17 Registered: December 2015 Location: USA
|
Junior Member |
|
|
Hi! I need to change the encryption of user passwords (well... hashes) from old package to new package.
Sample table
CREATE TABLE USERS
(
USERS_ID NUMBER NOT NULL,
USERS_FIRST_NAME VARCHAR2(20 BYTE) NOT NULL,
USERS_LAST_NAME VARCHAR2(20 BYTE) NOT NULL,
USERS_DISPLAY_NAME VARCHAR2(50 BYTE),
USERS_PASSWORD VARCHAR2(255 BYTE) NOT NULL,
USERS_NAME VARCHAR2(30 BYTE) NOT NULL,
USERS_EMAIL VARCHAR2(48 BYTE),
USERS_PHONE VARCHAR2(40 BYTE)
)
So, I need to decrypt existing passwords using "legacy" package (LEGACY_CRYPT.DECRYPT()) and encrypt using new package NEW_CRYPT.ENCRYPT().
Can it be done without Cursors?
Many thanks in advance,
|
|
|
Re: Update without cursor [message #649369 is a reply to message #649368] |
Wed, 23 March 2016 12:48 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
Sam D. wrote on Wed, 23 March 2016 10:44Hi! I need to change the encryption of user passwords (well... hashes) from old package to new package.
Sample table
CREATE TABLE USERS
(
USERS_ID NUMBER NOT NULL,
USERS_FIRST_NAME VARCHAR2(20 BYTE) NOT NULL,
USERS_LAST_NAME VARCHAR2(20 BYTE) NOT NULL,
USERS_DISPLAY_NAME VARCHAR2(50 BYTE),
USERS_PASSWORD VARCHAR2(255 BYTE) NOT NULL,
USERS_NAME VARCHAR2(30 BYTE) NOT NULL,
USERS_EMAIL VARCHAR2(48 BYTE),
USERS_PHONE VARCHAR2(40 BYTE)
)
So, I need to decrypt existing passwords using "legacy" package (LEGACY_CRYPT.DECRYPT()) and encrypt using new package NEW_CRYPT.ENCRYPT().
Can it be done without Cursors?
Many thanks in advance,
It can NOT be done. PERIOD!
HASHES != encrypted
|
|
|
|
|
Re: Update without cursor [message #649373 is a reply to message #649371] |
Wed, 23 March 2016 13:01 |
John Watson
Messages: 8931 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
You haven't bothered to shoe the code in those functions. Can;t you do something like this -orclz> update dept set dname=upper(lower(dname));
4 rows updated.
orclz>
|
|
|
|
|
|