0

Hi, I have a sql statement which was running fine yesterday. After making a few changes to the website, it stopped working. I managed to get the statement work on my localhost, however, when I publish the same pages onto the server, I receive the "Operand should contain 1 column(s)" error.

I have a table names "PLZ" with a column also called "PLZ". The statement that worked was the following (just an example):

SELECT DISTINCT PLZ FROM PLZ WHERE 
(PLZ_LNG <= (13.4 + 0.154103006104881) AND PLZ_LNG >= (13.4 - 0.154103006104881)) 

AND 

(PLZ_LAT <= (52.517 + 9.62081932126399E-02) AND PLZ_LAT >= (52.517 - 9.62081932126399E-02)) 

AND 

PLZ <> '14131' 

AND 

PLZ_LNG <> 0 

AND PLZ_LAT <> 0

ORDER BY PLZ ASC;

On my localhost I changed the statement to the following in order to prevent mixing up the column names, and it worked fine:

SELECT DISTINCT PLZ.PLZ FROM PLZ WHERE (PLZ.PLZ_LNG <= (13.4 + 0.154103006104881) AND PLZ.PLZ_LNG >= (13.4 - 0.154103006104881)) AND (PLZ.PLZ_LAT <= (52.517 + 9.62081932126399E-02) AND PLZ.PLZ_LAT >= (52.517 - 9.62081932126399E-02)) AND PLZ.PLZ <> '14131' AND PLZ.PLZ_LNG <> 0 AND PLZ.PLZ_LAT <> 0 ORDER BY PLZ.PLZ ASC;

Now, when I publish the same statement onto the server, I get the same operand error again. I tried changing the statement by adding () between the AND statements and whatever I thought maybe helpful, but on the server this statement is not working :(

I would appreciate any suggestions, which may help me to solve this problem.

Regards,
Ali Baradaran

2
Contributors
2
Replies
8
Views
7 Years
Discussion Span
Last Post by tmlslvn6
0

OK, there is actually nothing wrong with the statement itself! The problem was solved after I realized that the website would only work on my localhost if I set the language of the website to English. As soon as I switched to German, I got the mentioned error.

So I compared the sql statments in both languages and found out the the problem was the language. As the pages are located on a German based server, I got the error all the time!

While in English we write (PLZ.PLZ_LNG <= (13.4 + 0.154103006104881), in German we write (PLZ.PLZ_LNG <= (13,4 + 0,154103006104881). So instead of a dot there was a comma. In the function (ASP) I just entered

Response.CLID = 1033

and the problem simply vanished!

Thanks to all who had a look at this problem!

Best regards,
Ali Baradaran

0

where we enter the response.CLID=1033 ,i have same problem in my MySql in one of my customer Server

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.