Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12
  1. #11
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Trying to cleanup table.. Stuck.. Help..

    Quote Originally Posted by mc12345678 View Post
    I'll just say that I wasn't fully engaged either... Gave it a shot without testing..

    If you haven't considered it further, (obviously) Ajeh's solution looks cleaner as it uses a bit more of sensible lexicon: Hey here's a list of things on the right, now on the left show me the things in the left that are not in the right...

    I don't know the details of when this action is to be performed (deletion of "extra" product entries) (as in multiple times in execution) or how many such entries are to be removed, or the overall load on the system for any of the above three functional methods, but, if infrequently run, whatever works and accomplishes the desired task. :)
    Well thanks for the help.. I can now move forward with the SBA conversion I'm working on..

    Now this brings to light a VERY big gap in SBA.. There appears to be a lack of data integrity checks.. There should be some kind of check so that removing products SHOULD also remove them from the SBA table.. Same is true of attributes.. This same site I had products in the BA table with attribute IDS that no longer existed..
    Last edited by DivaVocals; 29 Mar 2015 at 08:14 PM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  2. #12
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Trying to cleanup table.. Stuck.. Help..

    Quote Originally Posted by mc12345678 View Post
    Or using your specific results of your query.

    Code:
    Delete from products_with_attributes_stock pwas
    Where pwas.products_id in (
    SELECT UNIQUE pwas1.products_id 
    FROM   products_with_attributes_stock pwas1
    LEFT OUTER JOIN products p
      ON (p.products_id = pwas1.products_id)
      WHERE p.products_id IS NULL
    )
    Though I think this later version is a bit more consuming than the earlier... Ideally left inner joins should be performed rather than outer joins... The first version does that (and ought to provide you the same results as what you posted), this second uses your outer join method. I threw in the unique statement just to be sure, probably doesn't need it.
    Quote Originally Posted by DivaVocals View Post
    and this doesn't work either..
    Quote Originally Posted by DivaVocals View Post
    Well thanks for the help.. I can now move forward with the SBA conversion I'm working on..

    Now this brings to light a VERY big gap in SBA.. There appears to be a lack of data integrity checks.. There should be some kind of check so that removing products SHOULD also remove them from the SBA table.. Same is true of attributes.. This same site I had products in the BA table with attribute IDS that no longer existed..
    Already taken care of in the branch mc12345678_sba154 of the version for ZC 1.5.3/1.5.4.

    Both cases actually. So, at least people that install it anew will have all the benefits; however, those that have used the old version(s) may need to do what you have done, though may also include it into the "setup"/conversion.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Trying to setup Linkpoint and I'm stuck!
    By kathi247 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 10 Jul 2010, 03:30 PM
  2. STUCK!!.... trying to change login page
    By Shane78 in forum General Questions
    Replies: 4
    Last Post: 20 Sep 2009, 11:10 PM
  3. Database upgrade stuck at 1.3.0.2 trying to get to 1.3.8
    By websokind in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 12 Dec 2007, 04:11 AM
  4. I am stuck trying to move catalog
    By Muddler in forum General Questions
    Replies: 4
    Last Post: 16 Jun 2006, 10:32 PM

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