Skip to main content
5 votes

SQL20448N "05/09/2016" cannot be interpreted using format string "YYYY-MM-DD" for the TIMESTAMP_FORMAT function

The error message is very clear. I suppose the type of CRTNG_DTE is text/varchar and at least one of the values is not in the YYYY-MM-DD format (05/09/2016 clearly isn't!) and the conversion TO_DATE(...
ypercubeᵀᴹ's user avatar
3 votes
Accepted

DB2 SUM of MAX values, single table

I think you want multiple aggregations: First find the max for each ID-Source combination, then sum for every ID: select ID, sum(MaxNumImages) as SumMaxNumImages from ( select ID, max(...
ypercubeᵀᴹ's user avatar
3 votes
Accepted

DB2: Column-Aliases with Line-Breaks

DB2 will allow you to use a new line character in a quoted identifier: $ db2 'select ibmreqd "foo > bar" from sysibm.sysdummy1' foo bar ------- Y 1 record(s) selected. The question is, ...
mustaccio's user avatar
  • 26.3k
1 vote
Accepted

DB2 on Docker :: IBM Data Studio prompts error when creating new database

The easiest way to create a sample database is to login to the container: ~]$ docker exec -ti mydb2 bash -c "su - db2inst1" Once inside the container: [db2inst1@e88eefa89d92 ~]$ db2sampl ...
Lennart - Slava Ukraini's user avatar
1 vote
Accepted

Using same table in a UNION multiple times

Use Select X.Column1, X.Column2, Sum(X.Column3) AS Test, Types."Type" From Table X CROSS JOIN ( SELECT "First Query" AS "Type" UNION ALL SELECT &...
Akina's user avatar
  • 20k
1 vote
Accepted

Difference between DataLinks and External tables

If I remember correctly, Data Links Manager attempted to manage external files that were referenced in a database, rather than providing relational access to the data in those files. Think of an image ...
Ian Bjorhovde's user avatar
1 vote

Trying to restore a db2 database but stops at roll-forward with error 'SQL1265N'

You would have to remove the existing log files from the new server (or better move them somewhere else) and copy the log files from the old server to the new server. It is not possible to rollforward ...
Cyberider's user avatar
1 vote

How to run db2pd -hadr in batch mode

Both commands in test.db are Windows commands, you don't need the CLP to run them. Try: db2cmd -w "set db2instance=INST1 & db2pd -db MYDB -hadr" Your original attempt did not work you invoked ...

Only top scored, non community-wiki answers of a minimum length are eligible