472,371 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

What is connect by prior?

hi
i need answer for one question


what is connect by priority? which trigger can be used for this ?
May 8 '07 #1
7 22363
debasisdas
8,127 Expert 4TB
Connect by priority ?

What is that ??

Is it in Oracle ???
May 8 '07 #2
debasisdas
8,127 Expert 4TB
If you are talking of CONNECT BY PRIOR
then please post back
I may help you.....
May 8 '07 #3
ok explain it


one favour ,

im jeeva im proficient in oracle developer
i like to do project in forms & reports or pl/sql
can u help me
plz give some topic
May 10 '07 #4
debasisdas
8,127 Expert 4TB
USING ANSI SQL --TO DISPLAY HIERARCHICAL DATA
=============================================
The START WITH...CONNECT BY clause.
The PRIOR operator.
The LEVEL pseudocolumn.

SYNTAX
------------------------
[[START WITH condition 1]CONNECT BY condition2]

START WITH condition 1
-----------------------
IT SPECIFIES THE ROOT OF THE HIERARCHY. ALL ROWS THAT SATISFIES CONDITION1 ARE CONSIDERED ROOT ROWS.IF START WITH CLAUSE IS NOT SPECIFIED ALL ROWS ARE CONSIDERED ROOT ROWS.CONDITION 1 CAN INCLUDE A SUB-QUERY.

CONNECT BY condition2
---------------------
SPECIFIES THE RELATIONSHIP BETWEEN PARENT ROWS AND CHILD ROWS.THE RELATIONSHIP IS EXPRESSED AS A COMPARISION EXPRESSION,WHERE COLUMNS FROM THE CURRENT ROWS ARE COMPARED TO CORRESPONDING PARENT COLUMNS.THE CONDITION2 MUST CONTAIN THE PRIOR OPERATOR WHICH IS USED TO IDENTIFY COLUMNS FROM THE PARENT ROWS.CONDITION2 CAN'T CONTAIN ANY SUB-QUERY.
SINCE THE CONNECT BY CONDITION SPECIFIES THE PARENT-CHILD RELATIONSHIP IT CAN'T CONTAIN A LOOP(IF A ROW IS BOTH DIRECT ANCESTOR AND DIRECT DECENDANT OF ANOTHER ROW THERE IS A LOOP).

PRIOR
------
PRIOR IS A BUILT-IN ORACLE SQL OPERATOR THAT IS USED WITH THE HIERARCHICAL QUERIES ONLY. IN A HIERARCHICAL QUERY THE CONNECT BY CLAUSE SPECIFIES THE RELATION BETWEEN PARENT AND CHILD ROWS.WHEN THE PRIOR OPERATOR IS USED IN AN EXPRESSION IN THE CONNECT BY CONDITION, THE EXPRESSION FOLLOWING THE PRIOR KEYWORD IS EVALUATED FOR THE PARENT ROW OF THE CURRENT ROW IN THE QUERY.
May 10 '07 #5
Thank u very much
May 10 '07 #6
debasisdas
8,127 Expert 4TB
Try these sample code.

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT ENAME,EMPNO,MGR FROM EMP START WITH MGR IS NULL CONNECT BY PRIOR EMPNO=MGR
  3. ------------
  4. SELECT ENAME,EMPNO,MGR FROM EMP START WITH MGR IS NULL CONNECT BY MGR=PRIOR EMPNO;
  5. ------------
  6. SELECT ENAME,EMPNO,MGR FROM EMP START WITH ENAME='JONES' CONNECT BY MGR=PRIOR EMPNO;
  7. -------------
  8. SELECT ENAME,EMPNO,MGR FROM EMP START WITH HIREDATE=(SELECT MIN(HIREDATE) FROM EMP) CONNECT BY MGR=PRIOR EMPNO;
  9.  
Hope these will help u a lot.
May 10 '07 #7
Thank u very much it is very useful to me
May 15 '07 #8

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

Similar topics

1
by: Paul Rowe | last post by:
Hello; I am wondering if anyone knows of a way to issue the CONNECT BY clause on data that contains cycles? I have a business requirement that specifies that cycles could be present in the data...
7
by: Bernard Drolet | last post by:
Hi, I have a table containing many millions of rows. This table has a tree stucture, with the following columns id name parent_id I need to go through the tree, starting from a specific Id,...
2
by: Christian | last post by:
HI, Is there a usage for something like this: Select MyColumn From MyTable Start with MyCol = aNumber Connect By MyCol = MyOtherCol If not, its a bit weird that Oracle does not raise an...
3
by: Mary Jane Pronio | last post by:
Hi all, I am very new to DB2 Connect (it was basically dropped in my lap). I've been tasked with installing DB2 Connect v 8.1 FP 3 onto an AIX 5.1 server. That server currently has a...
5
by: Michael | last post by:
Hi, I am migrating an application from Oracle to DB2. There is an Oracle SQL like: SELECT c1, c2 FROM table CONNECT BY c2 = PRIOR c1 START WITH c2 IN ('1','2') My question is how to...
10
by: Andy K | last post by:
Hi again , I've been trying to connect to a distant database with my control center on WinXp . I'm using a personnal edition DB2 v8.1.9.700 for the control center on WinXp. I've setup a...
7
by: Michi Henning | last post by:
Hi, I'm using a non-blocking connect to connect to a server. Works fine -- the server gets and accepts the connection. However, once the connection is established, I cannot retrieve either the...
1
by: NitinShrisunder | last post by:
Hi, I m currently using a query which uses Connect By prior and the query is being in creating a view. But the query's cost is too much and it takes lots of time for the view to fetch data. ...
4
by: Adisc | last post by:
Hi, How can I run a query to fetch the hierarchy without using the command - connect by prior? I want to use this query by BO, which does not support the connect byqstart with option. thanks
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.