db2

Is there a good in-memory database that would act like DB2

I am currently using DB2 to do unit tests, but it is sometime quite slow. I would need a good in-memory database that would include all the feature of DB2. Does this type of in-memory database exist, or do they only allow standard SQL feature? Thank you. EDIT The DB2 Database is on a remote server, so I would need a solution to replica...

SQL Server to DB2 Conversion: Migration Toolkit Issues

Hi, I am trying to convert from MS SQL Server 2008 Express to DB2 9.7. I have installed IBM Migration Toolkit and successfully connected to my SQL Server database (hosted locally). I tried to extract from database, keeping all default data mappings, but when I extract, I get the following (for all tables) - anyone had a problem like...

How do I resolve an "Illegal Conversion" exception when inserting to an XML column?

I have a table with a column of type XML. When I insert a record into this table from a servlet running in WebSphere on Windows, the insert succeeds. However, when I run exactly the same code in WebSphere on AIX, I get the following exception: com.ibm.db2.jcc.c.SqlException: Illegal Conversion: Can not convert from "java.lang.String" ...

Type for storage text in database

I would like to create table to storage short text. What is the best type to use. char varchar but i can't guarantee the text length. Any best practice ? ...

How to update multiple tables with one SQL statement in DB2

psudo-code as follows: update TABLEA a, TABLEB b set a.addr = 'aaa', b.name = 'bbb' from TABLEA a, TABLEB b where a.id = b.id and a.id = 1 ...

DB2 truncated output

Hi, when i make select (command prompt WinXP) like: enter code here db2 select message_data from messages where message_id = 20043 i get output + 'Output is truncated' message. message_data is LONG VARCHAR > 30000 characters If i do like: enter code here db2 select message_data from messages where message_id = 20043 > c:\otpt.xml ...

How to close a DB2 cursor from OLEDB client?

I have client utility that uses OLEDB to call a DB2 stored procedure. Inside the stored a procedure a cursor is opened so my utility can read record sets. Everything works fine but after a while of calling the same procedure over and over again, DB2 eventually throws an error that is related to the cursor being left open. Is there a sql ...

How to check db2 version

How to check db2 version on Z/OS using only SQL commands? Thanks, Melita ...

C#: DB2 test available connection first

I have a C# .NET program running an ETL which connects to a DB2 database. Sometimes this database is down, so I'd like to do a health check at the beginning of the application to see if the database is available, without actually calling any stored procedures or pushing any data. Here's an example of the code I'm using now: OdbcConnecti...

shell command for executing stored procedure in DB2 OS400

what is the shell command for executing stored procedure in DB2 OS400. CALLPRC PRC(SPNAME) PARM('','',5,'','') RTNVAL() what is this one?? ...

Error when restoring db2 backup to a new database

I am in the process of restoring a DB2 Database and am encountering this problem and I have not found a way to fix the problem. In a LINUX environment I am running the DB2 Administrative Tools and am getting a problem with the migration portion of the restore process. It is Error 1704N Reason #9 (table space access is not allowed). Is...

Using prepared statement without ROW_NUMBER() and OVER() functions in Db2.

Let's say I have a table T_SWA .This is my prepared statement. Select version from (Select id, version,creator,created_date ROW_NUMBER() OVER(order by created_date) cnt From T_SWA where cnt=3 and id=35); I need to select the 3rd recent version from the T_SWA table..Can anyone suggest a replacement for this query without using ROW_NUM() ...

DB2: How to insert a clob with line breaks

I have a simple thing which I want to do, yet is so frustrating in attempting and completing. I just want to take some value such as this: 'a value with line breaks' And insert it into a CLOB field and retain the line breaks in DB2. Something like this statement insert into some_table (the_clob_field) VALUES('a value with line breaks...

What is Derby's equivalent of DB2's "NOT NULL WITH DEFAULT"

I'm investigating how feasible it is to change some unit tests (for an application running on DB2) to use Derby. Having found this question where the answer claims that DB2 and Derby are very compatible, it seemed like a possibility to take DDL out of the DB2 database and run it on a Derby database. But I seem to have found a case where ...

What is the equivalent of IBM's SYSIBM.SYSTABLES in Oracle?

Hi, What are the equivalent of SYSIBM. in Oracle? ...

Inserting a date into db2

How can I insert a date into db2 in this format: yyyy-mm-dd, using a sql query? ...

DB2 and XMLQuery

I have written the following query SELECT Specie, XMLCAST( XMLQUERY('declare default element namespace\"http://zoo.org\"; count(/diary/entry[@kind_type="@serious"])' ) AS INTEGER ) FROM Species; The schema for a diary is <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:z="http://zo...

Mysql keywords with rails.

My one column name is "usage" and it's conflicting with mysql keywords. To solve out that issue i was passing usage like `usage` with ActiveRecord. That solved my problem. CsvHeader.find(:all,:conditions => ["`usage` = ?",usage])) Right now i am attaching db2 as my database. db2 is not accepting &&. so i have replaced && with and. Ano...

Binding DB2 (iSeries) DATE/TIME/TIMESTAMP columns to a WinForms DataGridView

I am trying to pull the contents of an AS/400 file back to a data-bound .NET WinForms DataGridView (VS 2010). The query itself is no problem, and I am able to bind everything using the DataSource property of the grid. Data comes back with no issues. The problem I am having is that all date/time fields come back as string literals, mak...

Remove padding added by legacy DB2 databases on query results

I have the following setup. 'Apps/Reports' <---------> 'DB2 Connect' <------------> 'Legacy DB2 on AS400' `Hibernate` `native calls` When data is retrieved from by the application, it will be padded with extra spaces if the length is less that the column length. Of note when running a query, if the WHERE c...