Geeks Talk

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.

Oracle Directory problem

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 ...

Go Back   Geeks Talk > Databases > Oracle
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

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.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-27-2007
Junior Member
 
Join Date: Apr 2007
Location: shimoga
Posts: 8
Thanks: 1
Thanked 1 Time in 1 Post
vidya_kr is on a distinguished road
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.
Reply With Quote
The Following User Says Thank You to vidya_kr For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 06-25-2007
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,853
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
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
Reply With Quote
Reply

  Geeks Talk > Databases > Oracle

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


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


All times are GMT -4. The time now is 05:42 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved