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

Expand functionality of null indicator in API [CORE5483] #5753

Open
firebird-automations opened this issue Feb 13, 2017 · 8 comments
Open

Expand functionality of null indicator in API [CORE5483] #5753

firebird-automations opened this issue Feb 13, 2017 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @aafemt

Currently in input SQLDA/messsage null indicator can have two meaningful values: 0 for not null data and -1 for null indication.
It would be useful to add more:
1) A value indicating "set field to default", which is API support for CORE5449.
2) A value with meaning "do not change value of field" which is effectively the same as (1) for inserts and for updates would leave current value as is instead of resetting it to default or provided value.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> 2) A value with meaning "do not change value of field" which is effectively the same as (1) for inserts and for updates would leave current value as is instead of resetting it to default or provided value.

What a hack. Completely disagree with this request.

@firebird-automations
Copy link
Collaborator Author

Commented by: @aafemt

Can you suggest a better solution which would allow to modify only those fields that were changed by user but still be able to use prepared statements?

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Dimitry,

I think the responsibility would be yours, to show that Firebird is not supporting functionality that other engine provide.

I am not aware of any other engine that would allow for a DSQL UPDATE statement to include a column with some form of "leave current value untouched" context -- this is what you are effectively proposing.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> Can you suggest a better solution which would allow to modify only those fields that were changed by user but still be able to use prepared statements?

Firebird support list, please.

@firebird-automations
Copy link
Collaborator Author

Commented by: @aafemt

> I am not aware of any other engine that would allow for a DSQL UPDATE statement to include a column with some form of "leave current value untouched" context

Neither do I. But I still think that it could be a handy feature.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

I believe Adriano is correct, this definitely smells like a "hack". Please bring this forward in the support list.

@firebird-automations
Copy link
Collaborator Author

Commented by: @aafemt

Ok, I'm waiting for answers in support list.

@firebird-automations
Copy link
Collaborator Author

Commented by: @aafemt

Getting back to this ticket:

DB2 docs: https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rzajp/rzajpnullvar.htm

"For extended indicators, the indicator values are interpreted as follows:

An indicator value of 0 means the value for the host variable is assigned to the column\.
An indicator value of \-1, \-2, \-3, \-4, or \-6 means the null value is assigned to the column\.
An indicator value of \-5 means the default value for the column is assigned\.
An indicator value of \-7 means that the column is not assigned\. This value causes the column to be treated as though it were not listed in the insert or update column list\. For an INSERT statement it means the default value is used\."

ODBC specs: https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/using-length-and-indicator-values

"SQL_DEFAULT_PARAM. A procedure is to use the default value of an input parameter in a procedure instead of the value in the corresponding data buffer.

SQL_COLUMN_IGNORE. SQLBulkOperations or SQLSetPos is to ignore the value in the data buffer. When updating a row of data by a call to SQLBulkOperations or SQLSetPos, the column value is not changed. When inserting a new row of data by a call to SQLBulkOperations, the column value is set to its default or, if the column does not have a default, to NULL."

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