Create directory in UNIX [message #588766] |
Fri, 28 June 2013 04:07 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/62d78d638462f85e9c75434f4c85df3a?s=64&d=mm&r=g) |
eshwar401
Messages: 17 Registered: June 2013 Location: India
|
Junior Member |
|
|
Hi Team,
What is the script for creating SQL directory in UNIX.
Create or replace directory CONFIG as 'c:\Config\'
Please reply ASAP.
Thanks,
Eshwar.
|
|
|
|
|
Re: Create directory in UNIX [message #588770 is a reply to message #588768] |
Fri, 28 June 2013 04:24 ![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) |
John Watson
Messages: 8964 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
A matter of etiquette: phrases such as Quote:Please reply ASAP. sometimes annoy people on forums, who answer in their free, unpaid, time only because they are nice people who want to contribute to the total of global happiness.
LF has already told you what needs to be done, and I have to say that if you cannot work out the command (and have the directory with appropriate permissions) you probably should not be executing it. But anyway,
create directory d1 as '/home/oracle';
works for me.
|
|
|
|
Re: Create directory in UNIX [message #588774 is a reply to message #588771] |
Fri, 28 June 2013 05:11 ![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/62d78d638462f85e9c75434f4c85df3a?s=64&d=mm&r=g) |
eshwar401
Messages: 17 Registered: June 2013 Location: India
|
Junior Member |
|
|
thanks everyone for the replies..
The issue here is i don't have DBA permissions on the db to create the folder and getting a dba help in executing this statement takes a lot of time.
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:88212348059
Have used above link for taking data from tables and create csv files.
But i cannot use create directory statement because of the permissions issue. With the directory object it is not allowing to execute the stored procedure if i hard code the value of the path it throws the following error:
ERROR at line 1:
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 33
ORA-06512: at "SYS.UTL_FILE", line 436
ORA-06512: at "VEMS.MAIL_ATTACH", line 27
ORA-06512: at line 1
Any suggestions?
Thanks,Eshwar.
[Updated on: Fri, 28 June 2013 05:12] Report message to a moderator
|
|
|
|
|
Re: Create directory in UNIX [message #588784 is a reply to message #588781] |
Fri, 28 June 2013 06:44 ![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/62d78d638462f85e9c75434f4c85df3a?s=64&d=mm&r=g) |
eshwar401
Messages: 17 Registered: June 2013 Location: India
|
Junior Member |
|
|
I have tried following in SQLPlus:
SQL> SET FEEDBACK OFF HEADING OFF ECHO OFF
SQL> SPOOL C:\External_Tables\emp.csv
SQL> SELECT *FROM EMP ;
SQL> SPOOL OFF
it is creating following output
SQL> SELECT *FROM EMP;
INCOL Inbound collector
SQL> SPOOL OFF
Required output:
INCOL,Inbound collector
BOLD IS NOT REQUIRED JUST GIVE FOR IDENTIFICATION
what are the changes required to the above statements to achieve this?
Thanks,
Eshwar.
[Updated on: Fri, 28 June 2013 06:46] Report message to a moderator
|
|
|
|
|
Re: Create directory in UNIX [message #588787 is a reply to message #588786] |
Fri, 28 June 2013 07:51 ![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/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Set column separator:
SQL> set colsep ,
SQL> select * from dept;
DEPTNO,DNAME ,LOC
----------,--------------,-------------
10,ACCOUNTING ,NEW YORK
20,RESEARCH ,DALLAS
30,SALES ,CHICAGO
40,OPERATIONS ,BOSTON
SQL>
As of an empty line - no idea.
What will you use these CSV files for?
|
|
|
|
Re: Create directory in UNIX [message #588795 is a reply to message #588787] |
Fri, 28 June 2013 08:06 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Littlefoot wrote on Fri, 28 June 2013 08:51Set column separator:
[code]SQL> set colsep ,
However, be mindful of data such as addresses that have commas in them. It will throw off your fields for that row.
|
|
|