1062 Duplicate entry 'Customers who have never...
I'm trying to upgrade to 1.3.8a and when I click database upgrade I got the following message:
HTML Code:
1062 Duplicate entry 'Customers who have never completed a purchase' for key 2
in:
[INSERT INTO query_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL');]
As I guess the matter was in (.) in between 'c' and 'LEFT'. Is it right (means bug) ?
If so where it can be changed?
If not what should I do next?
Thank you
Re: 1062 Duplicate entry 'Customers who have never...
Quote:
Originally Posted by
LostSheep
As I guess the matter was in (.) in between 'c' and 'LEFT'. Is it right (means bug) ?
No, it's not a bug.
It's trying to insert a record that apparently already exists.
Did you run the database upgrade twice for some reason?
Re: 1062 Duplicate entry 'Customers who have never...
Run this using the SQL Patch tool in the Admin->Tools menu:
Code:
DELETE from query_builder where query_name = 'Customers who have never completed a purchase';
Then you should be able to redo the database upgrade ... again.
Re: 1062 Duplicate entry 'Customers who have never...
Thanks DrByte for this little tip as I inadvertantly downgraded my DB Patch to 1.3.7 and couldn't get the db upgrade to allow 1.3.7 -> 1.3.8a...
After the SQL execution, re-run the upgrade and all is well ! ! !
Many Thanks again !
Jim
Re: 1062 Duplicate entry 'Customers who have never...
I keep getting this error too. I have gone to my admin and entered: SQL Query delete portion and I have even done a fresh install of my database but no luck!
I have been workin on this for 2 days now and very very frustrated at this point.
1062 Duplicate entry 'Customers who have never completed a purchase' for key 2
in:
[INSERT INTO zen_query_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL');]
Re: 1062 Duplicate entry 'Customers who have never...
Quote:
Originally Posted by
travel124
I keep getting this error too. I have gone to my admin and entered: SQL Query delete portion and I have even done a fresh install of my database but no luck!
Then maybe you're hitting the wrong database or table?
Quote:
Originally Posted by
travel124
[INSERT INTO zen_query_builder ...
If you've deleted the entry, but it keeps saying it exists, then you're probably not deleting it from the right place.
The upgrader will only attempt to run that INSERT command when you do the 1.3.7-to-1.3.8 upgrade step.
If you've already done that step once, then naturally it would be expected that it would croak.
If you are certain you've done everything correctly and don't care about that particular statement, edit the /zc_install/sql/mysql_zencart_upgrade_137_to_138.sql file and put a # at the beginning of that line to comment it out.
Then cross your fingers when you run that upgrade step again.
Re: 1062 Duplicate entry 'Customers who have never...
I am fine now.
Thanks for your help!
New issue with admin here: http://www.zen-cart.com/forum/showthread.php?t=84655
Re: 1062 Duplicate entry 'Customers who have never...
I really do try not to tag on to threads with such good documentation.. but I can't make it work. I keep trying what I find here on he boards but to no resolve. So with my deepest apologies can someone please have a look at my work and help me find some more things to try.
The problems I am having.
Can't Log in to my cart
1062 Dup error.. can't upgrade cart to 1.38a
Info:
https://store.angeleyes.org/
I am trying to upgrade from 1.3.8 to 1.3.8a to fix the "can't log in to my cart problem.
Error code:
Error There was a security error when trying to login.
Error code:
1062 Duplicate entry 'Customers who have never completed a purchase' for key 2
in:
[INSERT INTO zenquery_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL');]
Any help is very appreciated.. DrByte, looks like you help more people that Red Cross does.. once I get this thing working you get a Gift Certificate in appreciation. Dubious prize I know, but its just a token of appreciation.
Cam
Rj Dollen
Re: 1062 Duplicate entry 'Customers who have never...
Another approach you can try is to add a # before the INSERT statement mentioned ... which will cause it not to be processed.
Re: 1062 Duplicate entry 'Customers who have never...
Quote:
Originally Posted by
DrByte
Another approach you can try is to add a # before the INSERT statement mentioned ... which will cause it not to be processed.
I am shamed a little here to say.. I have no idea what to do with that chuck of code.. the "[INSERT INTO zen_query_builder (...." bit is a mystery to me.
So "#[INSERT INTO zen_query_builder (...." goes where?
Cam