M
Miro
I have a scaller query that can return a null value.
Here is how I get around it:
(start pseudocode)
if ( scalarquery return count > 0 )
dim bla as integer = scalarquery top 1 of columnA order by columnA
(End Pseudocode)
This way I will never get a null being assigned to the integer which creates
an exception.
Is there another way around this? - other than a try catch statement i
guess? <- or is that another proper way.
I just was trying to figuer out if there was a way that I didnt have to hit
the database twice.
Once get get the count of what my result will return,
and the other is the result - so incase there are no records i dont crash
cause of a dbnull.
Thanks,
Miro
Here is how I get around it:
(start pseudocode)
if ( scalarquery return count > 0 )
dim bla as integer = scalarquery top 1 of columnA order by columnA
(End Pseudocode)
This way I will never get a null being assigned to the integer which creates
an exception.
Is there another way around this? - other than a try catch statement i
guess? <- or is that another proper way.
I just was trying to figuer out if there was a way that I didnt have to hit
the database twice.
Once get get the count of what my result will return,
and the other is the result - so incase there are no records i dont crash
cause of a dbnull.
Thanks,
Miro