how to resolve unexpected sql warning

how to resolve unexpected sql warning

  
I have some sql statements that give me a warning:

The first warning is unexpected ; in sql statement
However, the sql works
and if I remove the ; it goes from warning to error
; WTH tmpinfo as (select


Also, the warning often seems to request a ; at the end of a sql statement
but again, if I add the semicolon it goes from warning to error

Can you suggest how i can resolve some of these?
Thanks
tammy
Tammy Sager wrote:
I have some sql statements that give me a warning:

The first warning is unexpected ; in sql statement
However, the sql works
and if I remove the ; it goes from warning to error
; WTH tmpinfo as (select
 
 
 Hello Tammy,

First of all, that kind of SQL statements aren't recognized by the Service Studio and the warning is usual.
In your particular case I can't help much without the related SQL statement..However I see that you might have a syntax problem because you have "WTH tmpinfo as (select" instead of "WITH tmpinfo as (select".
It should be a Copy&Paste problem but you can check this.
For more information you can post or send me a private message with the related statement.

Best Regards,
Gonçalo Martins
Any news about this issue, Tammy?
Have you tried to execute your SQL statement directly in the server database to analyze the result and behavior of it?
For example, if you use the SQL directly you will get an easier and detailed view about some error that occurs and even you can control the Execution of all the server tasks and check some possible problems and with more detail about a certain errors related to execution or syntax errors.


Again, for more information you can post or send me a private message with the related statement.

Best Regards,
Gonçalo Martins
Hi Tammy,

Advanced query validator uses standard Sql syntax and does not cover all the possible syntaxes. So like Gonçalo mentioned it is not unusual to endup with some warnings if you write complex queries.


If after testing you are sure the syntax is good you can hide the warning by right clicking on it.

As for your specific case:

  • ";" is used to separate commands. Advanced queries are made to execute only 1 command per query. Even through our underlying implementation works fine in Mssql it wouldn't work at all in Oracle (because for multiple commands In Oracle you need to write plsql and that does not allow outputs to be retrieved).
  • The WITH syntax is not currently implemented in the parser.

Regards
João Rosado