Questions tagged [db2-luw]

DB2 for Linux, UNIX and Windows

DB2 for LUW is part of the DB2 family, that runs in these operative system.

Many parts of the internal structure are the same in all members of the DB2 family, but there are also things specific for each architecture.

This tag is for question related specifically to this member of the family.

913 questions
0
votes
4 answers

Deleting duplicate entry from table

Suppose I have a table as follows: (on DB2 9.7.2) COL1 COL2 COL3 ----------- ---------- ---------- 3 4 xyz 3 4 xyz Now I want to…
Saurabh Agrawal
  • 1,355
  • 3
  • 17
  • 33
-1
votes
1 answer

Getting week # from date in SQL with strange company rules

I'm attempting to convert dates to week numbers in SQL. I need to implement it in DB2 and Redshift queried via DBeaver and SAS. None of the weekpart functions follow our rules, and we're not allowed to create a lookup table in any of the databases,…
RLW
  • 1
-1
votes
1 answer

Server name, Instance Name, DB name in DB2 via sql query

How to find out Server name, Instance Name, DB name in DB2 via sql query. I was found it via shell scripts. Need via sql scripts.
Jit Sarkar
  • 17
  • 3
-1
votes
1 answer

ROW_NUM() OR DNSE_RANK() Which one should be used and how should I use it?

I have below table and would like to get the result in ROW_NUM Column. I tried this but don't get what I need. DENSE_RANK() OVER (PARTITION BY ID, DATE, SURG?, CODE ORDER BY ID)
SamR
  • 517
  • 3
  • 10
  • 24
-1
votes
1 answer

DB2 Update cursor issue

Whats wrong with the below cursor. It works well with oracle, but with db2 gives error "The FOR UPDATE clause is not allowed because the table specified by the cursor cannot be modified.. SQLCODE=-511, SQLSTATE=42829, " CURSOR DED_CU(PCTYPE IN…
stacky
  • 19
  • 2
-1
votes
1 answer

Db2 Database info wiped out after VM Restart in Azure

I have done the Db2 11.1 installation on Linux 8.1 VM in Azure. However, every time we STOP & START the VM in Azure, all the Databases, Schemas & Tables are disappearing. NOTE : I have made an entry in /etc/fstab path of my filesystem & its mounting…
-1
votes
1 answer

Unable to create tables in DB2 11.1 installed on Linux VM

I am trying to create a 'employee' table in DB2 11.1.4.6. However getting -bash: syntax error near unexpected token `(' Installed Db2 11.1 on Linux. Also created 'professional' schema. Below is the error :- [db2inst3@DB2101 ~]$ db2 create table…
-1
votes
2 answers

SQL Help - Detect Changes Within Specified List of Values

I need to create a report that returns customer accounts whose account type have changed to or from this list of account_types: ('CAM','CAMADP','CAMHD','CAMHDADP','DIST','DISTADP','GAM','GAMADP','LAM','LAMADP'). Let's say I have this table…
-1
votes
1 answer

IBM DB2 values displayed as utf-8 text

Once I connect to the database (DB2) to check the values in the tables, if they have special chars then I see their utf-8 text value: I expected instead to see the correct: Tükörfúrógép. I am still able to handle the value properly, but is there…
-1
votes
1 answer

How to implement thousand separator for a given text which contains numerical value? Cast and Varchar_format is not working

I need to show 3456789 as 34,56,789 in the output of below select query in db2 SELECT ' RUN TIME: ' CONCAT CURRENT_TIME CONCAT SPACE(39) CONCAT 'PROCESS' CONCAT SPACE(44) CONCAT '3456789' FROM sysibm.sysdummy1 WITH UR; Current Output is: RUN TIME:…
Robin
  • 87
  • 1
  • 12
-1
votes
2 answers

how to concatenate multiple row or column data into one row or column from a text file while importing data into db2 table

For Eg: 1)File has ID|Name|job|hobby|salary|hobby2 2)Data: 1|ram|architect|tennis|20000|cricket 1|ram|architect|football|20000|gardening 2|krish|teacher|painting|25000|cooking 3)Table: Columns in table:…
-1
votes
1 answer

IBM DB2 Community Edition Windows Requirement

I would like to install DB2 community edition on my Windows 10 PC. Does this require the Pro Edition of Windows or is the Home Edition sufficient?
VS228
  • 89
  • 1
  • 5
-1
votes
3 answers

How to display 2 select statement output through stored procedure in db2 under if condition

Based on OutPutType=1, I need to display 2 select statement output. In the below code I am getting following error: (Please note In actual I have 2 different dataset in 2 select statement but here for reference I have written one select for time and…
Robin
  • 87
  • 1
  • 12
-1
votes
1 answer

Db2 query to create users

I want to understand if it is possible to create users in DB2 SQL using Query, instead of using useradd commands. What is the query to create user in DB2 and in which table the user details will be stored. Your response will be helpful.
kevin
  • 1
-1
votes
1 answer

could you explain this db2 SQL ERROR: "Error occurred processing a conditional compilation directive near string. Reason code=r2

could you please help why the following error raises when I call a stored procedure in db2 WITH 2 parameterS. the first refers to the schema source: P_S and the second to target schema: P_T thank you in advance
ENA
  • 1