Forums / General Questions / SQL Query Executor

SQL Query Executor

Locked

Views: 2,123

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
30 Nov 2009, 15:47
#1
tomreitz avatar

tomreitz

New Zenner

Join Date:
Jun 2007
Location:
Pasadena, Maryland, United States
Posts:
21
Plugin Contributions:
0

SQL Query Executor

Ok, I have looked in a lot of places and can't find anything on this. What is the upper limit of SQL queries that can be pasted into the Admin SQL Query Executor? In which file can it be changed to be raised or lowered?

Thanks.

30 Nov 2009, 17:44
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
174

Re: SQL Query Executor

It has no imposed limits.

Why?

30 Nov 2009, 18:06
#3
tomreitz avatar

tomreitz

New Zenner

Join Date:
Jun 2007
Location:
Pasadena, Maryland, United States
Posts:
21
Plugin Contributions:
0

Re: SQL Query Executor

no limits? Hmmm then what might limit it? A setting on the server? I was playing with a dev site and attempted to paste in a 1.5MB txt file of queries and it gave me an error saying "Error: Nothing to do - no query or query-file specified." I then manually split the file in half and pasted each individually and it worked fine for both files (~4500 queries for one and ~5000 queries for the other). There isn't a limit of 1MB to paste in perhaps or the number of queries that can be run? I know this is an obscure issue but am curious where the limit is imposed. I looked at sqlpatch.php in the admin directory and didn't see a limiter, and I didn't see a class or module file in the admin for sqlpatch either. Perhaps it is in the php.ini file on the server? If so, maybe I can override this in the root. Any other ideas?

30 Nov 2009, 18:28
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
174

Re: SQL Query Executor

tomreitz:

I was playing with a dev site and attempted to paste in a 1.5MB txt file of queriesWhat kind of queries?

tomreitz:

and it gave me an error saying "Error: Nothing to do - no query or query-file specified."That suggests that the data submitted didn't actually get received by the server.[/quote]> tomreitz:

I then manually split the file in half and pasted each individually and it worked fine for both files (~4500 queries for one and ~5000 queries for the other).Well, I guess you've found your best workaround.> tomreitz:

There isn't a limit of 1MB to paste in perhaps or the number of queries that can be run?No.> tomreitz:

I know this is an obscure issue but am curious where the limit is imposed. I looked at sqlpatch.php in the admin directory and didn't see a limiter, and I didn't see a class or module file in the admin for sqlpatch either.That's because the limit is not imposed by Zen Cart. It must be something in your browser or in your server's PHP configuration.

tomreitz:

Perhaps it is in the php.ini file on the server? If so, maybe I can override this in the root. Any other ideas? tomreitz:

no limits? Hmmm then what might limit it? A setting on the server?Maybe your post_max_size in your php.ini

I'm more interested in understanding why you're pasting such huge queries into a tool that's intended for small minor patching, not mass insertion of records or site upgrades.

30 Nov 2009, 20:16
#5
tomreitz avatar

tomreitz

New Zenner

Join Date:
Jun 2007
Location:
Pasadena, Maryland, United States
Posts:
21
Plugin Contributions:
0

Re: SQL Query Executor

What kind of queries? here is a complete sample:

insert into address_book values(1313678700,1313678700,'',NULL,'Pamela','Smith','1313 Mockingbird Lane',NULL,'00966','Beachhead','MD',223,41); insert into customers values(1313678700,'M','Pamela','Smith','0001-01-01 00:00:00','[email protected]','',1313678700,'4022145804',NULL,'',NULL,0,'TEXT',0,'','',0); insert into orders values(1313678700,1313678700,'Pamela Smith',NULL,'1313 Mockingbird Lane',NULL,'Beachhead','00966','MD','US','4022145804','[email protected]',0,'Pamela Smith',NULL,'1313 Mockingbird Lane',NULL,'Beachhead','00966','MD','US',0,'Pamela Smith',NULL,'1313 Mockingbird Lane',NULL,'null','00966','MD','US',0,'CC','''','N','','','V','Pamela Smith','xxxxxxxxxxxx1313','xxxx','','2009-11-29 00:04:24','2009-11-29 00:04:24',1,'2009-11-29 00:04:24','USD',1,53.80,0.00,'0',''); insert into orders_products values(NULL,1313678700,1,'widget1','widgets',18.95,18.95,0.00,2,0.00,0,0,0,0,''); insert into orders_total values(NULL,1313678700,'Sub-Total:',37.90,37.90,'ot_subtotal',100); insert into orders_total values(NULL,1313678700,'Handling',15.90,15.90,'ot_shipping',200); insert into orders_total values(NULL,1313678700,'Sales Tax',0.00,0.00,'ot_tax',300); insert into orders_total values(NULL,1313678700,'Total:',53.80,53.80,'ot_total',999); insert into orders_status_history values(1313678700,1313678700,1,'2009-11-29 00:04:24',0,'');

I am hoping to transfer orders from an external windows db server to a zencart db to be able to use some of the zencart's features for account tracking / reporting for clients. The source at the external database is just the raw data.

Maybe your post_max_size in your php.ini Great. I will look there.

I'm more interested in understanding why you're pasting such huge queries into a tool that's intended for small minor patching, not mass insertion of records or site upgrades. Was simply looking for the easiest method to do what I mentioned above without having to code everything from scratch. This database / site would not even have a public ordering site... just an order tracking login area so there would be no traffic and no load on the db server hardly ever... it is mainly so the client can use some of the really useful plugins from zencart that are already done. Hope that kinda makes sense. If not using the sql executor tool, what would you say would be the best method to do what I am attempting? Perhaps I missed something really obvious here. A few things: I have no access to the windows db server except to tell them what I want and I chose the mysql statements like above. I also have no access to shell on the zencart server... only phpmyadmin. (And PHPmyADMIN's import tool today also timed out when trying to import this complete file today)

30 Nov 2009, 20:44
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
174

Re: SQL Query Executor

tomreitz:

I also have no access to shell on the zencart server... only phpmyadmin. (And PHPmyADMIN's import tool today also timed out when trying to import this complete file today)phpMyAdmin would be the recommended tool for larger datasets. But, if you're having the same issues using that, then the problem is likely limitations in your server PHP config.

Naturally, you can split it into smaller batches, as you've discovered.

30 Nov 2009, 20:55
#7
tomreitz avatar

tomreitz

New Zenner

Join Date:
Jun 2007
Location:
Pasadena, Maryland, United States
Posts:
21
Plugin Contributions:
0

Re: SQL Query Executor

Thanks Dr. Byte!