cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP: Wrong input for Date Type

abranjan
Active Participant
0 Kudos
215

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

View Entire Topic
catano
Active Participant
0 Kudos

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?