Max function is not available

1.8 related questions and discussions.
Please upgrade to LATEST 1.9.x.
No more fixes for 1.8.

Moderators: Amaradana, TurboPT, TL Developers

Locked
sangita
TestLink user
Posts: 11
Joined: Mon Aug 03, 2009 11:54 am

Max function is not available

Post by sangita »

Hi!
When I use the max function while querying the database, I get the error of "Function Testlink.Max does not exist -- Error # 1305". Is there a way to add this?
Thanks
Sangita
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Post by TurboPT »

Need more details...

How/where are you trying to use this with a query?
sangita
TestLink user
Posts: 11
Joined: Mon Aug 03, 2009 11:54 am

Post by sangita »

Hi!
We have MSSQL database for testlink and I am using MSSQL browser 1.2.14 for the query. I need to get the latest version number from tcversions table. I am using the following query, but it is giving me the listed error.

select max(version) from tcversions
where id = xxxxx


Thanks
Sangita
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Post by TurboPT »

Sounds like a possible mis-configuration. [but might not be]

Error 1305 is a MySQL [not MS-SQL] error# for "procedure doesn't exist", as it seems to be looking for a procedure named 'max'.

Since max is an SQL aggregate function [in both MySQL and MS-SQL], I'm not sure how it is getting this error. The query you posted seems to be ok.

What MS-SQL version do you have? [not the browser version being used]

Oh, even though the query appears to be ok, as posted, make sure that there is NOT a space between max and its opening ( . If I do this with MySQL it gives me the same error. I'm not sure if MS-SQL needs a space there though, so try it both ways.
Locked