Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Oracle Directory problem within the Oracle forums, part of the Databases category; Actually i am working on some project which require external file link with oracle, so i tried the following. 7369,smith,clerk,20 7499,allen,salesman,30 7521,ward,salesman,30 7566,jones,manager,20 7654,martin,salesman,30 is stored as demo1.dat in c:external ...
|
|||||||
| Oracle Oracle 9i & Oracle 10g Knowledge Base Learn and Share Oracle Technology related articles, white papers, tutorials / study materials, example codes, FAQ's, Tips and Tricks. |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
Oracle Directory problem
Actually i am working on some project which require external file link with oracle, so i tried the following.
7369,smith,clerk,20 7499,allen,salesman,30 7521,ward,salesman,30 7566,jones,manager,20 7654,martin,salesman,30 is stored as demo1.dat in c:external directory. Using sys create or replace directory dat_dir as 'c:external'; grant read on directory dat_dir to scott; are executed. Connect scott/tiger; create table ext_tab2 ( empno char(4), ename char(20), job char(20), deptno char(2)) organization external (type oracle_loader default directory ext access parameters ( records delimited by newline fields terminated by 0x'09' missing field values are null (empno, ename, job, deptno)) location ('demo1.dat')) parallel reject limit 10 select * from ext_tab2; here its giving the result as no rows created, and creating bad file and 2 log files . If i view bad file its shows the same content as in demo.dat, & a log file contains error as "too larger to fit in to column". But column size is correct. Can any one help me solving this. Thank you in advance. |
| The Following User Says Thank You to vidya_kr For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Oracle Directory problem
Create directory mydir as 'd:\';
----------------------------------------- grant read,write on directory mydir to debasis; ----------------------------------------- create table extemp1 ( empno number(4), ename varchar2(10), job varchar2(9), mgr number(4), hiredate date, sal number(7,2), comm number(7,2), deptno number(2) ) organization external ( type oracle_loader default directory mydir access parameters ( records delimited by newline skip 1 fields terminated by ',' ( empno char, ename char, job char, mgr char, hiredate char, sal char, comm char, deptno char )) location('data.lst') ) reject limit 1 ; try the above code,it will solve your problem |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To select Oracle DBA or Oracle Developer? | s_p_talele | Career Advice | 2 | 06-30-2008 08:08 PM |
| Read all files as they arrive in directory and then process | Geek_Guest | Oracle | 0 | 03-07-2007 06:34 AM |
| div tag problem... | psuresh1982 | JavaScript | 3 | 02-03-2007 09:05 AM |
| Problem with awk | sharifhere | Unix/Linux | 12 | 01-17-2007 05:12 AM |
| One minute Problem | Remasri | Brainteasers | 2 | 08-31-2006 12:35 PM |