db2

How's the best way to go from a Cobol/CICS system to a modern Oracle/C++/Server setup

We plan to migrate an old IBM/COBOL/DB2 legacy app to a Solaris/Oracle/C++ "setuped" world. My specific questions here are: are there any experiences with tools able to analyze COBOL code in a more model driven view? (e.g. data flow analysis, code flow analysis, cross/hyperref listings, pretty printing) is openCOBOL a real chance to go...

Convert char for bit data to integer in DB2

I'm writing a DB2 user-defined function for which I need an array of non-negative integers, which I represent as a varchar for bit data. I plan to use two bytes for each integer (giving me a maximum value of 2^16-1, which is acceptable). I can convert an integer to a char for bit data by using the chr function, but how do I get it back ...

How do I fix a broken connection to DB2 from a web application?

I support some old web applications, VBScript-based ASP for the UI and VB6 COM modules for the business and data access layers. Last weekend, I installed DB2 Connect Enterprise Edition v8 fixpack 14 on several Windows 2000 servers, and one of the web apps errors out on null data when it calls the built in VBScript function FormatNumber....

Subquery to return the latest entry for each parent ID

I have a parent table with entries for documents and I have a history table which logs an audit entry every time a user accesses one of the documents. I'm writing a search query to return a list of documents (filtered by various criteria) with the latest user id to access each document returned in the result set. Thus for DOCUME...

DB2 Double Datatype

Hello, In one of my tables in DB2, I see the column datatype as double as length 8. How many decimals precision would this column have? (There is one other data type DECIMAL where I can specify the length 8 and precision) What about double? ...

Error while connecting to DB2 from JBoss Application Server

Hi, I'm trying to connect to the AS400 database DB2 from a Java application hosted in JBoss application server. But, I'm getting the below error when ever I run my application: Apparently wrong driver class specified for URL: class: com.ibm.as400.access.AS400JDBCDriver, url: jdbc:as400://DBSYTEM;driver=toolbox;trace=false;errors=full;p...

What happens to an existing DB2 view, if the table is dropped ?

If we have created a view on an existing DB2 table and then drop the table. What will happen to the view ? ...

Is it possible to create a view that is aware of current schema/library name?

Background: iSeries version of DB2. In every environment, there is a table containing positional column information about other tables. As the data in this table is static and has to be re-generated every time a table is altered, problems can occur if it is out of step. All the positional data exists in QSYS2.SYSTABLES and QSYS2.SYSCOLU...

DB2 - Modifies SQL Data

I have a stored procedure in db2 that is causing sqlcode=-577 errors. The reason for this i think is that i have not set the 'modifies sql data' clause on my procedure. is there any way to do an alter procedure to set this clause, or will i have to drop and recreate the procedure? thanks ...

How can I return the generated keys to JDBC from a DB2 stored procedure that does an insert?

I've got a simple stored procedure that does an insert to a table with an identity primary key column. I need to get the key that was generated by the insert. I would prefer to use the standard JDBC getGeneratedKeys method but I'm not sure what the stored procedure needs to do/return to build that result set. My end goal is to do this ...

Online SQL reference for DB2

Do you know of any good online SQL Reference for DB2. I need it for someone who will be moving from Oracle to DB2 ...

SQLLDR / BCP equivalent for DB2

My product needs to support Oracle, SQLServer, and DB2 v9. We are trying to figure out the most efficient way to periodically load data into the database. This currently takes 40+ minutes with individual insert statements, but just a few minutes when we use SQLLDR or BCP. Is there an equivalent in DB2 that allows CSV data to be loaded...

String literals not supported in stored procedure calls to DB2 for z/OS

I'm getting the error below when calling a simple SP from the Rational Application Developer Data Perspective when connecting to a DB2 DB instance running on z/OS. Also when calling from SQuirreL. Straight SQL queries run no problem. The query also works fine when called from my JAVA code. 'Error: [ibm][db2][jcc][10243][10940] Stri...

Escape percentage sign DB2 SQL

I am trying to select data containing four percentage signs in a row. How can I escape the percentage signs so my LIKE condition works? Thanks ...

db2 storage error when running stored procs

I am seeing the above error when running a small number of stored procs in our application. The actual error that we get is sqlcode=-930, which according to the db2 documentation is: 'There is not enough storage available to process the statement.' Question: how can i increase the storage available to these procs? has anyone else enco...

How can I su from root to db2inst1 and invoke a SQL script, in one line?

How can I su from root to db2inst1 and invoke a SQL script all in 1 line? I am thinking about something like this: su db2inst1 | db2 CONNECT TO myDatabase USER db2inst1 USING mypw; db2 -c -i -w -td@ -f /tmp/deploy/sql/My.sql | exit; Any ideas? ...

Distributed Transaction from .NET to DB2

I have a problem where in I have to call into the AS400 db2 to call a series of insert/update stored procedures from my .net and then update a few SQL2005 tables if everything in the AS400 db goes ahead fine. The driver I am using does not have distributed transactions so I was wondering if you can use any of IBMs iSeries Drivers for DB2...

How can you use parameterized statements with DB2 Text Search?

I've tried this: select * from ourschema.mytable where contains(mysearchablefield, @searchTerms) = 1; Where @searchTerms was set to "search terms" Unfortunately, it only produced an error: ERROR [42610] [IBM][DB2/NT] SQL0418N A statement contains a use of a parameter marker that is not valid. SQLSTATE=42610 Is there a way to us...

Joining Information Across DB2 and Oracle Databases Best Practices

We are designing a fairly large brownfield application, and run into a bit of a issue. We have a fairly large amount of information in a DB2 database from a legacy application that is still loading data. We also have information in an Oracle database that we control. We have to do a 'JOIN' type of operation on the tables. Right now,...

How to get next sequence number in DB2 using Entity Framework?

I want to retrieve the next sequence number via an adhoc query in Entity Framework. I'm using: LogEntities db = new LogEntities(); ObjectQuery<Int64> seq = db.CreateQuery<Int64>("SELECT AUDITLOG.EVENTID_SEQ.NEXTVAL from sysibm.sysdummy1"); This returns the following error: ErrorDescription = "'sysibm.sysdummy1' could not be resolved...