Withdata Software

Producing high-quality database tools

Main menu

Skip to primary content
Skip to secondary content
  • Withdata Software
  • Blog
  • Categories
  • Tags

Category Archives: DB2

Some ETL (Extract-Transform-Load) tools for DB2

Posted on August 11, 2017 by Shiji Pan

Withdata Software provide some ETL (Extract-Transform-Load) tools for DB2: FileToDB Load TXT, CSV, TSV, XML, JSON, Excel, SQL, RDF, INI data to DB2 DBToFile Export DB2 data to TXT, CSV, TSV, XML, JSON, Excel, SQL files DBCopier Copy data between DB2 and other rational databases ... Read more

Posted in DB2 | Tagged DB2, ETL, Extract-Transform-Load

How to get index column names of a table from DB2

Posted on October 24, 2016 by Shiji Pan

select name,colnames from sysibm.sysindexes where tbname='my_table_name' See also: How to get index column names of a table from SQL Server How to get index column names of a table from MySQL How to get index column names of a table from PostgreSQL How to get index column names of a table from ... Read more

Posted in DB2 | Tagged DB2, get index columns

How to get primary key of a table from DB2

Posted on October 24, 2016 by Shiji Pan

SELECT COLNAME FROM syscat.COLUMNS WHERE tabschema='my_schema_name' AND tabname='my_table_name' AND KEYSEQ=1 See also: How to get primary key of a table from PostgreSQL How to get primary key of a table from SQLite How to get primary key of a table from MySQL How to get primary key of a table ... Read more

Posted in DB2 | Tagged DB2, get primary key

About DB2 error “CLI0106E Connection is closed. SQLSTATE=08003”

Posted on September 29, 2016 by Shiji Pan

Sometimes, you meet this error “”CLI0106E Connection is closed. SQLSTATE=08003” when you run DB2 tools. This error would be due to “The connection specified by the connection handle is no longer active.” You can add the following to your db2cli.ini file and restart the ... Read more

Posted in DB2 | Tagged DB2

About “Cannot load client library: db2cli.dll”

Posted on April 9, 2014 by Shiji Pan

When you use DB2 tools that call DB2 client library “db2cli.dll”, you may meet this error: “Cannot load client library: db2cli.dll” You can download this tool to solve the problem: DB2_CLI_Setup_32.zip ... Read more

Posted in DB2 | Tagged Cannot load client library, DB2

About “Cannot load client library: db2cli64.dll”

Posted on April 9, 2014 by Shiji Pan

When you use DB2 tools that call DB2 client library “db2cli64.dll”, you may meet this error: “Cannot load client library: db2cli64.dll” You can download this tool to solve the problem: DB2_CLI_Setup_64.zip   ... Read more

Posted in DB2 | Tagged Cannot load client library, DB2

How to execute sql file via command line for DB2

Posted on August 29, 2013 by Shiji Pan

You can save a .sql file to your hard drive, and execute it using the DB2 command line using: db2 -vtf C:\path\to\test.sql -v echoes the command text back to the command line -t sets the statement terminator to ;. -f tells the command line to load the commands from the file. See other command ... Read more

Posted in DB2 | Tagged command line, command line execute sql, DB2

The DB2 equivalent for the MySQL Limit

Posted on June 25, 2013 by Shiji Pan

In MySQL, you can use “Limit n,m”, like this: select * from sometable order by name limit 20,10 And in DB2, use this query: SELECT * FROM (SELECT * FROM sometable ORDER BY name DESC fetch first {start} rows only ) AS mini ORDER BY mini.name ASC fetch first {total} rows ... Read more

Posted in DB2 | Tagged DB2, equivalent for the MySQL Limit

Replace (Update/Insert) a row into DB2 table – Merge into

Posted on June 6, 2013 by Shiji Pan

In MySQL,  if you want to either updates or inserts a row in a table, depending if the table already has a row that matches the data, you can use “ON DUPLICATE KEY UPDATE”. How to do it in DB2? Use “merge into” . MERGE INTO table_to_upsert AS tab USING (VALUES ... Read more

Posted in DB2 | Tagged DB2, merge into, replace into, upsert

How to get column names from DB2 table

Posted on May 30, 2013 by Shiji Pan

SELECT colname, typename, length, scale, default FROM syscat.columns WHERE tabname = “<table name>” AND tabschema = “<schema name>” See also: How to get column names from Sql Server table How to get column names from Oracle table How to get column names from ... Read more

Posted in DB2 | Tagged DB2, get column names

Recent Posts

  • Use Cases for Dumping to CSV
  • Convert Text to Speech by CSV / TSV
Withdata Software. ©2004 - 2025 All rights reserved.