akp
akp

Reputation: 1893

Inserting a date into db2

How can I insert a date into db2 in this format: yyyy-mm-dd, using a sql query?

Upvotes: 9

Views: 62222

Answers (1)

codaddict
codaddict

Reputation: 454970

Consider a table:

CREATE TABLE tab (dt DATE);

Now insert a date into it as:

INSERT INTO tab VALUES ('2010-12-31');

Now on doing

SELECT * from tab; 

we get:

DT
2010-12-31

Upvotes: 16

Related Questions