Solved

SQL query script performance 3

Posted on 2008-10-30
4
255 Views
Last Modified: 2012-05-05
Please do you have any recommendations that I can change on this script?

ALTER TABLE CUSTOMER_HISTORY_TYPE
CHANGE COLUMN history_type_name history_type_display_name varchar(128) NOT NULL,
ADD COLUMN history_type_name varchar(128) NOT NULL;

UPDATE CUSTOMER_HISTORY_TYPE
SET history_type_name =
CASE history_type_display_name
      WHEN 'Successful Login to MyAccount' THEN 'SUCCESSFUL_MYACCOUNT_LOGIN'
      WHEN 'Unsuccessful login to MyAccount' THEN 'FAILED_MYACCOUNT_LOGIN'
      WHEN 'Password change from MyAccount' THEN 'MYACCOUNT_PASSWORD_CHANGE'
      WHEN 'History note added via add_history_form.php' THEN 'NOTE_VIA_ADD_HISTORY_FORM'
      WHEN 'Failed Crediting Card' THEN 'CREDITING_CARD_FAILURE'
      WHEN 'Failed Crediting Bank Account' THEN 'BANK_ACCOUNT_CREDITING_FAILURE'
      WHEN 'Write Off' THEN 'WRITE_OFF'
      WHEN 'Write Off Recovery' THEN 'WRITE_OFF_RECOVERY'
      WHEN 'Pay bill' THEN 'BILL_PAY'
      WHEN 'View balance' THEN 'BALANCE_VIEW'
      WHEN 'Download invoice' THEN 'INVOICE_DOWNLOAD'
      WHEN 'Update credit card' THEN 'CC_UPDATE'
      WHEN 'Update billing address' THEN 'BILLING_ADDR_UPDATE'
      WHEN 'Update payment type' THEN 'PAY_TYPE_UPDATE'
      WHEN 'Upgrade service plan' THEN 'SERVICE_PLAN_UPGRADE'
      WHEN 'Add features' THEN 'FEATURE_ADD'
      WHEN 'Add new account' THEN 'ACCT_ADD'
      WHEN 'Add accessories' THEN 'ACCESSORY_ADD'
      WHEN 'Add internet phone service' THEN 'VOIP_ADD'
      WHEN 'Add secondary numbers' THEN 'SECONDARY_PHONE_ADD'
      WHEN 'Port phone number' THEN 'PORT_PHONE_ADD'
      WHEN 'Update E911 address' THEN 'E911_ADDR_ADD'
      WHEN 'Activate ATA' THEN 'ATA_ACTIVATE'
      WHEN 'View CDRs' THEN 'CDR_VIEW'
      WHEN 'Setup email address' THEN 'EMAIL_ADDR_SETUP'
      WHEN 'Reset password' THEN 'PASSWORD_RESET'
      WHEN 'Reset secret question' THEN 'SECRET_QUESTION_RESET'
      WHEN 'Update day phone number' THEN 'DAY_PHONE_UPDATE'
      WHEN 'Setup web account' THEN 'WEB_ACCT_SETUP'
      WHEN 'Update night phone number' THEN 'NIGHT_PHONE_UPDATE'
      WHEN 'Update account profile/contact email address' THEN 'CONTACT_INFO_UPDATE'
      WHEN 'View Terms of Services' THEN 'TOS_VIEW'
      WHEN 'Download security suite' THEN 'SECURITY_SUITE_DOWNLOAD'
      WHEN 'View FAQ pages' THEN 'FAQ_VIEW'
      WHEN 'View Contact Us page' THEN 'CONTACT_US_VIEW'
      WHEN 'Access chat' THEN 'CHAT_ACCESS'
      WHEN 'View account history' THEN 'ACCT_HISTORY_VIEW'
      WHEN 'View Site Help system' THEN 'SITE_HELP_VIEW'
      WHEN 'Refer a friend' THEN 'FRIEND_REFER'
      WHEN 'Update payment as credit card' THEN 'CC_PAY_METHOD_SELECT'
      WHEN 'Successful payment' THEN 'PAY_SUCCESS'
      WHEN 'Failed payment' THEN 'PAY_FAILURE'
      WHEN 'Credit score changed' THEN 'CREDIT_SCORE_CHANGE'
      WHEN 'ECP eligible per credit score' THEN 'ECP_ELIGIBLE'
      WHEN 'Email address deleted' THEN 'EMAIL_ADDR_DELETE'
      WHEN 'Phone number changed' THEN 'PHONE_CHANGE'
      WHEN 'Legacy security question assigned' THEN 'LEGACY_SECURITY_QUESTION_ASSIGN'
      WHEN 'SalesOE add services authentication detected' THEN 'SALESOE_ADD_SERVICES_AUTH'
      WHEN 'Prequal through Gmap' THEN 'GMAP_PREQUAL'
      WHEN 'Successful login through store' THEN 'SUCCESSFUL_STORE_LOGIN'
      WHEN 'Username changed' THEN 'USERNAME_CHANGE'
      WHEN 'VLAN Contract Renewal remind me later' THEN 'VLAN_CONTRACT_RENEWAL_REMIND'
      WHEN 'VLAN Contract Renewal accept' THEN 'VLAN_CONTRACT_RENEWAL_ACCEPT'
      WHEN 'VLAN Contract Renewal decline' THEN 'VLAN_CONTRACT_RENEWAL_DECLINE'
      ELSE history_type_name
END;

ALTER IGNORE TABLE CUSTOMER_HISTORY_TYPE
ADD UNIQUE (history_type_name);

# Insert the Default History Type entry in the table for undefined types
INSERT INTO CUSTOMER_HISTORY_TYPE (history_type_display_name,description,visible,history_type_name)
VALUES ('UNDEFINED','DEFAULT HISTORY TYPE NAME',1,'UNDEFINED');

TIA.
V.
0
Comment
Question by:Nakuru1234
  • 3
4 Comments
 
LVL 31

Expert Comment

by:awking00
Comment Utility
You're showing MySQL, MS SQL, and Oracle zones. Which rdbms are you actually using?
0
 

Accepted Solution

by:
Nakuru1234 earned 0 total points
Comment Utility
MYSQL...but your site recommended that if I'm not getting any response...I need to add other zones. I never heard back from anybody at the MYSQL zone?

TIA.
V.
0
 

Author Comment

by:Nakuru1234
Comment Utility
I never got any help?

V.
0
 

Author Comment

by:Nakuru1234
Comment Utility
Close ticket?
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to recover a database from a user managed backup

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now