Thorsten
Thorsten

Reputation: 13181

Implicit type conversion in DB/2 inserts?

We're using SQL Inserts to insert some data via a script into DB/2 tables, e.g.

CREATE TABLE TICKETS (TICKETID VARCHAR(10) NOT NULL);

On my home installation, this statement works fine (note that I'm using an integer which is autoatically cast into a VarChar):

INSERT INTO TICKETS (TICKETID) VALUES (1);

while at my customer's site I get a type error.

My question(s):

Upvotes: 0

Views: 374

Answers (1)

Ian Bjorhovde
Ian Bjorhovde

Reputation: 11052

DB2 9.5 and earlier enforced strong typing.

DB2 9.7 relaxed this requirement, adding implicit casting between data types. See the documentation: What's new in DB2 V9.7: Implicit casting

Upvotes: 1

Related Questions