Top "Db2" questions

DB2 is a family of database servers developed by IBM.

DB2 timestampdiff function returning unexpected results

I'm using the following syntax TIMESTAMPDIFF(2, CHAR(CREATED - TIMESTAMP('1970-01-01 00:00:00')) where CREATED is of type TIMESTAMP …

datetime timestamp db2 epoch datetime-conversion
Sharing a Java synchronized block across a cluster, or using a global lock?

I have some code that I want to only allow access to by one thread. I know how to accomplish …

java sql locking db2 cluster-computing
Hibernate @Id @GeneratedValue annotation doesn't recognise increment ID generated by DB2 Database

Inserting a second record using Hibernate 3 into DB2 v9.x where a column has a Unique primary key column Id …

java hibernate db2 hibernate-annotations object-persistence
DB2 Logfile Limitation, SQLCODE: -964

I have tried a huge insert query in DB2. INSERT INTO MY_TABLE_COPY ( SELECT * FROM MY_TABLE); Before that, …

database db2 logfile sqlcode
Do a DB2 insert with a select and parameters

I want to do something like this: INSERT INTO TABLEA ( COLUMN1, COLUMN2, COLUMN 3 ) SELECT FOOBAR, DOOBAR, ? FROM TABLEB And then …

sql jdbc db2 spring-jdbc
How to add a not null constraint in an existing column in DB2 iSeries?

I have tried the following scripts to add a not null constraint to my column. ALTER TABLE MYDB.RULES ALTER …

sql db2 db2-400 iseries-navigator
Db2: How to update the current value of a sequence

We use a sequence in a Db2 database. Recently, we have migrated the data from an AIX server to a …

sql db2 sequences database-sequence
DB2/iSeries SQL clean up CR/LF, tabs etc

I need to find and clean up line breaks, carriage returns, tabs and "SUB"-characters in a set of 400k+ …

sql db2 ibm-midrange replace
SQLState 02000 No row was found for FETCH, UPDATE, or DELETE

I'm running jobs through Datastage with the DELETE then INSERT connector. I'm having several jobs failing for this error: DB2_…

db2 datastage
SQL update from one Table to another based on a ID match IN db2

The Query below is suited in SQL sErver. But in DB2 it does not give results: Error is SQLCODE = -199, …

db2 sql-update db2-luw correlated-subquery