Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    37

    Unanswered: Process multiple records returned

    The following Array (file_var) is declared in a shell script.
    set -A file_var
    ${file_var[0]}
    ${file_var[1]}
    ${file_var[2]}
    ${file_var[3]}
    ${file_var[4]}
    ${file_var[5]}
    ${file_var[6]}
    ${file_var[7]}
    ${file_var[8]}
    ${file_var[9]}
    set -A file_var `$ORACLE_BIN/sqlplus -s $UN/$PW@$SID @pass_out.sql

    The pass_out.sql script returns more than 1 record. I want to process all the records returned by the sql in a loop and then exit.

    Any help is appreciated

    Thanks

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    The length of an array can be determined using...
    Code:
    ${#ARRAY[*]}
    So you would want to implement something like this...
    Code:
    while (( ${i=0} < ${#ARRAY[*]} )); do print ${ARRAY[$i]}; i=$((i + 1)); done
    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •