In Oracle, I have a table users
. Within this table, for every user, I want to be able to store an array of attributes of a user, that is, key-value pairs.
I could create an extra table with three columns—the foreign key pointing to the users
table, the key and the value—but I would prefer keeping things simple and don't want to create an additional table for that.
I know that Oracle has varrays, created like this:
CREATE OR REPLACE TYPE example AS VARRAY(20) OF NVARCHAR2(500);
How do I do the same thing, but instead of NVARCHAR2
, I would have a tuple (NVARCHAR2(50), NVARCHAR2(200))
?
All the resources about Oracle tuples point to either a grouping of columns to be used in a WHERE ... IN
clause, or Java-related documentation.