![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing parameters form unix to Oracle procedure | rajasekharamy | Shell Programming and Scripting | 0 | 04-12-2007 09:24 AM |
| passing oracle parameters back to Shell | satnamx | Shell Programming and Scripting | 4 | 01-16-2007 09:59 AM |
| Shell arrays in oracle stored procedure | superprogrammer | Shell Programming and Scripting | 6 | 06-09-2005 07:36 PM |
| CGI passing arrays/hashes to another CGI script | WIntellect | Shell Programming and Scripting | 2 | 01-13-2003 11:22 AM |
| Passing arrays to oracle from unix | krishnasai | Shell Programming and Scripting | 7 | 08-12-2002 08:01 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi all...
Im looking to pass the contents of a simple file to Oracle so that it can be stored in a database table. The best way i can think of to avoid overhead is to loop through the contents of the file and store the data in a bash array. then the array can be passed to SQL Plus where Oracle can loop through the array and write the data away. Is this a good way of doing it? if it is...does anyone have an exmple of how to pass an array from the bash shell to oracle eg simple file called name.txt that contains the following.. tom dick harry any help on this would be reatly appreciated? This can be done by looping through lines in the file and for each line open up an oracle connection to write the data away eg but tis is expensive performance wise. loop through file contents "insert into table values variable1, variable2 ect| sqlplus -s scott/tiger |
|
||||
|
sqlldr is the best choice - vgersh99 is right on top of that. Otherwise learn about the UTL_FILE package. And learn some PL/SQL. Sometimes I've used an editor to turn a small flat file into several dozen insert statements, when the data is in columns and my editor supports macros. Turn Code:
John Doe USA -- into insert into mytable values ( 'John', 'Doe', 'USA'); ............ commit; Last edited by vgersh99; 04-05-2006 at 10:08 AM.. |
|
||||
|
Cant use sql loader or UTL File
Hi Guys, thanks for the sugesstion but i am already using SQL loader to load the contents of a csv file into Oracle and I can't use UTL FIle as That can only be used to manipulate files located on the same server as the database. I am working with files on the applications server which is different to the database server in our environment.
The file contents I want to load into Oracle is actually the LOG file produced by SQL Loader and this file is not of any particulat format hence the use of arrays to pass it to Oracle in 1 go. It would be good to have an example of passing a bash array into oracle as reference... pretty pleaseeeee ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|