VALUE is an SQL operator defined in the SQL-1999 standard and implemented in object-relational databases such as Oracle. It takes a table alias (usually of an object table) or a REF column and returns the complete object instance stored in that row. VALUE is most useful when a table stores objects of a user-defined type and you need the whole object rather than individual attributes. In pure relational tables, selecting * already gives all column values, so VALUE is rarely needed.Key points:- Works only on tables whose rows are of an object type, or on REF columns that point to such rows.- Returns a single typed object, not a scalar.- Can be used in SELECT, WHERE, GROUP BY, and ORDER BY clauses.- Different from the more common VALUES row constructor and from MySQL’s deprecated VALUES() function.- Not supported in most purely relational engines such as MySQL, SQLite, or PostgreSQL without object extensions.
VALUES, REF, DEREF, OBJECT TYPES, SELECT *
SQL:1999 object-relational extensions (Oracle 8i)
VALUE returns the row as one typed object, while SELECT * returns individual scalar columns. Use VALUE when working with object tables.
Yes. In PL/SQL you can fetch the object into a variable, modify its attributes, and then update the table by assigning the variable back to VALUE(table_alias).
You can use VALUE on the outer object. To access nested collections, use collection methods (e.g., TABLE(), CAST()) after retrieving the object.
VALUE takes a table alias, not the table name itself. Always supply the alias used in the FROM clause, e.g., VALUE(p) not VALUE(person).