StackOverflow is a collaborative programming Q&A community venture
Note: The content of this blog is the opinion and thoughts of the blogger and does not necessarily represent the opinions of IDUG.
Pivoting DB2 Data - where number of columns and and rows are not fixed
I've seen a few similar Q/A's on here, but the cases I've seen were variations on the "sales by year across quarter" variety, so DECODE is used, with 4 categories.
In my case, I don't know in advance how many rows or columns the pivot will have.
and we want the result set as
This would be easy with a
but my DB2 has no
The number of pay groups and age groups may vary from case to case, e.g., the data can have different numbers of pay and age groupings for different cases.
How to format Time Stored in DB2
I have time in DB2 for i like this:
I want result like this:
How I can achieve this in DB2 (7.1) on iSeries? Thanks.
ERRORCODE=-4461, SQLSTATE=42815 in DB2
I have exported some data from schema A (table x)to
The batch was submitted, but at least one exception occurred on an individual member of the batch.
I compared the data types of the corresponding columns in table x and table y they are the same. It is BIGINT for the identity(Auto increment) col and LONG VARCHAR in both source and destination..
Kindly help in resolving this issue.
Speed up execution of query to find sequential rows that have a changed value
My goal is to go through my dataset, compare each
Each month has about half a billion records. In total there's around 2.7 billion records. The data is stored in DB2 BLU. The table already has indices for
I think the big bottleneck is the
Here's what I have so far:
What could I do to improve performance on this for such a dataset?
Merging multiple tables sharing a column
I have a list of tables like this:
I want to merge them all into this, noticing that t3 and t4 both have birth year columns, but the value will only be in either one.
Does anyone know how this can be done? t1 is the "master" table, so it will always contain all the IDs.
But it doesnt work properly, it has separate columns for each individual columns in t1, t2, t3, t4
cooperl22/laravel-db2 package in laravel 4.2
I have a laravel 4.2 (upgraded from 4.1) app that I would to replace the ccovey DB2/ODBCdriver with the cooperl22/laravel-db2 package. I can use composer to install version 1.0 okaybut when I try to use it I get the error "ReflectionException: Class db does not exist".
The full error from artisan is:
in my composer.json I have:
and my controller is making a very simple query:
my database.php file looks like:
How can a troubleshoot this further?
Custom filter in DataConnect
As you may have realized, I am using a lot this IBM Bluemix DataConnect service. When creating an activity, you can refine the data you are going to export, using a custom filter (it enables a WHERE clause to add logic to the query)
I am trying to filter a TIMESTAMP field, trying to get 1 month old data, but the sentence is not working.
I get the following error message
It may be that DATE() or DAY() are not recognized by the service. Did anyone attempt to do such filter?
Connect to DB2 database in eclipse via jdbc
I'm trying to connect to an IBM DB2 database with Eclipse (version Juno) via JDBC.I've added the drivers (external jar files) to my project and the driver is loaded correctly ...
I also know that the connection data (database path, username, password) is correct.But I get a java.lang.NoClassDefFoundError:
There must be something wrong with the project properties but I really don't know where to look for.
Equivalent of LIMIT for DB2
How do you do
I have a table with more than 50,000 records and I want to return records 0 to 10,000, and records 10,000 to 20,000.
I know in SQL you write
So, how is this done in DB2? Whats the code and syntax?(full query example is appreciated)
How to update multiple columns in single update statement in DB2
I want to update multiple columns of a table in DB2 with single Update statement.
Any hint or idea will be appreciable. Thanks.