Solved

Bulk update SQL statement needed

Posted on 2009-05-11
1
717 Views
Last Modified: 2013-12-19
Hi, Have Oracle 9.2 and I need a Bulk update SQL statement to do following:

select h.hdrId, h.seqNbr, d.pkId, d.seqNbr
hdrtbl, detailtbl
where h.rptID = 2
order by 1,3

I need to bulk update the detaltbl's seqNbr with a consectutive number based on sort order.
report 1234 may have 6 headers and header 1 has 3 detail, 2 has 6 detail, 3 has 18 detail.. etc
After bulk update header 1 would have seq 1-3, 2 have 4-9, 3 have 10-27, etc

Need to update header tbl too, if had 12 headers 1-12 but u delete 6,7,10 it results in 1-9
0
Comment
Question by:bcarlis
1 Comment
 
LVL 2

Accepted Solution

by:
bcarlis earned 0 total points
ID: 24446657
I just wrote PL/SQL loop
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now