Tagged Questions
2
votes
2answers
43 views
DB2 will not INSERT into Created Temp Table that I created
I normally use SQL Server but for this project I'm having to learn DB2. If I can get the below code to work I'm set for the whole project. Below is a elementary example of what I cannot get to work. ...
1
vote
3answers
55 views
Transfer data from DB2 to Oracle
I want to transfer data from an old DB2 system to a new Oracle database.
How should I go about doing this?
2
votes
2answers
34 views
SQL3550W: … target column has been defined as GENERATED ALWAYS
I am trying to export + import data from a table in a db2 database to another.
But while running the export command I am getting the following error.
SQL3550W The field value in row "26" and column ...
1
vote
1answer
66 views
SQL Index order and performance based on cardinality and data
I've been working quite a bit on a query that's not operating very efficiently on a DB2 database. The thing will return up to 30k rows or so and take up to 10 seconds. I've been working on getting ...
2
votes
2answers
78 views
DB2 UPDATE TRIGGER
I am trying to create a trigger in a DB2 database that runs on the update of a column in one table, and then fills in another table with certain values.
For example, there is a power unit table with ...
3
votes
2answers
130 views
DB2 error - SQL Statement too long or complex
Getting this error in a DB2 production system:
ERROR [HY000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0101 - SQL statement too long or complex.
The statement has a large number of OR ...
4
votes
1answer
65 views
Specifying the node to connect in db2
I have 2 nodes in my db2 catalog. How would I include the node on which I want to connect inside the db2 connect paramters?
Node 1 entry:
Node name = DB2HOST1
Comment ...
4
votes
2answers
156 views
How do you set the pagesize, codeset and table space when creating a database in DB2?
I want to create a database in DB2.
I found some information on this page
I want to use only some options which are explained on the page:
PAGESIZE
CODESET
TABLESPACE
Then, I want to ...
3
votes
1answer
528 views
DB2 Defining remote database alias
I'm using DB2 9.7.0.3 for AIX.
I want to select data from a remote database, also running DB2 9.7.0.3 for AIX, and insert it into the local database I'm connected to.
I believe the query for this ...
2
votes
1answer
299 views
query to find closest lesser date
I have a table with rates. each rate has an effective starting date. (the ending date of any rate is implied by the existence of a record with a newer effective starting date.)
I also have a table ...
2
votes
1answer
751 views
Parallel inserts cause deadlock on DB2
The scenario is the following: The application attempts to insert into the same table from two parallel threads making 4000 insertions in each thread (separate transaction per thread). It causes the ...
2
votes
2answers
575 views
CREATE INDEX for long columns
I am looking for alternative to create index on long column:
create table line
(
field_key integer not null,
value varchar(4000),
...
);
create index key_value_idx on line ...
3
votes
1answer
648 views
Filtering on a virtual column from a UNION ALL with LEFT OUTER join causes a table scan?
I asked this question on SO but havn't got many bites and even a vote to close for being "Off Topic." So, I thought this stack exchange might be better suited.
Consider the following SQL...
SELECT ...
2
votes
2answers
566 views
altering a db2 table with huge amount of data
I have a table in DB2 which is having 99 columns and 900,000 records of data.
I want to alter the table with one extra column as below:
ALTER TABLE MYSCHEMA.PRODUCT ADD UPDATE_DT DATE
However, the ...
6
votes
2answers
852 views
Is DB2 more reliable and stable compared to PostgreSQL or MySQL?
Always i was using MySQL or PostgreSQL for my projects such as Web/Desktop apps.
I had data loss few times and thanks to old backup i was always up and running.
But for a recent project for Airport, ...
4
votes
2answers
867 views
DB2: Error when using NOT EXISTS with SYSIBM.DUAL in a batch query
I have data in a java object as data1, data2.
data1 and data2 together forms a composite key in myTable where I want to insert the object.
The writing is happening as a batch. Like 10 insert ...
3
votes
2answers
3k views
Emulate REGEXP like behaviour in SQL
I posted the same on stackoverflow (please, let me know if I have to delete one).
I'm working on a DB2 database and as far as I can see regexp is not supported (without additional libraries).
So I ...
1
vote
1answer
331 views
What does HSJOIN mean in an Explain Plan?
I have the following EXPLAIN PLAN results from a query on my DB2 database.
0 SELECT STATEMENT ( Estimated Costs = 5.928E+02 [timerons] )
1 RETURN
2 HSJOIN
3 [O] ...