Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Miscellaneous >> Problem with tracking a particular record in hierarchial query

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Problem with tracking a particular record in hierarchial query
 adarsh  Posted: Aug 01, 2007 12:43:53 PM

 Total Post: 1
 Joined: Aug, 2007






 Hi all,

I have a hierarchial data stored in two tables as shown below.

Table 1:

Top
----A>
--->B
---->D
--->E
--->F

--->C
--->G
--->H


Top---->D
--->E
--->F

Table 2:

Top
----A>
--->B
---->L
--->M




Now I need to move the data from one table 1 to table 2. While moving the data I have to make check not overwrite the existing data. For example, for the above case if I am trying to move the hierarchial structure of 'A', I should not overwrite the existing structure. This can be done by checking if in the table 2 there exists a record, with parent of each record in the table 1 for the hierarchial structure 'A', if not insert that record. But, the actual problem is that, I want to track from which, the records were not moved and I am not interested in the subsequent levels of it. But, in the above case, it would give me that the records with parent as 'A','B','D' have not been moved.

We may use oracle SYS_CONNECT_BY_PATH,SUBSTR and INSTR functions and do some manipulations to do this. But,if the hierarchial structre is very big then it may throw memory related errors because of SYS_CONNECT_BY_PATH function.

I would like to be thankful if somebody can give me an efficient method to do this so that performance will be better and will not fail for huge hierarchial structures.


Thanks in advance,
Adarsh Sagar.

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi327
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software