on 2024 Oct 02 10:17 AM
Hi Everyone,
I recently had a requirement to update a Date type field in Hana DB Cloud table to a blank value from CAP UPDATE query.
Error:
Cannot set parameter at row: 1. Wrong input for DATE type
Query:
try {
let tx = cds.tx();
data = await tx.run(UPDATE(TABLE,
{
<key>
}).with(
{
Date: '',
<payload>
}
)).then(tx.commit);
} catch (err) {
}
Could anyone please let me know if this is possible to achieve in CAP?
I have alternate approach in mind but need to check on the above feasibility.
Thanks in advance,
Abhijeet
Hi @abranjan,
I have now looked at the documentation of the DATE datatype, and I see that blank is not a valid value, because it can only be a bound format for the date (YYYY-MM-DD), and if null is allowed, then the null value can still be valid, and no other value can be entered. This is what the error message describes.
Can you explain why it would be relevant to have a blank value? Would this be necessary during some data processing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
10 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.