Page 1 of 1

"where current of @" unrecognized at @local_variable cursor

Posted: Wed 12 Jun 2013 12:58
by sov
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?

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

Posted: Fri 14 Jun 2013 14:44
by alexa
We queued this post for investigation and will answer you as soon as possible.

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

Posted: Tue 18 Jun 2013 15:29
by alexa
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.

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

Posted: Mon 05 Aug 2013 13:33
by alexa
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.