Connect by to get parents and grandparents
Help! I have this:
NAME LEVEL
Available System Menus 1
Authentication Setup 2
User Maintenance 3
Role Maintenance 3
App Maintenance 3
System Maintenance 3
User -> Role Maintenance 3
Role -> App Maintenance 3
App -> System Maintenance 3
9 rows selected.
THE DIFFICULTY: This query gets me my down-tree from (and including) #2, but how do I get the up-tree (#1, which may or may not include #2)
SELECT app_name,app_id,super_app_id
FROM my_applications
START WITH app_id = 2
CONNECT BY PRIOR app_id = super_app_id;
APP_NAME APP_ID SUPER_APP_ID
Authentication Setup 2 1
User Maintenance 3 2
Role Maintenance 4 2
App Maintenance 5 2
System Maintenance 6 2
User -> Role Maintenance 7 2
Role -> App Maintenance 8 2
App -> System Maintenance 9 2
8 rows selected.
ALREADY TRIED, got a connect by loop error, also did this with app_id=1:
SELECT app_name,app_id,super_app_id
FROM apex_applications
START WITH app_id = 2
CONNECT BY PRIOR super_app_id = app_id;
Hi,
gpoz wrote:
Help! I have this:
NAME LEVEL
Available System Menus 1
Authentication Setup 2 ...Whenever you have a question, please post CREATE TABLE and INSERT statements for your sample data.
THE DIFFICULTY: This query gets me my down-tree from (and including) #2, but how do I get the up-tree (#1, which may or may not include #2)
SELECT app_name,app_id,super_app_id
FROM my_applications
START WITH app_id = 2
CONNECT BY PRIOR app_id = super_app_id;If that query moves in one direction (up or down), then changing where PRIOR goes will move in the opposite direction.
(Of course, if you have loops in your data, then terms like "up" and "down" aren't very helpful.)
ALREADY TRIED, got a connect by loop error, also did this with app_id=1:
SELECT app_name,app_id,super_app_id
FROM apex_applications
START WITH app_id = 2
CONNECT BY PRIOR super_app_id = app_id;You did it correctly. The error is because of your data. Use CONNECT BY NOCYCLE to avoid that error.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0). This is especially important with CONNECT BY queries, because every version since Oracle 7 has had major improvements in this area.
See the forum FAQ {message:id=9360002}
Similar Messages
-
please help - installed IOS7 and now I am having problems playing Words Free on my Iphone. It gives me a pop up telling me to connect to ITunes but will not connect. Cannot get out and have to continually shut down my phone and start over.
Hi, jeantwin.
Thank you for visiting Apple Support Communities.
The steps in the article below may help you resolve the issue with push notifications.
iPad and iPod touch: Unable to use YouTube or Push notifications
http://support.apple.com/kb/ts3305
If the issue persists, try signing out of your Apple ID and then sign back in.
iOS: Changing the signed-in iTunes Store Apple ID account
http://support.apple.com/kb/HT1311
Cheers,
Jason H. -
Need query to get parent and child relations
Hi,
SELECT
a.ID MASTER_ID, a.UNIQUE_NAME MASTER_UNIQUE_NAME, d.ID CHILD_ID, d.UNIQUE_NAME CHILD_UNIQUE_NAME, 1 SUB_LEVEL
FROM
srm_projects a,
prTask b,
prSubProject c,
srm_projects d
WHERE
a.id = b.prProjectID
AND b.prID = c.prTaskID
AND c.PRREFPROJECTID=d.id
The above query gives a project and its child.
Child project can inturn have child projects.
But the above query gives only the first level.
To obtain second level I am presently using the following query
SELECT
a.ID MASTER_ID, a.UNIQUE_NAME MASTER_UNIQUE_NAME, d.ID CHILD_ID, d.UNIQUE_NAME CHILD_UNIQUE_NAME, 1 SUB_LEVEL
FROM
srm_projects a,
prTask b,
prSubProject c,
srm_projects d
WHERE
a.id = b.prProjectID
AND b.prID = c.prTaskID
AND c.PRREFPROJECTID=d.id
UNION ALL
SELECT
a.ID, a.UNIQUE_NAME, g.ID, g.UNIQUE_NAME, 2 SUB_LEVEL
FROM
srm_projects a,
prTask b,
prSubProject c,
srm_projects d,
prSubProject e,
prTask f,
srm_projects g
WHERE
a.id = b.prProjectID
AND b.prID = c.prTaskID
AND c.PRREFPROJECTID=d.id
AND d.ID = f.PRPROJECTID
AND f.prID = e.prTaskID
AND e.PRREFPROJECTID=g.id
But the problem is there is no limit on levels. They can go on to 20 to 30.
So i need a query which gives me all the levels and not as above one where i am specifying till wht level.
Please guide me.Thanks.
Please find the table structures
CREATE TABLE SRM_PROJECTS
ID NUMBER NOT NULL,
NAME VARCHAR2(240 BYTE),
UNIQUE_NAME VARCHAR2(60 BYTE),
DESCRIPTION VARCHAR2(2286 BYTE),
IS_ACTIVE NUMBER DEFAULT 1 NOT NULL,
CREATED_DATE DATE NOT NULL,
CREATED_BY NUMBER NOT NULL,
LAST_UPDATED_DATE DATE NOT NULL,
LAST_UPDATED_BY NUMBER NOT NULL,
CREATE TABLE PRTASK
PRUID VARCHAR2(32 BYTE),
PRID NUMBER(10),
PRPROJECTID NUMBER(10),
PRISUNPLANNED NUMBER(10) DEFAULT 0 NOT NULL,
PRSHORTNAME VARCHAR2(48 BYTE),
PRNAME VARCHAR2(450 BYTE),
PREXTERNALID VARCHAR2(48 BYTE),
PRISMILESTONE NUMBER(10) DEFAULT 0 NOT NULL,
PRCATEGORY VARCHAR2(96 BYTE),
CREATE TABLE PRSUBPROJECT
PRUID VARCHAR2(32 BYTE),
PRID NUMBER(10),
PRTASKID NUMBER(10),
PRREFPROJECTID NUMBER(10),
PRREFTASKID NUMBER(10),
PRISREADONLY NUMBER(10) DEFAULT 0 NOT NULL,
PRISIPD NUMBER(10) DEFAULT 0 NOT NULL,
PRMODBY VARCHAR2(96 BYTE),
PRMODTIME DATE
) -
Standard BT Exchange speeds just get slower and sl...
St.Athan exchange, Vale of Glamorgan, S.Wales - Over the last year the speeds I am able to get from my broadband connection are just getting slower and slower. A year ago I could just stream video (important since my business deals in this medium). However, now not only can I not stream video, I have trouble doing the most basic of internet business. Not only is my line speed slow (2mbs tops) but it drops out all the time.
I know it is not my service provider at fault or my house lines because all my neighbours are having the same problem and are with differing ISP's.
It must be that the exchange is getting steadily more oversubscribed and can no longer handle the amount of work it is being asked to do.
I think that my only option (and others in the area) is to completely ditch the BT landline and opt for mobile internet. The speeds available on mobile internet using a device like 3's MiFi arent fantastic but they should at least blow my BT connection away.As you have stated that you are a business user, then try the Business forum here http://business.forums.bt.com/
they are more likely to be able to help you, as this forum is for domestic customers of BT Broadband.
There are some useful help pages here, for BT Broadband customers only, on my personal website.
BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones. -
I get a message that my ipad 2 and iphone 5 cannot connect to the itunes store when I try to sync a book to my book app. Although, when I click "store" both are able to access the itunes store. Why is this? Also I tried to open a book that was synced and a message that I did not have enough memory to load this book popped up--when I know that I have well over 40gb of memory left in my ipad and over 16gb left in my iphone. The message that I cannot connect to the itunes store is strange that it offers no option and I have to hit OK to get out and use my ipad or iphone.
Try logging out of your account on the iPad by tapping on your id in Settings > Store and then log back in and see if it then works.
If that doesn't solve it then what has worked for some people is going into Settings > General > Date & Time and changing the date to a few months (or maybe a year or two) in the future and then re-trying -
Firefox connects to google-analytics for some sites,when i click on links in websites or emails and then gets stuck, and I can never get onto the site. Or opens a new bower behind the one i'm usind that's blank i don't even know it's there untill i close the one i'm using. How do I prevent Firefox from connecting to google-analytics? Or opening a blank bowser behind the one i'm using. I use XP with service pak 3 in English
== This happened ==
A few times a week
== a couple months agoI got the same issue.
I go on a website and all the sudden another window pops up with "results.google-analytics.com" or "search.google-analytics.com". It has often ads for other sites for example. black single dating site
how can I can I stop that from happening again?
I didn't download or do anything, just visit websites, that I visit on a regular basis.
OS: Windows XP
Firefox Version: 3.6.6 -
Hello Everyone, I just bought a HP Photosmart Premium All-in-One Printer - C309g but i find it very difficult to connect to it via BLUETOOTH and WIRELESS on my IPAD 3...i will be very greatfull if i'll get a solution as soon as possible. Thanks
Hi Tomiwa,
You cannot print from the iPad to that printer. AirPrint and Bluetooth are completely different.
There may be apps you can buy that will enable using that printer, but that is not an ideal solution.
That particular printer has had many bad reviews, and is unreasonably expensive for its features. Considering that you just bought the printer, as well as its lack of AirPrint, I suggest you return it and buy a printer that supports AirPrint. -
Hi my iPhone 4 won't turn on . When plugged in on several different chargers the following happens . Blank screen then apple sign for a short period then it buzzes and goes blank. Have tried power button and home button but no change ,When connected to mac get message that phone is in recovery mode and that i must restore this phone before it can be used with iTunes . Is this my last resort as I have some photoessays I don't want to loose.
PPlease helpHello, Chantal105
Thank you for visiting Apple Support Communities.
If your device is in recovery mode you will need to restore the device.
If you can't update or restore your iOS device
http://support.apple.com/kb/HT1808
Cheers,
Jason H. -
I am trying to connect my fathers ipod touch to itunes on my computer, how can i sync itunes on my machine with the ipod such that his songs don't get deleted and i could add new songs to it (mp3 on my computer)
You cannot merge accounts. Frequently asked questions about Apple ID - http://support.apple.com/kb/HE37
One computer using multiple iTunes Store authorizations - http://support.apple.com/kb/HT1206 -
I have the mini display port cable to hdmi. When I connect I can get audio but on the video I get the display auro screen and can't get my actual display to show as that is not what shows on my display. How can I fix this?
System Preferences>Displays
There is a little white bar. When you have your TV connected, move the white bar to the other display. Your main desktop is now the TV screen -
After I've upgraded my iPhone iOS to 5.0.1, I got problems with connectivity. If my iPhone lose network, then it gets frozzen and I cannot make calls. After restart the telephone still does not work.
1. Download the iOS 5.0.1: http://www.tobias-hartmann.net/2011/11/download-ios-5-0-1-veroffentlicht-direkte -downloadlinks/
2. open itunes,Click in iTunes while holding down the Shift key (on Windows) or Alt key (Mac) to restore and firmware -
I perviously transfered all my iTunes music to an external hard drive. But now when I connect the external hard drive and try to play a song, I get an error message saying that I need to "locate" my music. I don't how to find it on my external hard drive. Please help for I am not that computer savy and don't want to mess anything up.
Thanks!I called Apple Support and they walked me through it. They told me to basically copy and paste my music to the external hard drive. (I think.) Or maybe it was they had me transfer a folder to the EHD. I don't exactally remember it was a few years back. But I tried to plug in the EHD before starting and...nothing. Still says same thing, "locate file."
-
Every time i connect my iphone to itunes and trying to do a backup or get the new update it says i have to restore my iphone. and then that doesnt work, i tried to reinstall itunes but it doesnt work. i get this all the time. fix it please.
iTunes states " There's a problem with your Iphone, please contact apple service center " Also i took my iphone to a local service man and he told me the IMEI code has been corrupted and there's nothing that can be done about it. Please help, if you have any solution.
Thank you -
I connected my phone to computer and when I did I needed an update on my phone. when I did this all of my music on phone disappeared. How do I get my music back?
Resync it from your iTunes library. Music is not included in your backup.
http://support.apple.com/kb/HT4946 -
I got the iPhone 5s this morning and I kept my number and as soon as it charged I got all my messages, but when I connected it to my iCloud and backed it up, when it was finished all the messages I received were gone. How do I get them back?
Hi sofia124,
Welcome to the Apple Support Communities!
It sounds like you may have either set the iPhone up as a new iPhone or restored from a backup that didn’t have your messages on it. If you do have either an iCloud or iTunes backup that you believe has your messages saved, you can restore from that backup to recover your information. Please use the attached article as a reference for restoring from a backup.
Back up and restore your iOS device with iCloud or iTunes
Have a great day,
Joe
Maybe you are looking for
-
I have tried to point my arrow in the corner to resize the mail window. Its too big. It doesn't work. It just wants to take action based on whatever is closest to the corner where I point the arrow.
-
HDV and Digital Cinema View.
Hi I am using Digital Cinema View for playback of my timeline (View>All Frames) and the images seems to have traces (horizontal lines is best way I can describe) and text (like rendered Motion titles for example) looks poor too. My playback is set to
-
HTML DB1.6 installation --Kjell Ove, please reply :-)
Hello, After installed the Oracle 10g db, I tried two ways to install html db: 1. in the oracle 10g bin directory, I click the sqlplus icon, then a dos terminal show up:(I enter the following info, and get the errors) Enter user-name: sysdba Enter pa
-
Hello all! All of a sudden i get the above error when i try to create a new table in my Oracle 9i database running on winXP. Cannot use system rollback segment for non-system tablespace 'TS_VAS_HR'. The tablespace exists. Wat cld b the problem. thnx
-
New version of Data Modeller?
Any idea when the next version or patchset of Data Modeler will be released?