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

References to column "default" value for DML operations [CORE6311] #6552

Closed
firebird-automations opened this issue May 20, 2020 · 8 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Orhan Turhan (bibilen)

merge into table
using log on http://table.id = http://log.id
when matched then
update set name = http://log.name
when not matched then
-- insert (name) values (default) -- no problem
insert (name) values (iif(0=0, default, name)) -- problem

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

The problem is not restricted to MERGE operations, it would apply to all Data Manipulation Language (DML) operations, such as INSERT or UPDATE.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

summary: merge and default => References to column "default" value for DML operations

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Please provide details on the "problem", it the engine rejecting the SQL? It the outcome of the operation not what you expect?

@firebird-automations
Copy link
Collaborator Author

Commented by: Orhan Turhan (bibilen)

if, insert (name) values (default) -- no problem

if, insert (name) values (iif(0=0, default, name)) -- problem
message:
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 8, column 48.
default.

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

You can't use default like that. It can only be used immediately in the value list, it cannot be used in an expression.

@firebird-automations
Copy link
Collaborator Author

Commented by: Orhan Turhan (bibilen)

I think it should can be useable but this only my idea, you are the boss.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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