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.

asked 05 Dec '12, 12:25

JWilliston's gravatar image

JWilliston
1064410
accept rate: 0%

edited 15 Mar '13, 19:31

Mark%20Culp's gravatar image

Mark Culp
23.0k9130270


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.

permanent link

answered 12 Dec '12, 16:10

Chris%20Irie's gravatar image

Chris Irie
8051314
accept rate: 46%

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

(13 Dec '12, 08:40) JWilliston

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

permanent link

answered 05 Dec '12, 12:50

J%20Diaz's gravatar image

J Diaz
830243044
accept rate: 14%

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

(05 Dec '12, 12:52) JWilliston

Sorry remove the go lines

(05 Dec '12, 12:57) J Diaz

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

(05 Dec '12, 13:27) JWilliston

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

(05 Dec '12, 14:13) nico
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×76
×14
×2

question asked: 05 Dec '12, 12:25

question was seen: 864 times

last updated: 15 Mar '13, 19:31