A stupid question that has always bugged me.
Within procedures, most times I want to do a select into a variable and if no result is returned I don't want anything to happen except return a null value. Typically I handle this with something like "select max(whatever_col) into MyVariable from something_table". Surely there is a better way of handling this?
Within procedures, most times I want to do a select into a variable and if no result is returned I don't want anything to happen except return a null value. Typically I handle this with something like "select max(whatever_col) into MyVariable from something_table". Surely there is a better way of handling this?