Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2012
    Posts
    8
    Plugin Contributions
    0

    Default COWOA (for 1.3.9) Fails with 1062 Duplicate entry error

    Hey there,

    So I followed the instructions for installation of the COWOA module and when I paste in the SQL code into the query executor, I get this error message:

    1062 Duplicate entry 'Permanent Account Holders Only' for key 2
    in:
    [INSERT INTO zen_query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( '', 'email,newsletters', 'Permanent Account Holders Only', 'Send email only to permanent account holders ', 'select customers_email_address, customers_firstname, customers_lastname from TABLE_CUSTOMERS where COWOA_account != 1 order by customers_lastname, customers_firstname, customers_email_address');]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.




    For reference, this was what I initially pasted into the window. Any help would be greatly appreciated...




    ALTER TABLE customers ADD COWOA_account tinyint(1) NOT NULL default 0;
    ALTER TABLE orders ADD COWOA_order tinyint(1) NOT NULL default 0;
    INSERT INTO query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( '', 'email,newsletters', 'Permanent Account Holders Only', 'Send email only to permanent account holders ', 'select customers_email_address, customers_firstname, customers_lastname from TABLE_CUSTOMERS where COWOA_account != 1 order by customers_lastname, customers_firstname, customers_email_address');
    #
    SET @configuration_group_id=0;
    SELECT @configuration_group_id:=configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title= 'COWOA'
    LIMIT 1;
    DELETE FROM configuration WHERE configuration_group_id = @configuration_group_id;
    DELETE FROM configuration_group WHERE configuration_group_id = @configuration_group_id;

    INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'COWOA', 'Set Checkout Without an Account', '1', '1');
    SET @configuration_group_id=last_insert_id();
    UPDATE configuration_group SET sort_order = @configuration_group_id WHERE configuration_group_id = @configuration_group_id;

    INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES
    (NULL, 'Cowoa', 'COWOA_STATUS', 'false', 'Activate COWOA Checkout? <br />Set to True to allow a customer to checkout without an account.', @configuration_group_id, 10, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
    (NULL, 'Enable Order Status', 'COWOA_ORDER_STATUS', 'false', 'Enable The Order Status Function of COWOA?<br />Set to True so that a Customer that uses COWOA will receive an E-Mail with instructions on how to view the status of their order.', @configuration_group_id, 11, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
    (NULL, 'Enable E-Mail Only', 'COWOA_EMAIL_ONLY', 'false', 'Enable The E-Mail Order Function of COWOA?<br />Set to True so that a Customer that uses COWOA will only need to enter their E-Mail Address upon checkout if their Cart Balance is 0 (Free).', @configuration_group_id, 12, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
    (NULL, 'Enable Forced Logoff', 'COWOA_LOGOFF', 'false', 'Enable The Forced LogOff Function of COWOA?<br />Set to True so that a Customer that uses COWOA will be logged off automatically after a sucessfull checkout. If they are getting a file download, then they will have to wait for the Status E-Mail to arrive in order to download the file.', @configuration_group_id, 13, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),');

    UPDATE configuration SET configuration_value = 'True' WHERE configuration_title = 'Use split-login page';

  2. #2
    Join Date
    Jun 2012
    Posts
    8
    Plugin Contributions
    0

    Default Re: COWOA (for 1.3.9) Fails with 1062 Duplicate entry error

    For what its worth, I tried running the uninstall sql query and that didn't work either..... Anyone ever have a similar problem? How does one diagnose something like this?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: COWOA (for 1.3.9) Fails with 1062 Duplicate entry error

    "duplicate entry" messages mean that the record you're trying to insert already exists ... which means you've already run the script before. And if you haven't undone all the things it did, you can't run it again without creating trouble.

    Try running this:
    Code:
    delete from query_builder where query_name = 'Permanent Account Holders Only';
    This is ONLY A BANDAGE, and is not a guaranteed fix for all troubles caused by installing the extensively-invasive COWOA addon. This SQL statement is only a quick way to address THIS SPECIFIC error message you're reporting.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jun 2012
    Posts
    8
    Plugin Contributions
    0

    Default Re: COWOA (for 1.3.9) Fails with 1062 Duplicate entry error

    Thank you for your help! I ran the bit of code that you gave me above and re-ran the install script. This is what I got as a response:

    Code:
    Query Results:
    ALTER TABLE customers ADD COWOA_account tinyint(1) NOT NULL default 0;
    ALTER TABLE orders ADD COWOA_order tinyint(1) NOT NULL default 0;
    INSERT INTO zen_query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( '', 'email,newsletters', 'Permanent Account Holders Only', 'Send email only to permanent account holders ', 'select customers_email_address, customers_firstname, customers_lastname from TABLE_CUSTOMERS where COWOA_account != 1 order by customers_lastname, customers_firstname, customers_email_address');
    SET @configuration_group_id=0;
    SELECT @configuration_group_id:=configuration_group_id FROM zen_configuration_group WHERE configuration_group_title= 'COWOA' LIMIT 1;
    DELETE FROM zen_configuration WHERE configuration_group_id = @configuration_group_id;
    DELETE FROM zen_configuration_group WHERE configuration_group_id = @configuration_group_id;
    INSERT INTO zen_configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'COWOA', 'Set Checkout Without an Account', '1', '1');
    SET @configuration_group_id=last_insert_id();
    UPDATE zen_configuration_group SET sort_order = @configuration_group_id WHERE configuration_group_id = @configuration_group_id;
    INSERT INTO zen_configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES (NULL, 'Cowoa', 'COWOA_STATUS', 'false', 'Activate COWOA Checkout? 
    Set to True to allow a customer to checkout without an account.', @configuration_group_id, 10, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'), (NULL, 'Enable Order Status', 'COWOA_ORDER_STATUS', 'false', 'Enable The Order Status Function of COWOA?
    Set to True so that a Customer that uses COWOA will receive an E-Mail with instructions on how to view the status of their order.', @configuration_group_id, 11, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'), (NULL, 'Enable E-Mail Only', 'COWOA_EMAIL_ONLY', 'false', 'Enable The E-Mail Order Function of COWOA?
    Set to True so that a Customer that uses COWOA will only need to enter their E-Mail Address upon checkout if their Cart Balance is 0 (Free).', @configuration_group_id, 12, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'), (NULL, 'Enable Forced Logoff', 'COWOA_LOGOFF', 'false', 'Enable The Forced LogOff Function of COWOA?
    Set to True so that a Customer that uses COWOA will be logged off automatically after a sucessfull checkout. If they are getting a file download, then they will have to wait for the Status E-Mail to arrive in order to download the file.', @configuration_group_id, 13, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),');
    UPDATE zen_configuration SET configuration_value = 'True' WHERE configuration_title = 'Use split-login page';

  5. #5
    Join Date
    Jun 2012
    Posts
    8
    Plugin Contributions
    0

    Default Re: COWOA (for 1.3.9) Fails with 1062 Duplicate entry error

    Oops. That's the code I actually inserted. The results actually were:

    Code:
     12 statements processed.
     ERROR: Cannot ADD column COWOA_account because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     ERROR: Cannot ADD column COWOA_order because it already exists.
     Note: 2 statements ignored. See "upgrade_exceptions" table for additional details.
    So can I interpret from this that 2 statements were ignored because they were created the last time I ran this script? Thank you so much for your help, I truly appreciate it!!

 

 

Similar Threads

  1. DB Import Error #1062 - Duplicate entry '1' for key 1
    By aushy in forum Installing on a Windows Server
    Replies: 6
    Last Post: 19 Oct 2011, 11:38 AM
  2. 1062 Duplicate entry '0' for key 1 Error - 1.3.6-->1.3.8a
    By Ellume in forum Upgrading from 1.3.x to 1.3.9
    Replies: 24
    Last Post: 10 Jun 2008, 07:34 AM
  3. Error: 1062 Duplicate entry '0-78' for key 1
    By G33K-Chik in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 15 Apr 2008, 08:47 PM
  4. SQL Error : 1062 Duplicate entry '0' for key 1
    By Wazoo in forum General Questions
    Replies: 3
    Last Post: 3 May 2007, 02:50 PM
  5. Replies: 2
    Last Post: 20 Oct 2006, 09:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR