Solved

SQL query script performance 3

Posted on 2008-10-30
4
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 32

Expert Comment

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

Accepted Solution

by:
Nakuru1234 earned 0 total points
ID: 22866845
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
ID: 22931175
I never got any help?

V.
0
 

Author Comment

by:Nakuru1234
ID: 22931190
Close ticket?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

695 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