473,378 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to get only dupliacate rows from the table through COBOL-DB2 program?

Can anyone give the answer for the following question?

1.How to get only dupliacate rows from the table through COBOL-DB2 program?

2. How to edit the primary key in the table through program? Is ti possible?
Jan 7 '08 #1
2 2438
sakumar9
127 Expert 100+
You can use following command to change the promary key. You can embed this SQL in your application.

Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE TEMP_TABLE
  2.   DROP PRIMARY KEY 
  3.   ADD CONSTRAINT CC1203569699406 PRIMARY KEY ( DATE, ID) ;
  4.  
  5.  
  6. Use following query to find the duplicate rows:
  7. SELECT COUNT(*), A, B FROM A GROUP BY A, B HAVING COUNT(*)>1
  8.  
  9.  
Regards
-- Sanjay
Feb 21 '08 #2
sakumar9
127 Expert 100+
You can actually embed these queries in your cobol programs just like any other query.

Regards
-- Sanjay
Feb 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
14
by: John | last post by:
Hi all, I am doing the change from having worked in Oracle for a long time to MS SQL server and am frustrated with a couple of simple SQL stmt's. Or at least they have always been easy. The...
2
by: none | last post by:
Hi, Any one know of some code to read cobol data files.... thanks timb
7
by: Mythran | last post by:
No Cobol.Net yet? Wha?!? Anywho, hope someone is familiar enough with Cobol to help me out here. I have some files written by COBOL applications that contain COMP-3 fields (on a mainframe)...
13
by: EricJ | last post by:
hi i need to access cobol data files from .net, the files have no or .vix extention (i think thats a acucobol or something like that) (/me has completely no experience in cobol) i heard that...
15
by: dm1608 | last post by:
We have a number of COBOL programs, and some were currently developing, that simply read TEXT based reports and scrap the reports for various information. I'm curious to know if anyone has...
11
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to...
0
by: loga123 | last post by:
Hi All, I am very new to .net and trying to develop a small application. I am using asp .net 2.0. I have a table control (server) in my code that has header row like this. <asp:Table...
0
by: cobug | last post by:
Dear COBOL Users, Articles are being sought for the COBOL User Groups (COBUG) newsletters. Will you help us in our efforts to provide newsletters for the COBOL community at large? The...
3
by: nigelesquire | last post by:
Please help! I'm trying to clone and delete multiple rows with JavaScript. I need two delete buttons that work...! I only have one for now, but it's not working properly, the output count is...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.