close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

[Err] 1104 - The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=

Thread began 1/12/2021 1:08 am by SCar87011738 | Last modified 1/13/2021 10:11 am by SCar87011738 | 70 views | 2 replies

SCar87011738

[Err] 1104 - The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=

Hello all,
I get this error running query (with 2 or 3 JOINS) but not so biiiiiig.
How can I fix this in DB2?
Someone suggests to add SET SQL_BIG_SELECTS=1; before running the query.
Where I'm supposed to put this code if I have this query?

<?php
$rs_storico_ritiri = new WA_MySQLi_RS("rs_storico_ritiri",$conn_registrazione_i,10);
$rs_storico_ritiri->setQuery("SELECT pickup_obi.*, tipologia_ritiri_trit.*, store_mittente.name_sto AS store_mittente, store_destinazione.name_sto AS store_destinazione FROM pickup_obi LEFT JOIN tipologia_ritiri_trit ON pickup_obi.ritiro_tipologia_obi = tipologia_ritiri_trit.id_trip INNER JOIN stores_sto AS store_mittente ON store_mittente.number_sto = pickup_obi.store_mittente_obi LEFT JOIN stores_sto AS store_destinazione ON store_destinazione.number_sto = pickup_obi.store_destinazione_obi WHERE pickup_obi.data_ritiro_obi <= CURDATE() AND pickup_obi.store_mittente_obi = ? ORDER BY pickup_obi.data_ritiro_obi DESC");
$rs_storico_ritiri->bindParam("i", "".$_SESSION['sess_number_sto'] ."", "-1"); //colname
$rs_storico_ritiri->execute();
?>



Please note that if I add this code to a database client as Navicat it works.
But I don't know where to put this code in dreamweaver in the webasssist mysqli recordset code.

I tried this:

<?php
$rs_storico_ritiri = new WA_MySQLi_RS("rs_storico_ritiri",$conn_registrazione_i,10);
$rs_storico_ritiri->setQuery("SET SQL_BIG_SELECTS=1; SELECT pickup_obi.*, tipologia_ritiri_trit.*, store_mittente.name_sto AS store_mittente, store_destinazione.name_sto AS store_destinazione FROM pickup_obi LEFT JOIN tipologia_ritiri_trit ON pickup_obi.ritiro_tipologia_obi = tipologia_ritiri_trit.id_trip INNER JOIN stores_sto AS store_mittente ON store_mittente.number_sto = pickup_obi.store_mittente_obi LEFT JOIN stores_sto AS store_destinazione ON store_destinazione.number_sto = pickup_obi.store_destinazione_obi WHERE pickup_obi.data_ritiro_obi <= CURDATE() AND pickup_obi.store_mittente_obi = ? ORDER BY pickup_obi.data_ritiro_obi DESC");
$rs_storico_ritiri->bindParam("i", "".$_SESSION['sess_number_sto'] ."", "-1"); //colname
$rs_storico_ritiri->execute();
?>



But it doesn't work and I get this error "There is an error in your SQL syntax.".

TIA
tony

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...