db2

Can I create a dataset XSD without using the designer?

Hi everyone, I want to be able to create the XSD file for my typed dataset without using the visual studio dataset designer. Is there a way to do this using for instance a command-line tool? There is some magic happening when a table is dragged from the server explorer to the design surface, but where does that magic come from? To add...

Rails with DB2 and multiple schemas

I have a 'legacy' DB2 database that has many other applications and users. Trying to experiment with a rails app. Got everything working great with the ibm_db driver. Problem is that I have some tables like schema1.products, schema1.sales and other tables like schema2.employees and schema2.payroll. In the ibm_db adapter connectio...

Should we drop stored procedures and run database calls from java programs.

I am fighting to keep the use of stored procedures in our company. There are a few people who say they are bad and we should not use them. We are using DB2 on the i-series. Please help in my argument to keep stored procedures alive in my company. ...

SQL query: how to translate IN() into a JOIN?

I have a lot of SQL queries like this: SELECT o.Id, o.attrib1, o.attrib2 FROM table1 o WHERE o.Id IN ( SELECT DISTINCT Id FROM table1 , table2 , table3 WHERE ... ) These queries have to run on different database engines (M...

retrieving the record which has only one value

Hello All, Please suggest me a query, which retrieves only those record which has the single row in table. For example: **table1.** name age aaa 20 bbb 10 ccc 20 ddd 30 If I run "select distinct age from table1. result will be: age 20 10 30 But I need a query, which give the result like name age bbb 10 ddd 30 I am usin...

db2 sql pattern matching

I have a table in db2 which has the following fields int xyz; string myId; string myName; Example dataset xyz | myid | myname -------------------------------- 1 | ABC.123.456 | ABC 2 | PRQS.12.34 | PQRS 3 | ZZZ.3.2.2 | blah I want to extract the rows where myName matches the character upto "." in the my...

Databases Views with Parameters

Hi there, I know that is it possible to create a View with Parameters at MSSQL, does anyone knows if I can achieve something similar with a DB2 database? I have a more complicated query which includes a user number which I want to pass as param to the view. ...

DB2 Transaction log is full. How to flush / clear it?

Hi, I’m working on a experiment regarding to a course I’m taking about tuning DB2. I’m using the EC2 from Amazon (aws) to conduct the experiment. My problem is, however, that I have to test a non-compression against row-compression in DB2 and to do that I’ve created a bsh file that run those experiments. But when I reach to my compressi...

DATE lookup table (1990/01/01:2041/12/31)

I use a DATE's master table for looking up dates and other values in order to control several events, intervals and calculations within my app. It has rows for every single day begining from 01/01/1990 to 12/31/2041. One example of how I use this lookup table is: A customer pawned an item on: JAN-31-2010 Customer returns on MAY-03-...

Override Locale Date with custom setings.

Aside from the GL Support, is there a way to override locale settings with custom values for month and day when using mmm-dd-yyyy, modified spanish examples: Jan = ENE, Aug = AGO, or long dates (mmmm) January = ENERO, August = AGOSTO, or (dddd) Monday = LUNES, Thursday = JUEVES, etc.? ...

DB2: Won't allow parameterize: 'fetch first <X> rows only'

Although in Oracle DB its is allowed to parametrize the number of rows that the query can fetch by adding to the query: select ... from ... where ... and rownum <= @MaximumRecords I can't add similar condition to acuivalent query running in DB2: It is allowed to add: select ... from ... where ... fetch first 500 rows only (where t...

Oracle rownum in db2 - Java data archiving

I have a data archiving process in java that moves data between db2 and sybase. FYI - This is not done through any import/export process because there are several conditions on each table that are available on run-time and so this process is developed in java. Right now I have single DatabaseReader and DatabaseWriter defined for each so...

What are the types and inner workings of a query optimizer?

As I understand it, most query optimizers are "cost-based". Others are "rule-based", or I believe they call it "Syntax Based". So, what's the best way to optimize the syntax of SQL statements to help an optimizer produce better results? Some cost-based optimizers can be influenced by "hints" like FIRST_ROWS(). Others are tailored for O...

Can Hibernate default a Null String to Empty String

In our application we are pulling data from a DB2 mainframe database. If the database has "low values" in a field, hibernate sends a "null" value in the object. This occurs even if the column is defined as "not null". As we are doing XML parsing on this, Castor is having trouble with it. I would like to fix this in Hibernate. Also, ...

SQL - suppressing duplicate *adjacent* records

I need to run a Select statement (DB2 SQL) that does not pull adjacent row duplicates based on a certain field. In specific, I am trying to find out when data changes, which is made difficult because it might change back to its original value. That is to say, I have a table that vaguely resembles the below, sorted by Letter and then by...

link DB2 AS/400 (system i) and DB2 AIX

Hi, everybody. I have two different database in DB2, a in DB2 AS400 and other in DB2 AIX, is possible link this database, similar to link by Oracle? Thank you in advance. erva. ...

Why do mainframe greybeards refer to DB2/zOS as "he"?

If you ask a DB2/zOS engine DBA a question about DB2's behavior, the DBA will refer to the DB2 engine as "he" much the way a sailor uses "she" to refer to his ship. For example: "Once you fill the freespace, DB2 still wants to keep those rows in cluster order in the tablespace. That's why he'll split that page in half, and you end up w...

c# code for load the data from txt file or SQL 2000 to AS400(DB2/400

Possible Duplicate: c# code for load the data from SQL 2000 to AS400 c# code for load the data from txt file or SQL 2000 to AS400(DB2/400) ...

Why is Perl's DBI failing to connect to my cataloged DB2 database?

I've downloaded the IBM DBI package, including all the packages in my program as specified in the docs. I've cataloged the DB and can connect to it from the command line, but my DBI connect fails: $dbh = DBI->connect ("dbi:DB2:warehou1", user, pass) or die "Can't connect to sample database: $DBI::errstr"; Can't connect to sample datab...

DB2 CASE Statement

I need to somehow use the CASE syntax (which is beyond me) to affect the database results based on criteria. I have a bunch of royalties in 0.# form (royalty) I have a title ID # (title_id) and I need to show the new increase in royalties so that I can use the data. IF: they have a current royalty of 0.0 - 0.1 = 10% raise IF: th...