Page 1 of 1

Too many tables in query

Posted: Fri Jul 05, 2013 9:52 am
by Jennypi
Hello,

My report is based on a query retrieving many many fields like this:

Code: Select all

select ...
IsNull((select 1+IsNull(reshimat_mashtela_kav_tchuna.maslul_id * 0,-1) from  reshimat_mashtela_kav_tchuna where reshimat_mashtela_kav_tchuna.kav_id = reshimat_mashtela_kav.kav_id
	and reshimat_mashtela_kav_tchuna.reshimat_mashtela_id = reshimat_mashtela.reshimat_mashtela_id
	and reshimat_mashtela_kav_tchuna.mispar_mashtela = reshimat_mashtela_kav.mispar_mashtela
	and reshimat_mashtela_kav_tchuna.tchuna_type = 145),'') VeBM,
IsNull((select 1+IsNull(reshimat_mashtela_kav_tchuna.maslul_id * 0,-1) from  reshimat_mashtela_kav_tchuna where reshimat_mashtela_kav_tchuna.kav_id = reshimat_mashtela_kav.kav_id
	and reshimat_mashtela_kav_tchuna.reshimat_mashtela_id = reshimat_mashtela.reshimat_mashtela_id
	and reshimat_mashtela_kav_tchuna.mispar_mashtela = reshimat_mashtela_kav.mispar_mashtela
	and reshimat_mashtela_kav_tchuna.tchuna_type = 149),'') I1BM,
etc..
from table1, etc...
How can I avoid the message saying "Too many tables in the query. Maximum allowable is 256"?
Is there a way to "rephrase" my query? Or to use 2 queries?

Thanks

Re: Too many tables in query

Posted: Fri Jul 05, 2013 12:29 pm
by HighAley
Hello.

This error comes from you database server. Please, try to run this query on your data base server, there should be the same error.

Thank you.

Re: Too many tables in query

Posted: Fri Jul 05, 2013 1:02 pm
by Jennypi
I know it's coming from the DB server (yes the same error occur when I run it on my DB server) but is there anything I can do?
Do you recommend I ask advices on SQL forums?

Re: Too many tables in query

Posted: Fri Jul 05, 2013 1:17 pm
by HighAley
Hello.

Sorry, but answer on this question is out of our competence.

Thank you.

Re: Too many tables in query

Posted: Fri Jul 05, 2013 1:18 pm
by Alex K.
Hello,

Please try to check the your server options for the change of this limit.

Thank you.

Re: Too many tables in query

Posted: Wed Jul 10, 2013 9:01 am
by Jennypi
Hi,

Thanks for your reply.
I was not able to change this 256 limit on the server. However, I've managed to make another query (linked with a relation to main query) and embedded it into a component. It works like a charm. :)

Re: Too many tables in query

Posted: Wed Jul 10, 2013 9:36 am
by Alex K.
Hello,

Let us know if you need any additional help.