Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

External table creation fails in proc but works in client

Status
Not open for further replies.

SimonSellick

Programmer
Nov 3, 2003
305
GB
The following statement, run in TOAD on a PC, successfully creates an external table as a reference to an existing file under unix and 9i:
Code:
CREATE TABLE EXT_blake_dat (
  crn char(11),
  location char(20)
)
 ORGANIZATION EXTERNAL (
  TYPE ORACLE_LOADER
  DEFAULT DIRECTORY BLAKA02_DAT_DIR
  ACCESS PARAMETERS (
   FIELDS TERMINATED BY ',' (
    crn      char(11),
    location char(20)
   )
  )
  LOCATION ('blake.dat')
 ) REJECT LIMIT UNLIMITED
If compiled into a procedure using execute immediate, the proc fails:
Code:
ORA-01031: insufficient privileges
ORA-06512: at "BLAKA02.BACS_LOAD", line 43
ORA-06512: at "BLAKA02.BACS_LOAD", line 62
ORA-06512: at line 7
The same user id was used to compile the procedure as to run the client session.

Can anyone shed light on this?
 
Sorted by a DBA here - for reference, the CREATE TABLE permission was granted to the user by a role. That is acceptable when running DDL via a client, but not, apparently, when running it via a stored procedure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top