Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Table "ef" not Found

3 posts in General Discussion Last posting was on 2003-05-22 14:03:04.0Z
Richard Posted on 2003-05-21 15:07:00.0Z
From: Richard
Date: Wed, 21 May 2003 11:07:00 -0400
Newsgroups: ianywhere.public.general
Subject: Table "ef" not Found
Message-ID: <8BBF2644E619235100530A0285256D2D.00530A1785256D2D@webforums>
Lines: 34
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1049
Article PK: 3008

Hello,
I just want to know as a FYI...

Here is my Stored Procedure...

CREATE Procedure DBA.sp_Adm_EnableFeature(
@AppName char(254),
@ControlFeature char(254),
@IsEnabled bit)
AS
SET NOCOUNT ON
update ef set IsEnabled = @IsEnabled from
DBA.Sec_Enabled_Features as ef join
Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature;


Why can't I use this style

update ef set IsEnabled = @IsEnabled from
DBA.Sec_Enabled_Features as ef join
Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature

instead of this style

update DBA.Sec_Enabled_Features as ef set ef.IsEnabled = @IsEnabled from
DBA.Sec_Enabled_Features as ef join
Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature

I didn't want to ref the table name twice...

Thanks


Ani Nica Posted on 2003-05-22 14:03:04.0Z
Message-ID: <3ECCD898.749DAF0E@ianywhere.com>
Date: Thu, 22 May 2003 10:03:04 -0400
From: Ani Nica <anica@ianywhere.com>
Organization: iAnywhere Solutions
X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Table "ef" not Found
References: <8BBF2644E619235100530A0285256D2D.00530A1785256D2D@webforums>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: anica-pc.sybase.com 172.31.141.239
Lines: 52
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1055
Article PK: 3010

It is possible to use the correlation name 'ef' as long as it is defined in
the UPDATE clause or it is defined in both the UPDATE clause and the FROM
clause. In the case when the correlation name is defined in both clauses,
only *one* instance of the table is used for that statement.

From the description of the UPDATE statement:
" If a FROM clause is used, it is important to qualify the table name the same
way in both parts of the statement."

E.g. the statements U1 and U2 are equivalent:

U1:
update DBA.Sec_Enabled_Features as ef set IsEnabled = @IsEnabled
from
DBA.Sec_Enabled_Features as ef join
Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID
where
sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature;

U2:
update DBA.Sec_Enabled_Features as ef set IsEnabled = @IsEnabled
from
Sec_Control as sc
where sc.Sec_AppID = ef.Sec_AppID and
sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature;

Richard wrote:

> Hello,
> I just want to know as a FYI...
>
> Here is my Stored Procedure...
>
> CREATE Procedure DBA.sp_Adm_EnableFeature(
> @AppName char(254),
> @ControlFeature char(254),
> @IsEnabled bit)
> AS
> SET NOCOUNT ON
> update ef set IsEnabled = @IsEnabled from
> DBA.Sec_Enabled_Features as ef join
> Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
> sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature;
>
> Why can't I use this style
>
> update ef set IsEnabled = @IsEnabled from
> DBA.Sec_Enabled_Features as ef join
> Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
> sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature
>
> instead of this style
>
> update DBA.Sec_Enabled_Features as ef set ef.IsEnabled = @IsEnabled from
> DBA.Sec_Enabled_Features as ef join
> Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
> sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature
>
> I didn't want to ref the table name twice...
>
> Thanks


Robert Waywell Posted on 2003-05-21 18:16:39.0Z
From: "Robert Waywell" <nospam_rwaywell@ianywhere.com>
References: <8BBF2644E619235100530A0285256D2D.00530A1785256D2D@webforums>
Subject: Re: Table "ef" not Found
Date: Wed, 21 May 2003 14:16:39 -0400
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <e5TEdW8HDHA.220@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: rwaywell-pc.sybase.com 172.31.143.74
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1054
Article PK: 3979

If you take a look at the UPDATE syntax, there are 2 possible table lists in
the UPDATE statement. The list in the FROM clause is separate from the list
immediately after the UPDATE keyword. I'm surprised that you can use the
same alias in both lists, but I believe you are still getting 2 separate
copies of the table in your current statement.


--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

<Richard> wrote in message
news:8BBF2644E619235100530A0285256D2D.00530A1785256D2D@webforums...
> Hello,
> I just want to know as a FYI...
>
> Here is my Stored Procedure...
>
> CREATE Procedure DBA.sp_Adm_EnableFeature(
> @AppName char(254),
> @ControlFeature char(254),
> @IsEnabled bit)
> AS
> SET NOCOUNT ON
> update ef set IsEnabled = @IsEnabled from
> DBA.Sec_Enabled_Features as ef join
> Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
> sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature;
>
>
> Why can't I use this style
>
> update ef set IsEnabled = @IsEnabled from
> DBA.Sec_Enabled_Features as ef join
> Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
> sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature
>
> instead of this style
>
> update DBA.Sec_Enabled_Features as ef set ef.IsEnabled = @IsEnabled from
> DBA.Sec_Enabled_Features as ef join
> Sec_Control as sc on sc.Sec_AppID = ef.Sec_AppID where
> sc.Application_Name = @AppName and ef.Control_Feature = @ControlFeature
>
> I didn't want to ref the table name twice...
>
> Thanks