I am trying to allow the role titled Head to be able to query a table titled ReportDetails. The table ReportDetails contains a varying array titled ReportEntries_VA. I have got as far as testing my database and found that even though I have granted SELECT on ReportDetails, Head is still not able to access ReportEntries_VA.
Code is as follows:
CREATE TYPE ReportEntries_Type AS OBJECT
(Subject VARCHAR (500));
/
CREATE OR REPLACE TYPE ReportEntries_VA AS
VARRAY (12) OF ReportEntries_Type;
/
CREATE TABLE ReportDetails
(ReportID INTEGER NOT NULL UNIQUE,
StudentID INTEGER NOT NULL UNIQUE,
ReportEntries ReportEntries_VA,
DateLastModified DATE NOT NULL,
CONSTRAINT ReportDetails_PK PRIMARY KEY (ReportID, StudentID),
CONSTRAINT RDStudentIDSD FOREIGN KEY (StudentID)
REFERENCES StudentDetails (StudentID));
The privilege is then granted to Head as follows:
GRANT SELECT ON ReportDetails TO Head;
Any suggestions as to how I can allow Head to access the varying array (and the object created before it?) would be greatly appreciated.
Many thanks,
Zulu
You need to grant
EXECUTEprivilege on all the types to yourHeadrole.See Managing Oracle Objects.