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

extended SQL UPDATE, DELETE syntax [CORE758] #1135

Closed
firebird-automations opened this issue Jul 4, 2005 · 9 comments
Closed

extended SQL UPDATE, DELETE syntax [CORE758] #1135

firebird-automations opened this issue Jul 4, 2005 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: lacak (lacak)

Votes: 3

SFID: 1232032#⁠
Submitted By: lacak

Would it possible to extend UPDATE syntax /like
MySQL , PostgreeSQL or MSSQL/ :

UPDATE table1, table2
SET col1=..., ...
WHERE [condition | join_condition]

-OR-

UPDATE table1
SET col1=..., ...
FROM table1, table2
WHERE ...

-AND-

DELETE table1
FROM table1, table2
WHERE ...

Thank

@firebird-automations
Copy link
Collaborator Author

Commented by: Alice F. Bird (firebirds)

Date: 2005-11-14 11:22
Sender: lacak
Logged In: YES
user_id=1189292

I would like to ask if this will be done before finall FB 2.0 ?
Or after FB 2.0 or never ? :-)
FB 2 is in beta state.
Is beta 1 feature completed or new features will be added until
FB 2 finall release ?
Thanks.

@firebird-automations
Copy link
Collaborator Author

Commented by: Alice F. Bird (firebirds)

Date: 2005-11-14 11:22
Sender: lacak
Logged In: YES
user_id=1189292

Your Feature Request has already been been recorded in the
tracker database. Accordingly, your request has been deleted,
since it is a duplicate request.

Additionally, we currently don't use the SF Feature Request
manager. So if you have any further feature requests, they
should be posted to the SF bug tracker, and assigned to
the "Feature Request" Group.

Thanks for your interest in the project.

@firebird-automations
Copy link
Collaborator Author

Commented by: lacak (lacak)

MySQL:
------
DELETE <table>[, <table> ...]
FROM <table_references>
WHERE <where definition>

DELETE FROM <table>[, <table> ...]
USING <table_references>
WHERE <where definition>

UPDATE <table>[, <table> ...]
SET ...
WHERE <where definition>

PostgreSQL:
-----------
DELETE FROM <table>
WHERE table1.col1=table2.col1 ...

UPDATE <table>
SET ...
FROM <table2>[, <table3> ...]
WHERE ...

MSSQL:
------
DELETE [FROM] <table>
FROM <table source>
WHERE ...

UPDATE <table>
SET ...
FROM <table source>
WHERE ...

Oracle:
-------
DELETE FROM <table source>
WHERE ...

DELETE FROM (select * from <table>)
WHERE ...

UPDATE <table source>
SET col=expr[, (col1,col2)=(<subquery>) ...]
WHERE ...

Oracle syntax is very clever ... is not ?

@firebird-automations
Copy link
Collaborator Author

Commented by: lacak (lacak)

MERGE statement introduced in 2.1 provides this functionality

MERGE INTO table1 USING table2 ON table1.c1=table2.c1
WHEN MATCHED THEN UPDATE SET ...

which is similar to

UPDATE table1 SET ... FROM <table2> WHERE table1.c1=table2.c1

so I think, that this FR-758 is obsolete, is not ?

ORACLE and IBM DB2 have interesting extension to SQL2003 :

WHEN MATCHED [AND <search condition>] THEN [UPDATE SET ... | DELETE ]

which enables INSERT not matched rows or UPDATE or DELETE matched rows

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Yes, you're right.
And these extensions seems good IMO, for future versions.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 10782 ] => Firebird [ 15181 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Closed at the request of the case reporter.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

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