Gel query variable can't be tested when Query returns no results

Discussion created by BradGibson on Oct 12, 2010
Latest reply on Oct 12, 2010 by BradGibson
Gel script problem... when my query returns nothing, the variable doesn't exist and the script errors out when I try to test the value...     
select ove_report_actual_dt-ove_bi_date_sub from odf_ca_project proj where${gel_objectInstanceId}

Days Difference is ${sqlDaysDifference[0]}   
update odf_ca_project
set ove_bi_dtd = (select
                              when prj2.ove_bi_status1 = 'bi_delivered'   then nvl(${sqlDaysDifference[0]},0)
                              else 0
                              end ohle
                              odf_ca_project prj2
      id = ${gel_objectInstanceId}  When I get results in the query, everything is fine.. but when the query results are empty, I get an error in the log where the select statment has no expression where ${sqldaysdifference[0]} should be :   (select case when prj2.ove_bi_status1 = 'bi_delivered' then nvl(,0) else 0 end ohle from odf_ca_project prj2 where 5003617) where id = 5003617   its like the variable doesn't exist...     Any ideas?