Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: Table variables - bug or usage issue

$
0
0

More oddities with table variables

 

declare @tab table

(

    PK char(8),

    XC char(3),

    XS  varchar(8),

    XT  char(3)

)

 

 

create table s

(

    PK char(8),

    C char(3),

    S   varchar(8),

    T   char(3)

)

 

This code works

     update @tab

     set

             XC = s.C,

             XS = s.S,

            XT = s.T

    from @tab p , s

    where p.PK = s.PK

 

But if you do the update of the columns in a different order like this...

     update @tab

     set

             XS = s.S,

             XC = s.C,

            XT = s.T

    from @tab p , s

    where p.PK = s.PK

 

you get

 

     Invalid column name 'XC'.

     Invalid column name 'XT'.

 

I'm beginning to wonder about the implementation of table variables.


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>