SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
End is not an alias

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
End is not an alias
Author Message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post End is not an alias Reply with quote
If you have a Begin End block like this:

Begin
Select
From Table1

End

when you try to add column names to the select without Table1 being aliased, all column names are prefixed with End. Resulting in the following:

Begin
Select End.Column1
From Table1

End

obviously is not valid.
Fri Mar 16, 2007 2:39 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7907

Post Reply with quote
That's because it sees End in that place as an alias for Table1.

I agree with you that keywords should be excluded from alias searches, moreover aliases should be searched only on the same line.

I hope we can provide a fix this issue soon
Fri Mar 16, 2007 2:52 pm View user's profile Send private message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Reply with quote
It seems it really doesn't like Begin End blocks. If you try to add additional columns to the select it doesn't know what to do and just starts suggesting tables.

Example:

Begin
Select ID
From Table t
End

Adding a comma after ID causes table names. Table is aliased in this example.
Fri Mar 16, 2007 3:01 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7907

Post Reply with quote
I think it is still the same issue with aliases and End. If you remove "t" you are going to get column list, is you put back, the parser gets confused as it cannot find the table in the object list and considers the SELECT line separately from the rest, suggesting object list after the comma.

Enter any SQL statement between "t" and End and you are going to get the expected column list after the comma in the first SELECT.
Fri Mar 16, 2007 3:13 pm View user's profile Send private message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Reply with quote
SysOp wrote:
That's because it sees End in that place as an alias for Table1.

I agree with you that keywords should be excluded from alias searches, moreover aliases should be searched only on the same line.

I hope we can provide a fix this issue soon


MSDN has a list of reserved keywords for SQL, SQL-92, and future. They recommend reserved keywords are not used for identifiers, so that is a fair restriction. Although more work, you could allow reserved keywords as long as the alias is delimited. This is allowed by Sql Server.
Fri Mar 16, 2007 3:15 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.