cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax error on GO statements when using Shift + F9 to single step

Former Member
3,084

I'm having a problem when using Shift + F9 to single step through code in the Interactive SQL window. Consider the following code:

DECLARE @A INTEGER
DECLARE @B INTEGER

When I use Shift + F9 it executes this code just fine. It doesn't do anything interesting but the Interactive SQL window behaves exactly as expected, executing the whole thing as one pointless statement. Now consider the following variant with GO statements inserted:

DECLARE @A INTEGER = 1
GO
DECLARE @B INTEGER = 2
GO

The first time I use Shift + F9 it fails with an ISQL Error that says Could not execute statement. Syntax error near 'G' on line 2 SQLCODE=-131, ODBC 3 State="42000". If I simply hit F5 to execute the whole thing it works fine, so I'm hard pressed to understand how this can be a legitimate syntax error. Thanks in advance for any light y'all can shed on this issue.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

This is a bug. You can replace the GO lines with semicolons as a workaround.

Thank you for bringing this to our attention. We'll try to get it fixed in an upcoming EBF.

Former Member
0 Kudos

Excellent! Thanks for verifying that I'm not nuts; I look forward to the fix.

JimDiaz
Participant

Try a ; at the end of each statement and see what happens.

Former Member
0 Kudos

Same error, different location in the script. It looks like some kind of parsing bug to me.

JimDiaz
Participant
0 Kudos

Sorry remove the go lines

Former Member
0 Kudos

Removing the GO lines doesn't answer the question, which is why the Interactive SQL window chokes on them as syntax errors.

Former Member
0 Kudos

I guess since you are mixing dialects it is too much for the debugger!