Yes, found the problem, you are right. Thanks.
But this is something caused by powerbuilder, in my code I never put any
space between count(*), but when it goes to odbc, an space is added. Any
idea how to solve this? 

-----Original Message-----
From: gerald_clark [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 08, 2003 12:17 AM
To: Fatt Shin
Cc: [EMAIL PROTECTED]
Subject: Re: select count(*) Problem in PowerBuilder Thru MySQL ODBC
3.51


You are not doing "select  count(*)"
You are doing "select count ( *)"
Get rid of the spaces before the "("

Fatt Shin wrote:

>Hi,
>I'm running MySQL 4.0.13, connecting from PowerBuilder 9 using ODCB 
>Connector 3.51. I'm facing a problem where whenever I issue a SELECT 
>COUNT(*) statement from PowerBuilder, I always get SQL syntax error 
>back from MySQL. (Refer to ODBC Trace I captured below).
>
>metrohouse      af8-b94 ENTER SQLExecDirect 
>  HSTMT               014D2360
>  UCHAR *             0x020A0EA2 [      -3] "select count ( *) from
code
>\ 0"
>  SDWORD                    -3
>
>metrohouse      af8-b94 EXIT  SQLExecDirect  with return code -1
>(SQL_ERROR)
>  HSTMT               014D2360
>  UCHAR *             0x020A0EA2 [      -3] "select count ( *) from
code
>\ 0"
>  SDWORD                    -3
>
>  DIAG [37000] [MySQL][ODBC 3.51 Driver][mysqld-4.0.13-max-nt]You have 
>an error in your SQL syntax.  Check the manual that corresponds to your

>MySQL server version for the right syntax to use near '( *) from code' 
>at line 1 (1064)
>
>metrohouse      af8-b94 ENTER SQLErrorW 
>  HENV                014D12A0
>  HDBC                014D14B0
>  HSTMT               014D2360
>  WCHAR *             0x0012E65C (NYI) 
>   SDWORD *            0x0012E6A8
>  WCHAR *             0x0012E25C 
>  SWORD                      512 
>  SWORD *             0x0012E6B0
>
>metrohouse      af8-b94 EXIT  SQLErrorW  with return code 0
>(SQL_SUCCESS)
>  HENV                014D12A0
>  HDBC                014D14B0
>  HSTMT               014D2360
>  WCHAR *             0x0012E65C (NYI) 
>   SDWORD *            0x0012E6A8 (1064)
>  WCHAR *             0x0012E25C [     208] "[MySQL][ODBC 3.51
>Driver][mysqld-4.0.13-max-nt]You have an error in your SQL syntax. 
>Check the manual t"
>  SWORD                      512 
>  SWORD *             0x0012E6B0 (208)
>
>The same statement actually working fine whether I ran it using mysql 
>or sql yog or even using the same ODBC connector thru Microsoft Access.

>(Refer to ODBC Trace below)
>MSACCESS        fd4-ff4        ENTER SQLExecDirectW 
>               HSTMT               09BB18C8
>               WCHAR *             0x0B431048 [      -3] "SELECT
>COUNT(* )  FROM `code` \ 0"
>               SDWORD                    -3
>
>MSACCESS        fd4-ff4        EXIT  SQLExecDirectW  with return code 0
>(SQL_SUCCESS)
>               HSTMT               09BB18C8
>               WCHAR *             0x0B431048 [      -3] "SELECT
>COUNT(* )  FROM `code` \ 0"
>               SDWORD                    -3
>
>Anybody have any idea what may cause the error here ???
>
>Thanks a lot.
>
>Regards,
>FattShin
>
>
>
>
>
>  
>





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to