- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Composite primary keys
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2005 04:28 AM
тАО02-11-2005 04:28 AM
Composite primary keys
BusGroup
Pdate
BusType
Pctr_num
Dealer_num
Fund_num
Segment
These are the composite primary keys in my table.
I also have following columns in same table.
Daily_balance
Daily_accts
Avg Bal
Now,
We are going to update fund_num in this table.
For eg (Attached Excel for better picture)
Fund numbers 5 and 8 are going to be changed to 10(a new fund num, hence wont be in my table)
When i update 5 to 10, i wont get any contraint issues, cos 10 is a new fund num.... when i again update
8 to 10, there could be possibility for constraint violation. In that cases i need to add up daily balance, daily account and also calculate avg balance.
unlike daily balance and daily account , avg balance
cannot be added up directly...its needs recalculation.
I have given sample data and required output in attached excel...
Can anyone help me how to acheive them thru a procedure or by any means. I have 25 millions of records in this table.
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2005 06:14 AM
тАО02-11-2005 06:14 AM
Re: Composite primary keys
However, the only way to do what you want is to build a PL/SQL block to make these changes for you.
Exactly how many records do you need to combine in this way?
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2005 06:27 AM
тАО02-11-2005 06:27 AM
Re: Composite primary keys
merged as 10...so i'll be getting a conflict.
PL/SQL is the way to go. Is that possible to give a sample code , how to calculate avg balance if there is a conflict ..also i need to remove the record if its already present..
i'm not a expert in pl/sql. please help.
4714368 records to be updated.
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2005 05:13 PM
тАО02-11-2005 05:13 PM
Re: Composite primary keys
for PLSQL, have a look at the following URL:
http://oraclesvca2.oracle.com/docs/cd/A87860_01/doc/appdev.817/a77069/toc.htm
it is a must read!
if you stil have any trouble with your PLSQL procedure, do let us know.
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2005 05:14 PM
тАО02-11-2005 05:14 PM
Re: Composite primary keys
you also have examples of PLSQL procedures at this same site:
http://oraclesvca2.oracle.com/docs/cd/A87860_01/doc/appdev.817/a77069/a_samps.htm#4582
regards
yogeeraj