How to write a procedure for displying the data in a TREE
or (PARENT and CHILD ) relationship , for ex: A is the main
project id, for this project B,C,D are sub tasks(sub
project id's) for B the sub tasks are e,f,g and for c is
h ,i ,j and for d is k,l,m
now i need to display the o/p in a TREE fashion

pls help me ,
thanks in advance
surendra

Answers were Sorted based on User's Feedback



How to write a procedure for displying the data in a TREE or (PARENT and CHILD ) relationship , fo..

Answer / hussain

hi,
i think this may help u,


select lpad('',level*4)||projectid,subtask from xyz
start with projectid ='&a' connect by prior projectid=subproid

Is This Answer Correct ?    2 Yes 0 No

How to write a procedure for displying the data in a TREE or (PARENT and CHILD ) relationship , fo..

Answer / rv

You can use Select..ConnectBY.. PRIOR clause in Oracle to
generate the data in tree structure. Google for the apt
syntax and usage.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

what is inline command?

2 Answers  


How will you select unique values from a list of records?

7 Answers   Cap Gemini,


What is use of term?

0 Answers  


Name the tables where characteristics of Package, procedure and functions are stored ?

3 Answers  


What does inner join mean?

0 Answers  






Which is faster count (*) or count 1?

0 Answers  


How would you go about increasing the buffer cache hit ratio? 0. Explain the difference between a hot backup and a cold backup and the benefits associated with each 1. You have just had to restore from backup and do not have any control files. How would you go about bringing up this database? 2. How do you switch from an init.ora file to a spfile? 3. Explain the difference between a data block, an extent and a segment. 4. Give two examples of how you might determine the structure of the table DEPT. 5. Where would you look for errors from the database engine? 6. Compare and contrast TRUNCATE and DELETE for a table. 7. Give the reasoning behind using an index. 8. Give the two types of tables involved in producing a star schema and the type of data they hold. 9. What type of index should you use on a fact table? 10. Give two examples of referential integrity constraints. 11. A table is classified as a parent table and you want to drop and re-create it. How would you do this without affecting the children tables? 12. Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each. 13. What command would you use to create a backup control file? 14. Give the stages of instance startup to a usable state where normal users may access it. 15. What column differentiates the V$ views to the GV$ views and how? 16. How would you go about generating an EXPLAIN plan?

2 Answers  


Is ms sql is free?

0 Answers  


explain the delete statements in sql

0 Answers  


I have a tablle like this: cust acc ----------- a 1 b 2 b 3 c 4 c 5 c 6 I Want below o/p: cust acc --------------- a 1 b 2|3 c 4|5|6 Please any one can you have any ideas share me. I have urgent requirement.

7 Answers   MTS,


Are stored procedures compiled?

0 Answers  


Which is better cte or subquery?

0 Answers  


Categories