0
  1. I created a folder named "datosext2" on C:\
  2. I created a .txt file named "estados" on C:\datosext2
  3. On sqldeveloper, I created a directory said folder
GRANT CREATE ANY DIRECTORY TO HR;
CREATE DIRECTORY EDOS_MEX AS 'C:\datosext2';
GRANT READ, WRITE ON DIRECTORY EDOS_MEX TO PUBLIC:
  1. I created an external table named C_ESTADOS on said directory
CREATE TABLE C_ESTADOS (
  ESTADO_ID CHAR (2),
  ESTADO_NOMBRE VARCHAR2(50)
)
ORGANIZATION EXTERNAL (
  TYPE ORACLE_LOADER
  DEFAULT DIRECTORY EDOS_MEX
  ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE
    BADFILE 'bad_estados.bad'
    LOGFILE 'log_estados.log'
    FIELDS TERMINATED BY ','
    (ESTADO_ID CHAR (2),
     ESTADO_NOMBRE CHAR(50))
  )
  LOCATION ('estados.txt')
);
  1. I tried to run
SELECT *
FROM C_ESTADOS;
  1. I got this error:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
error opening file C:\datosext2\log_estados.log
29913. 00000 -  "error in executing %s callout"
*Cause:    The execution of the specified callout caused an error.
*Action:   Examine the error messages take appropriate action.
  1. I tried granting READ and WRITE privileges to my user, but it did not work, even though I got no error after granting said privileges
4
  • Which computer is a database server? Is it your own PC, so C:\datosext2 directory exists on a database server? Error says that LOG file can't be opened in that directory. Are there any other errors? If so, which ones? Consider posting the whole process, from the 1st step (the way you created directory, grants; sample file; CREATE TABLE statement; selecting from it and the whole error stack). Commented Jan 21, 2024 at 20:40
  • You probably need to grant operating system privileges on the folder to the Oracle user or group. Commented Jan 21, 2024 at 21:32
  • How can I grant OS privileges on the folder to the Oracle user or group? Commented Jan 21, 2024 at 22:19
  • @LuisEmilioGonzálezRuiz See my directions in this answer. Commented Jan 22, 2024 at 4:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.