-- Use type definition as the source of the attribute set for an expression CREATE OR REPLACE TYPE Car4Sale AS OBJECT (Model VARCHAR2(20), Year NUMBER, Price NUMBER, Mileage NUMBER); / -- Defining an attribute set BEGIN DBMS_EXPFIL.CREATE_ATTRIBUTE_SET(attr_set => 'Car4Sale', from_type => 'YES'); END; / -- Create user table with expression column (or add new varchar2 column to existing table) CREATE TABLE Consumer (CId NUMBER, Zipcode NUMBER, Phone VARCHAR2(12), Interest VARCHAR2(200) ); --Assign attribute set to the expression column in the table BEGIN DBMS_EXPFIL.ASSIGN_ATTRIBUTE_SET ( attr_set => 'Car4Sale', expr_tab => 'Consumer', expr_col => 'Interest'); END; / -- Insert expressions in the table INSERT INTO Consumer VALUES (1, 32611, '917 768 4633','Model=''Taurus'' and Price < 15000 and Mileage < 25000'); INSERT INTO Consumer VALUES (2, 03060, '603 983 3464','Model=''Mustang'' and Year > 1999 and Price < 20000'); -- Apply the SQL EVALUATE operator SELECT * FROM Consumer WHERE EVALUATE (Consumer.Interest, 'Model=>''Mustang'', Year=>2000, Price=>18000, Mileage=>22000' ) = 1; SELECT * FROM Consumer WHERE EVALUATE (Consumer.Interest, Car4Sale('Mustang', 2000, 18000, 22000).getVarchar() -- MEMBER getVarchar() API -- ) = 1;