How to pass ksh array to oracle


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to pass ksh array to oracle
# 1  
Old 11-28-2008
How to pass ksh array to oracle

Hi all..

Does anyone know have an example of passing the contents of a ksharray to oracle?

basically I am looking to loop through the contents of a file and store each line into a bash ksh. Once i have this I can then pass the array into an oracle procedure that accepts an array as an argument and process it from there..

any code snippets would be great ?
# 2  
Old 12-05-2008
Code:
let i=0
cat file.txt | while IFS="" read x[i]; do let i=i+1; done

Then later:
Code:
for r in "${x[@]}"; do
  sqlplus .... $r
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass and read an array in ksh shell script function.?

I'm able to read & print an array in varaible called "filelist" I need to pass this array variable to a function called verify() and then read and loop through the passed array inside the function. Unfortunately it does not print the entire array from inside the funstion's loop. #/bin/ksh... (5 Replies)
Discussion started by: mohtashims
5 Replies

2. UNIX for Dummies Questions & Answers

How to pass first array value?

Hi, I am creating filesystem for block device, but I want to pass array value one by one acording to block device count. $tmp1 = block device count 3 $blockdevice = So I want to first pass sdb1 alone in loop, how to take only block device seprately from $blockdevice array. (1 Reply)
Discussion started by: stew
1 Replies

3. Shell Programming and Scripting

Pass array to a function and display the array

Hi All I have multiple arrays like below. set -A val1 1 2 4 5 set -A val2 a b c d . . . Now i would like to pass the individual arrays one by one to a function and display/ do some action. Note : I am using ksh Can you please advise any solution... Thanks in advance. (7 Replies)
Discussion started by: Girish19
7 Replies

4. Shell Programming and Scripting

Always pass SIGINT in ksh

The following command will run and wait for input from the user. /usr/sap/SAP/webdisp/wdispmon pf=/usr/sap/SAP/webdisp/profile What I would like to do is (in one command): - Add the above line to a ksh script - Receive the output - and send a SIGINT I have seen many posts on how to... (3 Replies)
Discussion started by: sapsid
3 Replies

5. Shell Programming and Scripting

Pass perl array to SQL oracle

Hello, Could someone please suggest if there is a way to pass an perl array(pass @v_array) to SQL as in below eg : #!/usr/bin/perl @v_array = (1,2,4,5,6,8); $db_userid = 'ni71/ni711'; $bufTPO = qx{ sqlplus -s << EOF $db_userid set verify off set feedback off set... (1 Reply)
Discussion started by: arunshankar.c
1 Replies

6. UNIX for Dummies Questions & Answers

How to pass array as an arguement ?

Hi experts, I am here again with another Issue. I need to pass the array as parameter / argument to another script. I tried it as follows . ( I got this idea from the link ) $ cat test1.sh #! /usr/bin/ksh set -a arr1 echo "...In Test1...." arr1="APPS_DEV" arr1="TEST_DEV" echo... (16 Replies)
Discussion started by: rajavu
16 Replies

7. Programming

[ C ] multidemensional array pass to functions

Please excuse my ineptitude for a bit as I've been spoiled for the past few months with only writing perl code instead of C. So ok, I've been thinking about some code to change the crc32 values that are held within central directory headers of zip files. Because I'm lazy I decided to just... (3 Replies)
Discussion started by: VRoemer
3 Replies

8. UNIX for Dummies Questions & Answers

How To Pass an Array Variable

Hi, I have a master BASH shell script where I define a bunch of variables: $var1=why $var2=is $var3=(this so hard) I would then like to call another shell script and pass these variables to it: $script2 $var1 $var2 $var3 This works fine for var1 and var2. However, var3 is an array,... (9 Replies)
Discussion started by: msb65
9 Replies

9. UNIX for Advanced & Expert Users

How can i pass a file from unix to oracle??

I am having a file which has the following data 123424 2354235 142424 43423 1434 . . . . etc i want to pass these values to oracle at a time by using a file.. can someone suggest me a answer... waiting...... (1 Reply)
Discussion started by: vidyadhar85
1 Replies

10. UNIX for Dummies Questions & Answers

How to pass unix variable to oracle

hi , how to pass unix variable to oracle code is ............. #! /bin/ksh echo enter date vale read date1 sqlplus x/y@oracle select * from emp where statrt_date= $date1 is this is correct way... (1 Reply)
Discussion started by: chiru
1 Replies
Login or Register to Ask a Question