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.

Filter by
Sorted by
Tagged with
0
votes
2answers
23 views

How to set column text when creating a view in SQL?

By default, when creating a view, for the Text of each column, if the column is a direct selection from a table/physical file then it will use the Text of that table/physical file's column. If it's ...
0
votes
1answer
34 views

Dropping a table/column automatically drops views using it - how to warn instead?

If I have a view that uses a column, and I remove that column/table, the view is dropped automatically. Is there a setting I can change such that it instead prevents the removal of the column/table, ...
0
votes
1answer
34 views

db2 cross platform function/variable?

Is there a db2 function/procedure/variable that can be used to determine what platform a data source origins from? sysibm.sysdummy1 exists, so I assume that this is Db2, but some of the SQL does not ...
1
vote
1answer
72 views

Error on Datastage when I try to write on AS400

I'm having troubles to operate an ETL process on DataStage. I have the following error log: #TABLE#,0: ODBC function "SQLExecute" reported: SQLSTATE = HY000: Native Error Code = -332: Msg = [IBM(...
1
vote
2answers
110 views

How can I lock row for reading/updating in DB2?

I am trying to resolve a race condition in my application. I have a table that is used as a work queue and many threads and read/update it. The following query is executed from application. First it ...
0
votes
1answer
220 views

SQL Server - Query Over Linked Server to IBM DB2 throws an error

We have a partner that uses a IBM DB2 iAccess database, which we connect to using a linked server on our SQL Server. It's been working great for a long time, but over the weekend they upgraded their ...
1
vote
1answer
232 views

Cannot drop primary key or add primary key

This db2 query: alter table mylib.mytable add primary key(field1, field2, field3) returns [SQL0624] Table MYTABLE in MYLIB already has a primary key'. However alter table mylib.mytable drop ...
1
vote
0answers
72 views

Database Behavior while executing UPDATE and INSERTs on the same table

My gear: Pentaho BI Server 8.0 AS400 V7 My scenario: I have two processes that sometimes run at same time in the same table. This table has about 600M rows, so, an update can take long time to ...
1
vote
1answer
79 views

EXECUTE stmt USING expression

I am writing an INSTEAD OF trigger on a view. I need to split a string into 4 40 character long parts to insert into separate columns. I want to use substr() to break the variable up into these parts, ...
1
vote
2answers
2k views

Select all data from IBM DB2 member table

Old as400 system has this thing called 'Members'. Basically you can have multiple members on a table and then work with only selected one. More Info When you select from a table that has members you ...
4
votes
2answers
333 views

IBM i Access ODBC driver returning only first letter of column names

I'm new to DB2 and am connecting to a DB2 for i (V7R1) database using unixODBC and the IBM i Access ODBC driver for Linux. When I query the database, the results only include the first letter of the ...
0
votes
1answer
44 views

Enumerating short versus long column names from INFORMATION_SCHEMA views on DB2 for IBM i

On the IBM i (as/400) you can have short and long column names on a table. The short names are listed in the SYSTEM_COLUMN_NAME field of QSYS2.SYSCOLUMNS and the ODBC/JDBC SQLCOLUMNS view. Is it ...