Home » Infrastructure » Unix » String manipulation
String manipulation [message #97972] Wed, 06 August 2003 08:16 Go to next message
priya
Messages: 108
Registered: February 2000
Senior Member
Hi,
I am connecting to sqlplus from shell script

OUT=`sqlplus -s DLP_OWNER@LMDS_DEV/DLP_OWNER << END
WHENEVER SQLERROR EXIT FAILURE
WHENEVER OSERROR EXIT FAILURE
SET HEADING OFF
SET PAGES 0
SET FEEDBACK OFF
SELECT num1 || ',' ||num2
FROM tab1;
END`
echo "$OUT"

and i am printing this using a select:
100,300
301,500
501,600

With the values obtained above,
In a loop,I need to invoke another procedure.
Can anybody help me with the array/string manipulation needed here,before calling the next procedure?

I want to do something like this.
loop (3 times in this example)
invoke procedure with val1 val2
end loop
where val1 and val2 would be 100 and 300 for first iteration,301 and 500 for the second and
501 and 600 for the third iteration.
I want to $OUT as an array having 100 and 300 as first element and so on...
Please help.
Thanks,
Priya.
Re: String manipulation [message #97999 is a reply to message #97972] Thu, 02 October 2003 16:09 Go to previous messageGo to next message
Matt
Messages: 43
Registered: September 1999
Member
if you have a file called temp:
$ cat temp
100 300
101 400
102 500

$ while read val1 val2
> do
> printf "%s %s n" "$val1" "$val2"
> echo "value one is $val1 value two is $val2"
> done < temp

100 300
value one is 100 value two is 300
101 400
value one is 101 value two is 400
102 500
value one is 102 value two is 500
Re: String manipulation [message #98001 is a reply to message #97972] Thu, 02 October 2003 16:14 Go to previous message
Matt
Messages: 43
Registered: September 1999
Member
if you have a file called temp:
$ cat temp
100 300
101 400
102 500

$ while read val1 val2
> do
> printf "%s %s n" "$val1" "$val2"
> echo "value one is $val1 value two is $val2"
> done < temp

100 300
value one is 100 value two is 300
101 400
value one is 101 value two is 400
102 500
value one is 102 value two is 500
Previous Topic: How do I extend the table space for a database?
Next Topic: Replacing Production Server with SunFire V880 and Larger Disks
Goto Forum:
  


Current Time: Sat Jan 16 12:41:10 CST 2021