"where current of @" unrecognized at @local_variable cursor

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
sov
Posts: 16
Joined: Tue 26 Mar 2013 07:05

"where current of @" unrecognized at @local_variable cursor

Post by sov » Wed 12 Jun 2013 12:58

SQL Complete 4.0.78.1 throws error "'Identifier' expected" and "''conversation'' expected" when using "where current of" like:

Code: Select all

declare @Tab table ( ID int not null primary key, Data varchar(10) null);

insert into @Tab(ID) values (1);

declare @Cursor cursor
      , @ID     int;

set @Cursor = cursor local for select ID from @Tab;

open @Cursor;
while 1 = 1
begin
    fetch next from @Cursor into @ID;
    if @@fetch_status <> 0 break;
    update @Tab set Data = 'Data' where current of @Cursor; --> @local_variable @Cursor is probably unexpected here...
end;

select * from @Tab;

close @Cursor;
deallocate @Cursor;
When written like below, formatting works as excpected

Code: Select all

declare @Tab table ( ID int not null primary key, Data varchar(10) null);

insert into @Tab(ID) values (1);

declare @ID int;

declare Cur cursor local for select ID from @Tab;

open Cur;
while 1 = 1
begin
    fetch next from Cur into @ID;
    if @@fetch_status <> 0  break;
    update @Tab set Data = 'Data' where current of Cur;
end;

select * from @Tab;

close Cur;
deallocate Cur;
Both are valid T-SQL batches. Could you please fix this?

alexa

Re: "where current of @" unrecognized at @local_variable cursor

Post by alexa » Fri 14 Jun 2013 14:44

We queued this post for investigation and will answer you as soon as possible.

alexa

Re: "where current of @" unrecognized at @local_variable cursor

Post by alexa » Tue 18 Jun 2013 15:29

We were able to reproduce this issue and will fix it in one of the next builds of dbForge SQL Complete. We will notify you once it's available for downloading.

alexa

Re: "where current of @" unrecognized at @local_variable cursor

Post by alexa » Mon 05 Aug 2013 13:33

We would like to let you know that the new build 4.0.109 of dbForge SQL Complete, where the issue you reported is fixed, has been released and is available for downloading: http://www.devart.com/dbforge/sql/sqlco ... nload.html

Thank you for your help in improving dbForge SQL Complete.

Post Reply