This tag is to discuss the queries on IBM DB2 software. The users of the DB2 product can post their queries here.
Questions tagged [ibm-db2]
25 questions
0
votes
1 answer
npm install ibm_db2 is failing (need to use db2 database using nodejs)
In my project we have Db2 database which we need to connect using nodejs. I went through
ibm_db2
blog however not able to install ibm_db2 module. Seems like I need to install IBM Data Server driver which seems not available on Mac (I am using Mac…

joy
- 3,669
- 7
- 38
- 73
0
votes
3 answers
Using db2 10.5 exception while trying to connect to db
Hi I am unable to connect to database from cmd, there is a problem in establishing a connection. I am using DB2 10.5 version client. Databse is on 10.5 server (Triend with db on 9.7 version server too).
I get the below excpetion…

user4189031
- 35
- 5
0
votes
1 answer
How to get table column nullable or not in DB2
I have query in DB2 to get table definition / structure
SELECT c.column_name,
c.column_default,
c.data_type,
t.table_name,
c.character_maximum_length AS LENGTH
FROM sysibm.tables t
JOIN sysibm.columns c
ON…

Sachin
- 75
- 1
- 3
- 12
0
votes
1 answer
Join Data from 4 tables in DB2 and add a new column that identifies, which table the record is from
I have four tables
Pay,
Location,
deparment,
job
each one of them has 3 colums
EmpId, Code, Date.
some records in each table are unique to that table, whereas some records exists in multiple tables.
i want all the data together in one table…

HunTer
- 87
- 1
- 2
- 10
0
votes
2 answers
Unable to get ibm_db up and working on Maverick
I am trying to get ibm_db up and working on OSX Mavericks.
I am following the directions found in the DB2 for MAC OS X and was able finish them successfully.
However, there is nothing in there for setting the environment variables:
I know I need to…

DarthOpto
- 1,640
- 7
- 32
- 59
0
votes
1 answer
Hybrid join in DB2 z/os sql
I have been rewriting decades old DB z/OS queries and there are three tables as…

bkrish
- 627
- 1
- 11
- 23
0
votes
0 answers
alter tablespace db2 when the Table space type is "AUTOMATIC STORAGE"
Good day,
I would like to alter a tablespace to bigger size. The following is my query:
ALTER TABLESPACE USERSPACE1
resize (ALL 8192)
Then I hit error as follow:
[Error Code: -20318, SQL State: 42858] The ALTER TABLESPACE statement failed…

Panadol Chong
- 1,793
- 13
- 54
- 119
-1
votes
1 answer
max(count) sql.........join table or subquery
Product table
CREATE TABLE product(
Product_id varchar(7) NOT NULL PRIMARY KEY,
Product_name varchar(40),
Product_type varchar(10)
);
INSERT INTO Product VALUES
('P001','Apple Cinnamon Cereal','Cereal'),
('P002','Chocolate Almond…

Suen
- 1
- 3
-1
votes
1 answer
Does adding between speed up my SQL query?
Let's say I have a table with 10M enries and when I have this query :
SELECT column_name, count(column_name)
FROM my_table
GROUP BY column_name
it takes a lot of time to complete. If I know that column_name will have a given range, and split my…

ghostrider
- 5,131
- 14
- 72
- 120
-1
votes
2 answers
IBM DB2 using nodejs is throwing connection error as "SQL1042C An unexpected system error occurred. SQLSTATE=58004"
I am using ibm_db module to connect to IBM Database using nodejs. I was referring DB2NodeJs. I simply followed this post and used the sample code given in this post. Following were my steps.
1. Installed nodejs
2. Installed ibm_db
3. Downloaded the…

joy
- 3,669
- 7
- 38
- 73