abapOpenChecks icon indicating copy to clipboard operation
abapOpenChecks copied to clipboard

up to 1 rows

Open larshp opened this issue 8 years ago • 2 comments

can be replaced with SELECT SINGLE, when there is no ORDER BY?

I'm not sure why some use UP TO 1 ROWS, perhaps because of uniqueness warning from code inspector?

larshp avatar Nov 03 '17 06:11 larshp

and recommended by extended check, image

larshp avatar Aug 24 '18 06:08 larshp

story here, https://blogs.sap.com/2016/06/11/select-single-vs-select-up-to-1-rows/

See comment by Matthew, "If you use SELECT UP TO 1 ROWS with a partial key, and without ORDER BY, the result set is similarly undefined. In those cases, you should use SELECT SINGLE as is it is simpler – and it gives you a warning!

Really, SELECT UP TO 1 ROWS should give the same warning as SELECT SINGLE, if the ORDER BY is missing."

larshp avatar Aug 24 '18 06:08 larshp