I have a table query and if it can't find a value, i get a null value and an exception error. How can i change this query to return a 0 if nothing is found?
double bpm=0;
Table result=Table.query("SELECT [Nominal] FROM Packing_BPM_Rates_Analog WHERE ([Material]=$1)", token.Material);
if (result.numRows>0)
return bpm=result[1][1];
return 0;