niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle » Tools
Connect_by in TOAD SQL Modeler
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Spacebug
*nix forums Guru Wannabe


Joined: 13 Mar 2005
Posts: 101

PostPosted: Tue Apr 12, 2005 11:47 pm    Post subject: Connect_by in TOAD SQL Modeler Reply with quote

Does anybody know if you can use TOAD's SQL Modeler to build a
connect_by query? I can execute a SQL script that includes connect_by
in TOAD, but I can't figure out how to model one.

I've tried the TOAD FAQ and the Yahoo TOAD Users group, but no joy.

As far as I know, Oracle's Query Builder and Discoverer can't handle
connect_by at all, though I haven't tried Discoverer 10g yet.

John Thompson
Back to top
Noel
*nix forums addict


Joined: 25 Mar 2005
Posts: 67

PostPosted: Wed Apr 13, 2005 7:47 am    Post subject: Re: Connect_by in TOAD SQL Modeler Reply with quote

Użytkownik johnathompson napisał:

Quote:
Does anybody know if you can use TOAD's SQL Modeler to build a
connect_by query? I can execute a SQL script that includes connect_by
in TOAD, but I can't figure out how to model one.

I've tried the TOAD FAQ and the Yahoo TOAD Users group, but no joy.

As far as I know, Oracle's Query Builder and Discoverer can't handle
connect_by at all, though I haven't tried Discoverer 10g yet.

I don't know if TOAD can do this, but it's better understand and study
syntax of that kind of SQL queries.

I give example, maybe it helps you...

--
-- Table with 'self-reference' parrent_id->id

CREATE TABLE SHOW_TREE
(
ID NUMBER,
DESCRIPTION VARCHAR2(50),
Parrent_ID NUMBER
);
--
-- Some data

INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(1,'Root row',NULL);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(2, 'Child row
level one',1);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(3, 'Child row
level one',1);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(4, 'Child row
level two',2);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(5, 'Child row
level two',3);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(6, 'Child row
level two',3);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(7, 'Child row
level three',5);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(8, 'Child row
level three',6);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(9, 'Child row
level three',6);
INSERT INTO SHOW_TREE(ID,DESCRIPTION, Parrent_ID) VALUES(10,'Child row
level three',6);

COMMIT;

--
-- Show tree from root to leaves

SELECT Level, Description, LPAD(' ',level,' ')||description desc2, id
FROM SHOW_TREE
CONNECT BY PRIOR id = parrent_id
START WITH parrent_id IS NULL;

-- Show reverse tree

SELECT Level, Description, LPAD(' ',level,' ')||description desc2, id
FROM SHOW_TREE
CONNECT BY PRIOR parrent_id = id
START WITH parrent_id =6;



--
Noel
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Wed Jan 07, 2009 11:24 pm | All times are GMT
navigation Forum index » Databases » Oracle » Tools
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Oracle <--> Excel, using Toad Praveen Tools 3 Tue Jul 11, 2006 7:02 am
No new posts TOAD: SQL Script execution rik Server 4 Fri Jun 09, 2006 12:52 pm
No new posts Oracle SQL script needs finetuning in TOAD email.bernie@gmail.com Oracle 4 Tue May 30, 2006 6:44 am
No new posts TOAD 8.6 Script Output not including query aurora7795@hotmail.com Oracle 1 Tue May 23, 2006 8:57 am
No new posts Which is better and in demand RAPTOR Or TOAD peter Server 22 Sun May 07, 2006 10:02 am

Money News | Car Loan | Budapest | Loans | Bankruptcy
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2073s ][ Queries: 16 (0.1405s) ][ GZIP on - Debug on ]