Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement UPDATE OR INSERT INTO SELECT [CORE2447] #2861

Closed
firebird-automations opened this issue May 2, 2009 · 11 comments
Closed

Implement UPDATE OR INSERT INTO SELECT [CORE2447] #2861

firebird-automations opened this issue May 2, 2009 · 11 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Cosmin Apreutesei (cosmin_ap2)

Votes: 1

Syntax: UPDATE OR INSERT INTO (col_list) select_clause [matching_clause] [returning_clause]

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

IMHO, this is "nice to have".

The "EXECUTE BLOCK" functionality already allows a user/developer to construct a simple structure/statement to perform this task.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

is it different from already implemented MERGE statement ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Cosmin Apreutesei (cosmin_ap2)

Oh, and before you trash this (again), you should be informed that MERGE sucks. That ridiculous "natural-language-like" syntax of the 60s frenzy will always be a copy-paste deal to me since I could never remember that arbitrary sequence of keywords to construct such command. Oh my.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

This is already rejected many times, as nobody put a good argument for it. Your one about don't remember the syntax is the greatest one I hear.

UPDATE OR INSERT exists for the use-case of common task as make changes for *one* record, like many applications and ORM frameworks does.

To manipulate a set of records use MERGE.

PS: I don't think an extension to the command will defeat it. I just think such feature request is very low priority, because it's already covered by another command.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

priority: Major [ 3 ] => Minor [ 4 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Sorry, i see zero reasons to add non-standard questionable syntax for already implemented standard feature.

@firebird-automations
Copy link
Collaborator Author

Commented by: Cosmin Apreutesei (cosmin_ap2)

I'd be happy to throw in some arguments, but first I need some clues as to what makes a good argument for you guys. I'm a little puzzled since a few arguments that I consider good enough, were already rejected, for example:
- the simple fact that this was already requested several times is an indication that this might just be what users need (if you care about that aspect of course) -- unless their requests are silly or unfeasible, it's you who should give a good argument against them, not the other way around. This also lowers our incentive to communicate our requests -- we're already good at struggling with what we have and working around our problems, thank you.
- about MERGE, I wasn't complaining about my short memory, but the silly syntax no one want to use. I noticed that the SQL standard is pretty much taboo around here, no one wants to even think about debating the holly book, and I think your judgment about what is a good feature vs. bad feature (in this case MERGE vs INSERT INTO SELECT) is biased by that. To test your bias, ask yourself what if that horrendous MERGE syntax wasn't in the book at all, but instead it was just some user's idea posted on the tracker, would you ever have considered implementing it ?

Btw, why is the syntax questionable? Just because it's non-standard, or there are other reasons too?

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

MATCHING after "SELECT ..." is something I feel is horrible... It neither can be before it.

And for the feature request, just think about it. You liking or not, the standard is there, and DBMS implements parts of it, and people can learn one thing and generally apply it everywhere. And that happens with MERGE.

On the other hand, we designed UPDATE OR INSERT and is easy for us to extend it. But there should be a good reason for it. The SELECT part were not forgotten at design time, it was just something taken away.

Note also that some people already request UPDATE with multiple tables, which is also MERGE. If we do every request just because an user or another wants, we'll have a bloated product.

PS: Seems you feel from your comments we're here to reject your ideas. If you follow FB lists, you see how many of our own ideas were just rejected by others and community in general.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Cosmin,

> - the simple fact that this was already requested several times is an indication that this might just be what users need (if you care about that aspect of course) -- unless their requests are silly or unfeasible

yes, people need *functionality* (not a *syntax*), and when pointed to MERGE they are satisfied

> it's you who should give a good argument against them
a) i not should to do anything to anybody
b) standard compliance is a better argument

> about MERGE, I wasn't complaining about my short memory, but the silly syntax no one want to use
a) it is not silly, it is very good for me
b) who are "no one want to use" ? create group and write letter to SQL standard comettee and UN :-D

> would you ever have considered implementing it ?
no, i never would re-implement something already implemented and standard compliance
Do you know how many developers in FB-team ? Do you think it is more important to create syntax shortcut's instead of really new features ?

> Btw, why is the syntax questionable ?
You don't like MERGRE while i fully accept it. You like your syntax while for me it is ugly. Nobody never will be satisfied in such case. Therefore go to common standard, like you it or not.

Adriano,
> PS: Seems you feel from your comments we're here to reject your ideas
And this is not correct :) There are 29 requests by Cosmin and only 5 is rejected with "Won't fix" resolution. Only 2 of them (2166 and 2335) was really rejected by us. 6 requests is fixed. Other waiting for its time.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant