Load from a text file [message #563066] |
Wed, 08 August 2012 04:21 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/8488ecec61942e650599453250a66e7f?s=64&d=mm&r=g) |
vibo
Messages: 21 Registered: August 2012
|
Junior Member |
|
|
Hi,
I would like to load a text file into an oracle table. Could you please help me.
Thanks
VIBO
|
|
|
|
|
|
|
Re: Load from a text file [message #563074 is a reply to message #563070] |
Wed, 08 August 2012 05:58 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/8488ecec61942e650599453250a66e7f?s=64&d=mm&r=g) |
vibo
Messages: 21 Registered: August 2012
|
Junior Member |
|
|
Hi I am using an external table instead of SQL Loader. I have place the text file report.txt in a folder C:\Report and have executed the below code. I does not allow me to insert into the security table. Could you possibly find the error.
Create Directory external_dir AS 'C:\Report';
GRANT READ ON DIRECTORY external_dir TO Sys;
CREATE TABLE security_load
(output_path varchar(300),
output_account varchar(300),
output_permission VARCHAR(300))
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY external_dir
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
FIELDS (output_path varchar(300),
output_account varchar(300),
output_permission VARCHAR(300)))
LOCATION ('Report.txt'));
create table security ( PATH varchar(300),Accounts varchar(300),permission varchar(300));
insert into security ( PATH, Accounts, permission )
(select output_path, output_account, output_permission from security_load);
select * FROM SECURITY_LOAD;
[Updated on: Wed, 08 August 2012 07:16] by Moderator Report message to a moderator
|
|
|
Re: Load from a text file [message #563076 is a reply to message #563074] |
Wed, 08 August 2012 06:03 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68733 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
External tables can only read database LOCAL drives, are you sure that "C:\Report" is on the database server?
And you still don't say what "doesn't seem to work" means.
Just copy and paste your session.
Before, Please read How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Regards
Michel
[Edit: Add "database" before LOCAL to clear the point]
[Updated on: Wed, 08 August 2012 07:58] Report message to a moderator
|
|
|
|
|
Re: Load from a text file [message #563082 is a reply to message #563078] |
Wed, 08 August 2012 07:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
oerr ora 30653
30653,0000, "reject limit reached"
// *Cause: the reject limit has been reached.
// *Action: Either cleanse the data, or increase the reject limit.
Your data doesn't match your table definition
|
|
|
|