computed column calculate a value based on different table
- by adnan
i've a table c_const
 code  |  nvalue
 --------------
 1     |  10000
 2     |  20000  
and i've another table t_anytable
 rec_id |  s_id  | n_code
 ---------------------
 2      |  x     | 1
now i want to calculate the x value with computed column, based on
 rec_id*(select nvalue from c_const where code=ncode)
but i get error "Subqueries are not allowed in this context. Only scalar expressions are allowed."
how can i calculate the value in this computed column ?
thanks.