Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SQL DATA TYPE FOR DATE

865
  • SAP Managed Tags

Dear All,

I am creating a column table using SQL

CREATE COLUMN TABLE "EMPLOYEE_MAY"(DNUMBER INT, NAME VARCHAR(10), DOB DATE, REMINDERDAYS INT, DEPID INT);

INSERT INTO "EMPLOYEE_MAY" VALUES ('102025', 'RAMESH', '1978-03-23', '33', '10');

However while executing the same I am getting below error. The data type for DOB is taken as DATE & also the date format is taken as YYYY-MM-DD format. I have check the threads for the same and have taken the correct format but still I am getting below error.

Could not execute 'INSERT INTO "EMPLOYEE_MAY" VALUES ('102025', 'RAMESH', '1978-03-23', '33', '10')' SAP DBTech JDBC: [339]: invalid number: not a valid number string '1978-03-23' at function __typecast__() (at pos 55)

Can you please support for the same.

Thanks In Advance

1 ACCEPTED SOLUTION
Read only

Yogananda
Product and Topic Expert
Product and Topic Expert
772
  • SAP Managed Tags

Hi bande_ramesh91

Try this , It will work

INSERT INTO "EMPLOYEE_MAY" VALUES ('102025', 'RAMESH', TO_DATE('1978-03-23', 'YYYY-MM-DD'), '33', '10');

2 REPLIES 2
Read only

Yogananda
Product and Topic Expert
Product and Topic Expert
773
  • SAP Managed Tags

Hi bande_ramesh91

Try this , It will work

INSERT INTO "EMPLOYEE_MAY" VALUES ('102025', 'RAMESH', TO_DATE('1978-03-23', 'YYYY-MM-DD'), '33', '10');

Read only

0 Likes
772
  • SAP Managed Tags

THANKS A LOT