consider two methods in a script as below,

spool $file1
select column1 from table1;

spool $file2
select column1 from table2 where column2='xxxxx'

The first method returns just one value say 10001,I have to use this result in the second method in place xxxxx.
I used to call the method as

do_a >> ${outfile}
do_b >> ${outfile}

tell me how to get the arguments from method1 and pass it to method2.

Hey There,

The simplest way would be to have the first method/function return the result:

return 10001 - or return $variable

Then call method/function 2 with the return variable from method/function 1 as its argument.

do_b 10001 - or do_b $variable

Depending on how your shell scopes it could be as simple as that or you may have to "eval" the inital function/method as an argument to your second.

, Mike