Supported by
Supported by Inetum

SELECT SINGLE vs SELECT UP TO 1 ROWS

images/thumbnail.jpg - Thumbnail

Man, this is one of those endless discussions that will never get anywhere. Ditto trying to decide if you deserve to go on living if you put pineapple on your pizza or Philadelphia cheese on your sushi.

When you want to retrieve a single record from a database table using the complete primary key there is no question: SELECT SINGLE. But what about when you have the incomplete primary key? Some time ago there was a discussion in the Clean ABAP repository about this. Most people said that they still preferred using SELECT SINGLE. Except when you need to reorder it since SELECT SINGLE doesn’t support ORDER BY. But some people still said that if the primary key is incomplete, they use SELECT UP TO 1 ROWS to warn other programmers of that fact.

I, as said there, always use SELECT SINGLE.

If you thought I was going to give you a definitive answer, I’m sorry. Just know that I do my best to avoid sushi with Philadelphia cheese. I won’t tell you if I eat pizzas with pinapple because I’m ashamed to say it.

Thank you wuestenigel for the photo.

Greetings from Abapinho.