Questions tagged [db2-400]

DB2-400 is IBM's name for the database integrated into the OS/400 operating system for it's AS/400 line of midrange computers. The current name is DB2 for i.

DB2-400, currently known as DB2 for i, is the database embedded into IBM's midrange line of computers running the IBM i operating system. Though related to DB2 UDB for LUW, it runs on a totally different platform, and is on a different release schedule than DB2 UDB for LUW, and thus has some differences in functionality. You can find documentation for DB2 for i in the Database section of the IBM i infocenter.

One of the major differences between DB2 for i and DB2 for LUW is that DB2 for i has a native data access engine called RLA (Record level Access) that allows HLL programmers to access the database without using SQL. This capability was added to preserve compatibility with the RPG and COBOL languages. An SQL precompiler is available for both RPG and COBOL that allows programmers to embed SQL statements directly into their programs.

963 questions
3
votes
2 answers

How to eliminate duplicate rows in JSON_ARRAYAGG in DB2400 or in any SQL?

SQL Example... SELECT ID AS HID, JSON_ARRAYAGG( JSON_OBJECT('sequence': TRIM(SEQUENCE), 'payer_reference_qualifier': TRIM(PAYREFQUAL), 'payer_reference_id':…
3
votes
2 answers

Running SQL query on tables having name with @ or # character shows problem on different CCSID

I have a legacy database on Db2 i (Db2400), in which table (physical file) names and their fields contains some variant characters like @ and #. My application is using simple JDBC to access data in these tables. This works fine when my IBM i…
Abhishek Tiwari
  • 332
  • 2
  • 16
3
votes
1 answer

DBeaver will not display certain schemas correctly in the Database Navigator

I'm using DBeaver 5.2.5.201811181655 with IBM DB2/400 v7r3. I'm trying to see a schema called WRKCERTO, but Database Navigator will not show it. The schema is there and I have rights to it, and I'm able to run SQL scripts with its objects, such as…
spinjector
  • 3,121
  • 3
  • 26
  • 56
3
votes
1 answer

using long file names in RPG programs

I would like to use db2/SQL created long file name in RPG program (OS V7.1 or v7.2). I cannot create table with over 10 characters using legacy DDS but Db2/SQL allows me to create tables with long file names. Example: CREATE TABLE…
Mustapha George
  • 2,497
  • 9
  • 47
  • 79
3
votes
3 answers

Node.js with db2/AS400

we have a project with Node.js that use the ibm_db to connect to the DB2/AS400. The problem is that it returns the following error: [SERVER] { Error: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a…
elcid
  • 29
  • 1
  • 8
3
votes
0 answers

How to perform two_phase transaction in python for MSSQL & DB2 without ORM

I want to perform two_phase transaction in python for mssql & DB2 using sql alchemy. For mssql my connection string is "mssql+pyodbc://****:*****@192.168..:1433/SourceDB?driver=FreeTDS&; odbc_options='TDS_Version=7.2'" when I am trying to…
Siddhesh
  • 871
  • 10
  • 15
3
votes
3 answers

DB2 SQL - Possible to query a list of values without using "or" for each row of values?

I have a list of values and I am wondering if it's possible to query by said list, rather than having to do an "or" for each row of values or add them into a table and query the table (as I'm about to do) Say, for example, my list is; 010, 46793,…
user5085719
3
votes
2 answers

DB2 find tables that reference my table

[db2-as400] I have a table ENR_DATA that has column EnrollmentID as a primary key. This column is referred by many tables as a "foreign key". Is there a way to list down all those tables who refer to EnrollmentID of ENR_DATA table?
user7392562
3
votes
0 answers

Call Parameterize iSeries Stored Procedure from .NET C#

I have a stored procedure created on the AS400 that takes in 2 parameters and returns either 000 if found or 001 if not found. I don't think I have the correct syntax for the CommandText. The following passes ?0 and 00 to the AS400. When I watch…
Fu Guo
  • 31
  • 3
3
votes
1 answer

How do i set up datasource on Jboss 6 EAP for as400 db2?

I am trying to setup a jboss 6.3 data-source to an ibm as400 jboss 6.3 is running on a windows server 2012 VM java 1.8.0_31 64 bit i am getting this error in the console on start up of jboss 1 4:02:09,332 INFO [org.jboss.as.controller] (Controller…
Lightning
  • 85
  • 1
  • 6
3
votes
0 answers

Is it possible to use django-pyodbc with iSeries Access ODBC Driver?

I am trying to get Django-pyodbc to work with DB2 on IBM i using the standard IBM i Access ODBC driver. I know there is a Django DB implementation supported by IBM, but that requires the DB2 Connect product, which is (for us) prohibitively…
RichardX
  • 51
  • 3
3
votes
4 answers

How to view a Trigger Definition in AS400

I have been trying to view the Trigger Definition for a trigger for AS400, and can't seem to find the command to help me do it. I can list the triggers out, create or remove them, but how do I view the trigger definition.
Xombeh
  • 43
  • 1
  • 1
  • 6
3
votes
3 answers

Count in Query 400 not passing correctly

I Have a table that has order data like this: Table Order_Detail and Item_Master are joined by Item# We want to report on order number, Order_Detail table: Order# Item# 1234 IPhone6 1234 IPhone5 1234 …
Paul K.
  • 49
  • 6
3
votes
2 answers

DB2 storing results from final table clause

The FINAL TABLE clause is great for getting values back from DML in DB2, for example: SELECT id FROM FINAL TABLE ( INSERT INTO mySchema.myTable (val) VALUES ('data') ) However, there doesn't seem to be a way to store the results of…
slachterman
  • 1,515
  • 4
  • 17
  • 23
3
votes
1 answer

How to add 1 millisecond to a timestamp in DB2?

I have to add 1 millisecond to a timestamp. This is what I've tried: SELECT cr_time+'0000-00-00 00:00:00.001' FROM foo.bar which returns Error: [SQL0182] A date, time, or timestamp expression not valid. SQLState: 42816 ErrorCode: -182 I also…
BetaRide
  • 16,207
  • 29
  • 99
  • 177
1 2
3
64 65