I have a table here that keeps repeating results over environments. Cf : … etc etc. I tried to use a group by but as there are slight changes in the encoding, it’s not really effective. I tried to specify an environment too but from a machine to another, it changes. But I do have a Column named ” Ordinal_Position
Tag: ibm-midrange
pyodbc is returning binary data in char field
pyodbc with driver “iSeries Access ODBC Driver” is returning binary output, Ex: original data in the table: B06300 what it returns: b’xc2xf0xf6xf3xf0xf0@@@@@@@@@@@@@@@@@@@@@@@@’ My code: I tried putting add_output_converter and encoder to connection but didn’t work Answer I suspect the problem is that the data is defined on the server as CCSID 65535, which means to not translate the data. Using
Query to delete record when no matching in delta table
please help to write a better delete query. DB2 does not have “not matched by source” with merge. Need to delete rows which does not have matching codes from source file for an ID and need to delete rows only for the ID’s present in source file. sample data row with value ID=1 & code=IJK alone need to be deleted
Column or global variable not found db2
I have a issue with DB2. I have two libraries with the same structure database. The only one difference is the data. When i try this sql request for the first library, it’s work but when i try with the other library, i have this error. I check the CLIENT and EMPLOYE tables and they have the column with data.
Having weird exception using MAX(CASE WHEN) in query: DB2.iSeries.iDB2DCFunctionErrorException: ‘An unexpected exception occurred
I have the following query to put some data from rows in columns: But when I try to run it in the following code: I get this exception: “IBM.Data.DB2.iSeries.iDB2DCFunctionErrorException: ‘An unexpected exception occurred. Type: System.AccessViolationException, Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt..'” I have other queries that work just
Using subquery with update SQL
I have Table 1 : EMP as below Table 2: EMP1 ID is the Key and is common in both the files. I want an Update SQL to update the amount field of Table 1 using Amount field of table 2, which gives the result as below. Result: Answer One method is a correlated subquery: You can check if the
Keyword IF not expected
I have the following inline SQL code, running on an AS400. The IF comes up as unexpected but I don’t understand why. What I’m trying to do is to build a stored procedure to update, or insert, a …
Insert values into Database with Java
Hello I have a Jtable and a JFormattedTextField where I input the values to insert into the database. I used PreparedStatement but the output gives an error [SQL0418] Utilização de marcador de …
Combine different CTE json objects together
I am having difficulties grasping the concept of combining two CTE json objects together. The data from the two are matched by a field WOID, which is the “workOrderID” in this json. I do not know …
MAX Date for each row
I am having some difficulty at writing a syntax that will provide me with the most recent date for several results. Little bit of background, I am pulling live data from an IBM AS400, I have no SQL tables, I am connecting to the tables via ODBC, using QTODBC to create my queries, then I export them to Power Bi.