Question

I've got the following objects:

CREATE FUNCTION CONSTFUNC RETURN INT
DETERMINISTIC
AS
BEGIN
RETURN 1;
END;

CREATE TABLE "FUNCTABLE" (
  "ID" NUMBER(*,0) NOT NULL,
  "VIRT" NUMBER GENERATED ALWAYS AS ("CONSTFUNC"()) NULL
);

however, the functable => constfunc dependency is not listed in all_ or user_ dependencies. Is there anywhere I can access this dependency information in the dictionary?

Was it helpful?

Solution

I just created your function and table in 11G (11.1) and can confirm your findings. I couldn't find anything in the Oracle docs either.

If you drop the function, the table status remains "VALID", but when you select from the table you get ORA-00904: "CHAMP"."CONSTFUNC": invalid identifier. This suggests that Oracle itself isn't aware of the dependency.

It might be worth asking this question on asktom.oracle.com, because Tom Kyte will have access to more information - he may even raise a bug about it if need be.

OTHER TIPS

The expression used to generate the virtual column is listed in the DATA_DEFAULT column of the [DBA|ALL|USER]_TAB_COLUMNS views.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top