Questions tagged [db2-midrange]
This refers to features of DB2 that are specific to the flavor that runs on the IBMi, formerly known as the iSeries, and AS/400 before that.
36 questions
0 votes
1 answer
60 views
Db2 for i SQL0904 (CPD4365 Reason Code 3): “More than 65535 bytes in an internal buffer” when selecting many columns
We have an SQL SELECT statement that retrieves over 400 fields from more than 120 joined tables. The query executes successfully on other database systems (Oracle 19c and Microsoft SQL Server 2019). ...
0 votes
1 answer
58 views
Best way to test credentials?
I've got a C# app where I need to validate credentials for a DB2 database (V7R3). The way historically we've done this is to append the credentials to a connection string and actually attempt to ...
-1 votes
1 answer
89 views
Query for grouping by comparing sum of value for group, stopping when quantity is reached
Trying to calculate values for a FIFO report. Is there a way using SQL to group data such that you're comparing the sum of a particular value against different values for each group, including taking ...
2 votes
2 answers
582 views
DROP ALIAS unable to drop existing alias?
We're unable to drop aliases. So, I found an alias by running: SELECT TABLE_NAME FROM QSYS2.SYSTABLES WHERE BASE_TABLE_NAME IN ('OE0711P','OE0712P') AND TABLE_TYPE = 'A' AND ...
0 votes
1 answer
213 views
How to run merge statement based on logic of joined table?
When I try to run a query like the following: MERGE INTO MYTABLE_A AS MERGE_TARGET USING ( SELECT MYTABLE_A.A, MYTABLE_B.B, MYTABLE_A.C, MYTABLE_D, MYTABLE_E FROM MYTABLE_A ...
0 votes
2 answers
2k views
Add days to date (char column with decimal) in DB2
I have a table named INVOICE_ET which has column of below definition INVDATE CHARACTER 10 result of select INVDATE from INVOICE_ET is as below INVDATE 2021-07-31 In another table INVOICE_DY, I have ...
0 votes
1 answer
840 views
What's the difference between REGEXP_SUBSTR and REGEXP_EXTRACT?
What's the difference between REGEXP_SUBSTR and REGEXP_EXTRACT? As far as I can tell, they seem to do the same thing. Is there some difference in side-effects, or how they perform for certain inputs? ...
0 votes
1 answer
1k views
db2cli license file not being used
I'm using the db2 driver for CLI and ODBC to configure an ODBC connection to DB2 on IBM i/OS from CentOS. I'm trying the following command: db2cli execsql -connstring "protocol=TCPIP;database=...