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.
Testing DB2 Timestamp function in H2
I'm trying to make unit tests work in H2 for the DB2 function TIMESTAMP(Date, int) which sets the precision for the timestamp.
A similar question led me tohttp://www.h2database.com/html/features.html#user_defined_functionsbut I'm not sure how the overloading would work in this scenario.
Can anyone give me an example?
( Also, please don't answer just to say that having different databases for testing and production is bad practice. It's not something I'll be able to change :/ )
Unable to connect db2 database in JMeter
Getting below Response on connecting to DB2 database
db2jcc.jar and db2jcc_license_cisuz.jar already added in JMeter(3.2)'s lib folder.
Is there any alternative for column range partitioner in spring Bach remote partitioning?
Just take a normal case where I am taking data from DB2 , doing some business on data and writing it into mongoDB. This I am doing with spring batch column range partition(Remote partitioning) but the problem is in my DB2 table there is no sequential column , so each partition is having different data count. Because of this load is different for each slave. My requirement is to distribute load in slaves equally.
Remove leading zeros
Given data in a column which look like this:
I need to use SQL to remove anything after the space and all leading zeros from the values so that the final output will be:
How can I best do this?
Btw I'm using DB2
How to select a limited number of groups
I'm developing a report on BIRT for ControlDesk/Maximo and I need to show the most requested groups of tickets.
I got how to select a limited number of tickets by group in DB2 query, but it's not what I need. That being only the top 10 groups with most count(ticket class)
Thanks in regards
My SQL, so far, that doesn't show what I want is something like:
But It only shows the overall 10 first rows, not first of each group
Invalid Cursor State Error C# DB2
I run a standard query against a DB2 database with C# ADO.NET OleDb and using statements and get System.Data.OleDb.OleDbException (0x80004005): CLI0115E Invalid cursor state. SQLSTATE=24000When I include the dispose methods for each OleDb object, the query runs. Why does this fail without the Dispose methods? From everything i have researched the using statements should dispose of the objects for me. I am using .NET 4.5.1
SQL query in R passing two dates as parameters
I have a
When I run the query by hardcoding these values, it works fine.
But when I pass these two dates as parameters, not hardcoding them, I get an syntax error. This is my attempt so far. If anybody can tell me where I am going wrong, it will be helpful. Thanks in advance.
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?
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.