views:

52

answers:

1
+2  Q: 

SQL Virtual Column

I am getting the 'SQL Error: ORA-01733: virtual column not allowed here'

Here is my code:

update (
   Select g.FIRST300BB from ( 
      select FIRST300BB, row_number() over (order by pitchandeventid) r
      from gamedata_me 
      where hitterid = 5000
      and (eventcode = 'BB')
   ) g
   where r between 0 and 300
) t
set t.FIRST300BB =1

Any Ideas? I am stuck, using Oracle so I've discovered I cannot do the Update/From syntax...so I've officially circled the wagons

+6  A: 

Try an equivalent query for example

update gamedata_me 
  set first300BB=1
where rowid in(
          Select g.rid from ( 
              select rowid rid, row_number() over (order by pitchandeventid) r
                  from gamedata_me 
                 where hitterid = 5000
                 and (eventcode = 'BB')
               ) g
   where r between 0 and 300
    ) 
josephj1989
+1 This update does the trick.
APC