db2

DB2Command ExecuteNonQuery Insert multiple rows problem

I'm attempting to insert multiple rows into a DB2 database using C# code like this: string query = "INSERT INTO TESTDB2.RG_Table (V,E,L,N,Q,B,S,P) values" + "('lkjlkj', 'iouoiu', '2009-03-27 12:01:19', 'nnne', 'sdfdf', NULL, NULL, NULL)," + "('lkjlk2', 'iuoiu2', '2009-03-27 12:01:19', 'nnne2', 'sddf2', NULL, NULL, NULL)"; DB2Command cm...

Avoiding multiple sub-selects when grouping

I have a query that works like: select table_one.x, sum(table_one.y) (select foo from table_two where table_one.x = table_two.x) as item_description from table_one inner join table_two on table_one.x = table_two.x -- where table_2 row has various attributes group by table_one.x The grouping means I need a sub-select to access foo from...

Select the first row in a join of two tables in one statement

hi i need to select only the first row from a query that joins tables A and B, on table B exist multiple records with same name. there are not identifiers in any of the two tables. i cannt change the scheme either because i do not own the DB TABLE A NAME TABLE B NAME DATA1 DATA2 Select Distinct A.NAME,B.DATA1,B.DATA2 From A Inner ...

How can I highlight the search terms with DB2 Text Search in 9.5.2?

I have a working search query with the new Text Search functions in DB2 9.5.2: select * from prevue.mysearchabletable mst where contains(mst.searchabletext, 'porsche') = 1; However, this only tells me which ones match, as well as what the score is (score function has been omitted for brevity). Is there a way to use the text search in...

multiple like on same column DB2

I am trying to query something like select emp_id from dept.employee where firstname like '%sam%' or firstname like '%SAM%' or firstname like '%will%' or firstname like '%WILL%' Is it possible to put it in regex something like select emp_id from dept.employee where firstname like '%sam|SAM|will|WILL%' or select emp_id ...

What do I need to consider when performance testing DB2 read and write?

Calling all database guys... The situation is this: I have a DB2 database that is being written to and read from. I need to do some performance testing on programmatically executed read/writes. I know how to write a program to read/write to this database, but I am not sure as to what factors I should consider in my performance test...

Select from a DB2 table and insert to a SQL table

I feel like this might be a crazy question, and if anyone has a better idea of how to do it, by all means please let me know. I have a .Net C# project at work that validates certain tables against the company standards they must adhere to. The tables can be on SQL Server or DB2. When a table is initially added to the program, I gathe...

[DB2] Order a select result case insensitively?

Is it possible to order the result of select query on a db2 database case insensitively? For example: I want to have all names that start with an "a" or "A" sorted together. Abraham aron andrea Annica brian Benjamin Now it's like this: aron andrea brian Abraham Annica Benjamin ...

How to call Spring web service from RPG ?

We have developed SOA architecure for our intranet application, so our web-start java applications are connected to central app. server which is running on Spring HttpInvoker, things work pretty well. Now, we came up with need to centralize our business logic, so our need is to call these web services from DB2 RPG stored procedures. Is t...

Increment a sequence twice in DB2

I need to get the next value of a sequence twice in DB2 (version 9.1). Rather than executing the following twice: SELECT nextval FOR schema.sequence AS id FROM dual I would like to do something like: SELECT nextval FOR schema.sequence AS id1, nextval FOR schema.sequence AS id2 FROM dual Except the above only increments it o...

Problem inserting data into a varchar field using a stored procedure

I am uploading some data from DB2 to SQL2005. The table contains one text field that is 2000 characters long in DB2 but is set up as a varchar(2000) in SQL. When I run my insert in query browser it processes fine and the data is copied correctly, however when the same statement runs in my stored procedure the data for this field only i...

how to use asutime limit for stored proc?

we need to limit for how long a stored proc can run, currently we check the current timestamp against the input parameter timestamp for process to end. but has anyone used asutime limit and what are its effects/advantages? ...

When ASUTIME LIMIT is met for DB2 stored procedures, will the process ROLLBACK or COMMIT?

Can't find any answers on the net, has anyone tried this? My stored proc processes deletion of tokens found across multiple tables and it is set to run for a specified number of "cpu service units" by using the ASUTIME LIMIT integer stored proc definition/characteristic. When this limit is met, will the stored proc commit or rollback th...

Automatically generate rows in DB2 with SQL

I'm trying to search the DB2 equivalent of generate_series() (the PostgreSQL-way of generating rows). I obviously don't want to hard-code the rows with a VALUES statement. select * from generate_series(2,4); generate_series ----------------- 2 3 4 (3 rows) ...

What is the equivalent to SQL Server Transactions in DB2?

What is the equivalent to the following SQL Server statements in DB2? Begin Transaction Commit Transaction Rollback Transaction ...

[DB2] ordering resultset ö together with o

I want to order a resultset. The columns which i want to use for ordering contain german umlauts like ö, ü and ä. I want column data with these sortet together with normal letters. Example: At it the Moment, the resultset is ordered like this: ABCOXYZÖ I want it to be ordered like this: ABCOÖXYZ Thanks ...

[DB2] Problem with Replace Function

Hello! :-) In one of my resultsets i have column with char - data. I want to create another column, which carries altered data from the first column. There i want to exchange all 'ö' with oe. I tried it like this: Select NAME1, case when POSSTR(NAME1, 'ö') is not null then REPLACE(NAME1, 'ö', 'oe') end As __NAME1 from xyz; ...

How can I install a shared data source with no credentials in SSRS

I'm using SQL Server 2005 with Reporting Services. I have many reports installed, some using shared data sources and some not; some go to web services, some to sql server databases, and now I'm trying to connect to a DB2 database. I have successfully created a shared data source and report in Visual Studio 2005. I can pull data just fin...

DB2 sp_rename equivalent

Is there a DB2 v9.1 equivalent for sp_rename? ...

Is there any JDBC Type 4 driver for DB2 v6?

Does DB2 UDB v6 supports JDBC Type 4 drivers? Where can I get that JDBC Type 4 driver? ...