Link to home
Start Free TrialLog in
Avatar of gs79
gs79

asked on

Reading file on client machine as an external table

The oracle is installed on a unix server. And I have oracle client on my local .

I have created a directory on local machine as follows..


CREATE OR REPLACE DIRECTORY ext AS 'c:\external';

and i have defined the external table xyz and specified 'Default directory' as 'ext'

now when i query the external table it throws following error:

ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file large_seller.dat in EXT not found
ORA-06512: at "SYS.ORACLE_LOADER", line 19

now when I change the EXT definition to a unix directory ('/staging/external')and place my file there it works fine..

My question is whether the file should be present only on the machine where oracle is installed?

Is there a way to read the file on local machine as external table? is the way I am specifying the local directory 'c:\external' correct?

Please help..

Thanks
Avatar of Sean Stuber
Sean Stuber

you can't unless your database server is able to mount the client's directory  (via NFS or Samba share)


even in that case, you're still using a "local" filesystem as far as the database is concerned,  it doesn't know that the files are sitting on a different server.
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can use sql loader on the client to load the data into a table in the database.
Avatar of gs79

ASKER

@slightwv.. Thank you for the response.. You mean to say you can load the data in the file on local machine into a table while you cannot read the file as external table as others have pointed?

Why is that so? I thought control file definition and external table definition is almost similar and if you can load the file into a table using sql loader just wondering why we can read the file as a table?

Thanks,
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gs79

ASKER

@slightwv..Thanks for the clarification and a very nice analogy!

@sdstuber..I will check out the package you have written sometime..BTW your blog on sending emails from database was excellent. It helped me a lot..

Thanks