‎2010 May 25 3:54 PM
Friends,
I am trying to use : enter SQL statement at ST05 to get cost of SELECT QUERY.
Each time I try, get following error message:
SQL error 102: Incorrect syntax near ':'.
Message no. SMMSS_ANALYZE000
Even for simple SELECT QUERY:
SELECT *
from mara
where mandt = :a1
I get the same error message. Please help me get solution for it as I searched SAP NOTE and could not find anything related.
Following are the details for our database:
Database system: MSSQL
Release: 9.00.4035
Thanks
‎2010 May 25 4:00 PM
Hi,
> Each time I try, get following error message:
> SQL error 102: Incorrect syntax near ':'.
> Message no. SMMSS_ANALYZE000
>
> Even for simple SELECT QUERY:
> SELECT *
> from mara
> where mandt = :a1
> Following are the details for our database:
> Database system: MSSQL
> Release: 9.00.4035
you must not use native ORACLE syntax on MSSQL.
Furthermore the 'Enter SQL Statement' in MSSQL has some issues...
Try like this:
SELECT *
from MARA
where MANDT = '000'
(uppercase, ...)
Workarround:
Simulate your SQL with SE16 and record a regular ST05 trace.
Kind regards,
Hermann
Edited by: Hermann Gahm on May 25, 2010 5:03 PM
‎2010 May 25 4:00 PM
Hi,
> Each time I try, get following error message:
> SQL error 102: Incorrect syntax near ':'.
> Message no. SMMSS_ANALYZE000
>
> Even for simple SELECT QUERY:
> SELECT *
> from mara
> where mandt = :a1
> Following are the details for our database:
> Database system: MSSQL
> Release: 9.00.4035
you must not use native ORACLE syntax on MSSQL.
Furthermore the 'Enter SQL Statement' in MSSQL has some issues...
Try like this:
SELECT *
from MARA
where MANDT = '000'
(uppercase, ...)
Workarround:
Simulate your SQL with SE16 and record a regular ST05 trace.
Kind regards,
Hermann
Edited by: Hermann Gahm on May 25, 2010 5:03 PM
‎2010 May 27 11:53 AM
If you do an SQL trace, and then explain a statement, you'll see precisely the form to enter an SQL statement in.
For example:
SELECT *
from "MARA"
where "MANDT" = :a1If it helps you feel better, I only figured this out a few weeks ago - and I've been doing ABAP since 1997!
matt
‎2010 May 27 12:06 PM
Hi Matt,
on MSSQL this would be:
SELECT *
from "MARA"
where "MANDT" = @P000
The problem is, that this doesn't work in ST05 on MSSQL:
SQL error 137: Must declare the scalar variable "@P000".
Message no. SMMSS_ANALYZE000
that is the ST05 issues in MSSQL i mentioned. In ORACLE
you are right... it works like you said.
Kind regards,
Hermann
‎2010 May 27 1:16 PM
Good point, well presented - I missed the MSSQL bit.
‎2010 May 27 1:43 PM
This is the take home message of this thread:
Workarround:
Simulate your SQL with SE16 and record a regular ST05 trace.
For simple statements you should use the SE16 (table data display) and trace it in parallel.
This can also be useful when you analyse an SQL trace. If a problem can not be explained at all., run a single selection for a test, maybe it behaves quite different.
Siegfried