Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2013
    Posts
    17
    Plugin Contributions
    0

    Default SQL query setup. How do I TEST a query 'off-line'?

    I have written an SQL query which will change the prices of over 100 products. Is there a way of running the query to check it does what I want, but off-line. Thank you for any help and advice you may be able to give me. I am a New Zenner and still at the 'egg' stage.My site was set up by an IT specialist who unfortunately is now deceased. The site has run without incident for 5 years, seeing one upgrade from v137 to v151 on 1st January 2013.

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: SQL query setup. How do I TEST a query 'off-line'?

    Quote Originally Posted by lewisasding View Post
    I have written an SQL query which will change the prices of over 100 products. Is there a way of running the query to check it does what I want, but off-line.
    Simple answer. No.

    What *I* tend to do in these circumstances is make a copy of the table to be manipulated and run the query on the copy. If the query fails I just delete the copied table and try again.

    When it appears to be doing what it should be I make one final copy of the original table, then re-run the query on the original. In the *extremely* rare case where the query fails on the original, I simply restore it from the backup copy, and start again (that's the theory. In practice, I've never had to resort to using this 'final' backup), but I'd still never run the query without some means of restoration, and this gives me that peace of mind).

    Cheers
    Rod

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

    Default Re: SQL query setup. How do I TEST a query 'off-line'?

    If by "off-line" you mean what RodG has described as making a copy into another database (preferably onto a database running on your PC), then the answer is kinda "yes", but requires that you understand all the pieces involved in running that copy of the database locally.
    Assuming your intent is only to "test" to be sure it's working correctly "offline" before touching your live site where you will later run the actual query on your actual live site, then such an offline "test" is always ideal. Again, RodG has generally outlined the process.
    .

    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
    Feb 2013
    Posts
    17
    Plugin Contributions
    0

    Default Re: SQL query setup. How do I TEST a query 'off-line'?

    Thank you for your interest im my post. I have just asked RodG if he can point me in the right direction in understanding where tables are located and their manipulation. Some of the forums are too technical at present for my level of understanding. Kind Regards Keith Lewis

 

 

Similar Threads

  1. Replies: 9
    Last Post: 12 Jul 2023, 12:26 AM
  2. v154 Help with a SQL Query for Query Builder
    By lindasdd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 24 Mar 2016, 01:18 PM
  3. how to print sql query to screen?
    By delia in forum General Questions
    Replies: 5
    Last Post: 15 Jun 2011, 12:40 PM
  4. How do I test MySQL parse and query times?
    By Boomdawg in forum General Questions
    Replies: 1
    Last Post: 19 Mar 2010, 07:44 PM
  5. how to do a SQL query?
    By therealex in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 12 Dec 2009, 11:52 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