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
1 answer

db2 : what is the best way to insert 2 variable on the same row

I would like to create a function returning a table with 1 row only filled with 2 values pre-calculated. Below my example to clarify what I mean create function() returns table(a integer,b integer) language sql begin declare c integer; …
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
1 answer

database not listed in DB2

I have some databases on DB2 on an AIX server. I login as the DB2 instance user id "chandroo" (having the db2profile set automatically when i login) and issue a command as below and get no result. chandroo@xxxxxxxx::/db2/chandroo> db2 list db…
Chandru
  • 336
  • 1
  • 5
  • 14
0
votes
1 answer

DB2 sql average row lenght in bytes

I am new to DB2. I am trying to determine the average row length in bytes for a number of tables (TABLE_1, TABLE_2, TABLE_3, TABLE_4 and TABLE_5). I need to do some analysis on the size of the tables and then to extrapolate the information I get.…
Explicitsoul
  • 149
  • 2
  • 10
0
votes
2 answers

db2 how to view the code User-Defined-Function calling C code

I would like to see the code for a function defined like below. This function -lives in a schema called MYSCHEMA -makes usage of a shared library installed. I tried to use the following but it doesn't work. select r.routinename as FunctionName,…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
1 answer

db2 shared libraries location for user defined functions

I would like to use a shared library I produced from db2 queries. My shared library depends on boost that, in my machine, is locate in /usr/local/lib. When I try to run the queries using my functions I got errors: they dosn't work because db2…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
1 answer

How to replace tablename with a variable in a DB2 cursor in an anonymous block

I want to replace the table name with a variable that is derived from another cursor, but no matter what logic I tried to use I just could not get it right, I am seeing a couple of examples for Oracle and SQL Server but I failed to interpret that…
0
votes
1 answer

granting db2 credentials for HADR

I want one of my db2 user to be able to issue queries on a primary database that are replicated to a secondary database via HADR. That user on my linux box is called EUSR. Now logged as user db2inst1 (that is the user having administrative…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
1 answer

catalog on different versions of db2

I am trying to use my local DB2 Express-C edition to access remotely a db2 database running on a remote machine at IP 192.168.48.189. The remote machine is running a DB2 Workgroup Server edition. They are both version v10.1 and I am running them…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
3 answers

exporting to csv from db2 with no delimiter

I need to export content of a db2 table to CSV file. I read that nochardel would prevent to have the separator between each data but that is not happening. Suppose I have a table MY_TABLE ----------------------- Field_A varchar(10) Field_B…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
1 answer

ADMIN_LIST_HIST table function is still supported in version 10 LUW?

I was looking a way to query the last backup per type (full, delta, inc) via SQL instead of parsing the output of "list history backup", and I found in old documentation a function called ADMIN_LIST_HIST. However, I do not see any documentation in…
AngocA
  • 7,655
  • 6
  • 39
  • 55
0
votes
1 answer

How do I update a subset of values in DB2 based on related tables?

I am trying to remove the last 10 characters from a CLOB field in a DB2 database. I can do so using: UPDATE report SET comment = LEFT(comment, (LENGTH(comment) - 10)) However, I want to limit the truncation to a subset of the rows based on…
Matthew
  • 1,300
  • 12
  • 30
0
votes
1 answer

Name of a DB2 restoration of the same database at a different time

Each time I perform a restore of the same database, but at a different time (different version recoveries), a CXXXXXXX directory is created in the archive log directory. This is normal, but I would like to know the right term of that new db branch. …
AngocA
  • 7,655
  • 6
  • 39
  • 55
0
votes
2 answers

I am unable to find the backup image after the test restore got completed successfully

Kindly help me out in understanding the below mentioned problem. I took a backup of a SAMPLE db on P:\BAK and the backup was successful. Backup successful. The timestamp for this backup image is :…
user1988366
  • 87
  • 1
  • 5
0
votes
2 answers

Dynamically generate GRANT SQL from syscat.tabauth table

I have a database (on DB2 9.7) A in which suppose I have tables X,Y,Z...n Now I have created same tables X,Y,Z...n in database B. I want to provide same GRANTs to users in database B as it was in database A. So based on SYSCAT.TABAUTH I am trying to…
Saurabh Agrawal
  • 1,355
  • 3
  • 17
  • 33
0
votes
1 answer

How to drop an alias to a module in DB2?

I am trying to drop an alias to a module, but it is unsuccessful. When I issue the following script, I cannot drop it CREATE MODULE TESTS; CREATE ALIAS T2 FOR MODULE TESTS; CREATE PUBLIC ALIAS T1 FOR MODULE TESTS; DROP ALIAS T2; DROP PUBLIC ALIAS…
AngocA
  • 7,655
  • 6
  • 39
  • 55