Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:14:12+00:00 2026-06-13T20:14:12+00:00

i have a script & it goes as below, instant_client=/root/ora_client/instantclient_11_2 output=`$instant_client/sqlplus -s HRUSER/HRUSER@TOMLWF <<EOF

  • 0

i have a script & it goes as below,

instant_client="/root/ora_client/instantclient_11_2"

output=`$instant_client/sqlplus -s HRUSER/HRUSER@TOMLWF <<EOF
set heading off
set feedback off
set lines 10000
set pagesize 10000
select count (1) from onboardingcandidates o, candidatedetails c where o.candidateid=c.candidateid and o.JOININGSTATUS='0091' and to_date(o.joiningdate)=to_date(sysdate+5);
EOF
exit
`

query=(`$instant_client/sqlplus -s HRUSER/HRUSER@TOMLWF <<EOF
set heading off
set feedback off
set lines 10000
set pagesize 10000
select o.candidateid from onboardingcandidates o, candidatedetails c where o.candidateid=c.candidateid and o.JOININGSTATUS='0091' and to_date(o.joiningdate)=to_date(sysdate+5);
EOF`)
i=0
echo "Throwing individual arrays:"
while [ $i -lt $output ]
do
    a=${query[$i]}
    echo Candidate[$i]=$a
    i=$(($i+1))
done

OUTPUT:

Throwing individual arrays:
Candidate[0]=cand1
Candidate[1]=cand2
Candidate[2]=cand3
Candidate[3]=cand62

REQUIRED OUTPUT

Everything is working fine.

All i need is, i need 1 output at a time.

i.e. if i run the above script then the output should be controlled.

It should throw 1 output at a time on the prompt.

Is this possible ??

IF YOU NEED ANYTHING MORE THEN PLZ ASK. I HOPE I AM CLEAR WITH MY DOUBT

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:14:13+00:00Added an answer on June 13, 2026 at 8:14 pm

    So you’re running two queries, one to get the count of the number of results, the second to get the results.

    If you want to only have one query, you can iterate through the count of the number of results. as the variable query is an array, you can use:

    ${#query[*]}
    

    as the number of result rows, then use:

    while [ $i -lt ${#query[*]} ]
    

    as the loop condition.

    If you want to display one result at a time, and require an enter between them, then you can add a read after the echo.

    If you want to display a specific return row, then, assuming that the routine is called as-is, then the row number to display is passed in as the first parameter $1, then you can use:

    a=${query[$1]}
    echo Candidate[$1]=$a
    

    if you just want to display the result at that line, without the Candidate[] text, then you can just echo:

    echo ${query[$1]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script which tracks visits & referers to a website. I send
I have this script, works ok: #!/usr/bin/perl $key = pack(H*,3cb37efae7f4f376ebbd76cd); $str = &4\=80CHB'; $dec
I have a ColdFusion script that does: <cfset content = replace(content,&##147;,,all)> Which replaces &147;
Problem background I have a post-commit script for my SVN repository which archives &
I have MVC3 project & Valums file uploader . The code is following <script
In my project.gwt.xml file I have <script src=http://maps.google.com/maps?gwt=1&amp;file=api&amp;v=2&amp;sensor=false;key=MYKEY /> But, when I load my
I have the following rewrite set up: RewriteRule r/(.*) scripts/report.php?cp=1&id=$1 It works great to
I have a form which goes to the following login script when it is
I have a Python script gathering info from some remote network devices. The output
I have a script which does launch another application using nohup my_app & ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.