hI

i am running a perl script which is big enough to post here,but i will post the part which throws error.

I am trying to retrieve rows through an sql query.



#--------------script--------------------

#4.1.Finding job sets id
print("\nFinding job sets id from table jobs..\n");
$sql =<<"EOF";
select job_id from moose.jobs
where parent_id = '$job_app'
EOF

debug("SQL>$sql", 2);
$s = $db->prepare($sql);
$s->execute();
while (@row = $s->fetchrow_array){
print join(",",@row),"\n";
$jobs = join(",",@row);
print("jobs = $jobs");
}



Now when I run this script,it gives the following error :

Finding job sets id from table jobs..
Use of uninitialized value in concatenation (.) or string at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in concatenation (.) or string at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in concatenation (.) or string at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in concatenation (.) or string at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in concatenation (.) or string at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in concatenation (.) or string at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in array element at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in concatenation (.) or string at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in concatenation (.) or string at ./removeMooseBuild_dev_nidhi.pl line 340.
Use of uninitialized value in array dereference at ./removeMooseBuild_dev_nidhi.pl line 340.
SQL> select job_id from moose.jobs
where parent_id = 1385279
EOF

debug("SQL> select job_id from moose.jobs
where schedule_id = '1385277'
", 2);
DBI::st=HASH(0x51f588) = DBI::db=HASH(0x35cd58)->prepare( select job_id from moose.jobs
where schedule_id = '1385277'
);
DBI::st=HASH(0x51f588)->execute();
....and so on..


Ideally the query returns three rows with a single column integer value in each row such as :
80
84
92

Also,$job_app is not null..can you please help me out with the possible mistake i am making..?