Data Dictionary.. Help Please

I have to create this query for my college course. I need help. I have half of the query, I think. Need another join clause in the from statement for the views, not sure what to do. Any help will be appreciated! Thank you!
Create and execute a single query of the Oracle data dictionary to display all foreign key constraints in the HR schema. Note that foreign key constraints are constraint type 'R'. For each constraint list the constraint type, constraint name, the referencing table name, the referencing column position(s), the referencing column name(s), the referenced constraint name (i.e. the other table's primary key constraint name), the referenced table, and the referenced column(s). Sort your results by constraint name, table_name, and position.
HINTS: You will need two different data dictionary views for this query. One of the views will need to be mentioned twice in the FROM clause, and therefore you will need two different aliases. With this arrangement you will also need two join conditions.
This is what i have so far...
SELECT uc.constraint_type, uc.constraint_name, uc.table_name, r_constraint_name,
ucc.table_name, ucc.position, ucc.column_name, ucc.constraint_name
FROM user_constraints uc JOIN user_cons_columns ucc
ON uc.table_name= ucc.table_name
AND uc.constraint_name= ucc.constraint_name
WHERE constraint_type= 'R'
AND r_constraint_name IN
(SELECT constraint_name
FROM all_constraints
WHERE constraint_type
IN ('P','U')
AND table_name= 'hr')
ORDER BY uc.constraint_name, ucc.table_name,ucc.position;

Ok, you have the correct two dictionary views (assuming you are logged in as HR), now you need to figure out which one is needed twice. As a hint, you have the required join columns for the doubled dictionary view in the single use dictionary view.
A couple of comments on the code you have posted so far.
The predicate:
r_constraint_name IN (SELECT constraint_name
                      FROM all_constraints
                      WHERE constraint_type IN ('P','U') AND
                            table_name= 'hr')is unnecessary since by definition, if the constraint type is R, then the r_constraint_column will point to a P (primary key) or U (unique key) constraint.
By default, all objects in Oracle are stored in the dictionary views in upper case, so when you query a value you need to use upper case for the literal.
Again, assuming that you are logged in as HR, then the user_xxx views will only show objects that belong to the HR schema, so there is no need to qualify anything with an owner.
When you are posting code on this site type {noformat}{noformat} before and after your code sample, this will preserve the formatting of your code so it will be more readable.  If you want to see an example of this, click reply to this post and then click the quote button in the reply pane and you will see how I kept the formatting in the snippet above.
John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Dictionary Help please

    Oracle 11.2.0.1
    Windows
    SQL> select table_name from dba_tab_columns where column_name like 'JOB_%' and column_name LIKE 'COMMENT%';
    no rows selected
    SQL> desc DBA_SCHEDULER_JOB_ROLES;
    Name                                                                                                      Null?    Type
    OWNER                                                                                                     NOT NULL VARCHAR2(30)
    JOB_NAME                                                                                                  NOT NULL VARCHAR2(30)
    JOB_SUBNAME                                                                                                        VARCHAR2(30)
    JOB_CREATOR                                                                                                        VARCHAR2(30)
    DATABASE_ROLE                                                                                                      VARCHAR2(16)
    PROGRAM_OWNER                                                                                                      VARCHAR2(4000)
    PROGRAM_NAME                                                                                                       VARCHAR2(4000)
    JOB_TYPE                                                                                                           VARCHAR2(16)
    JOB_ACTION                                                                                                         VARCHAR2(4000)
    JOB_CLASS                                                                                                          VARCHAR2(30)
    SCHEDULE_OWNER                                                                                                     VARCHAR2(4000)
    SCHEDULE_NAME                                                                                                      VARCHAR2(4000)
    SCHEDULE_TYPE                                                                                                      VARCHAR2(12)
    START_DATE                                                                                                         TIMESTAMP(6) WITH TIME ZONE
    REPEAT_INTERVAL                                                                                                    VARCHAR2(4000)
    END_DATE                                                                                                           TIMESTAMP(6) WITH TIME ZONE
    LAST_START_DATE                                                                                                    TIMESTAMP(6) WITH TIME ZONE
    ENABLED                                                                                                            VARCHAR2(5)
    STATE                                                                                                              VARCHAR2(15)
    COMMENTS                                                                                                           VARCHAR2(240)
    SQL> desc DBA_SCHEDULER_JOB_CLASSES;
    Name                                                                                                      Null?    Type
    JOB_CLASS_NAME                                                                                            NOT NULL VARCHAR2(30)
    RESOURCE_CONSUMER_GROUP                                                                                            VARCHAR2(30)
    SERVICE                                                                                                            VARCHAR2(64)
    LOGGING_LEVEL                                                                                                      VARCHAR2(11)
    LOG_HISTORY                                                                                                        NUMBER
    COMMENTS                                                                                                           VARCHAR2(240)I am trying to find out the name of dictionary views how have JOB_% and COMMENT% column names please...
    Thanks.

    I am sorry, but this is not what I am looking. Your query is giving me below output :
    SQL> ed
    Wrote file afiedt.buf
      1  select distinct table_name from dba_tab_columns
      2* where column_name like 'JOB_%' OR column_name LIKE 'SQL%'
    SQL> /
    TABLE_NAME
    SQL_VERSION$
    DIR$QUIESCE_OPERATIONS
    V_$SYS_OPTIMIZER_ENV
    387 rows selected.But when I said :
    SQL> desc SQL_VERSION$;
    Name                                                                                                      Null?    Type
    VERSION#                                                                                                  NOT NULL NUMBER
    SQL_VERSION                                                                                                        VARCHAR2(30)
    SQL> desc DIR$QUIESCE_OPERATIONS;
    Name                                                                                                      Null?    Type
    JOB_NAME                                                                                                           VARCHAR2(100)
    ALERT_SEQ_ID                                                                                                       NUMBER
    JOB_TYPE                                                                                                           NUMBER
    INCARNATION_INFO                                                                                                   VARCHAR2(4000)
    INSTANCE_NAME                                                                                                      VARCHAR2(4000)
    SUBMIT_TIME                                                                                                        DATE
    STATUS                                                                                                             NUMBER
    START_TIME                                                                                                         DATE
    END_TIME                                                                                                           DATE
    ERROR_MESSAGE                                                                                                      VARCHAR2(4000)
    SPAREN1                                                                                                            NUMBER
    SPAREN2                                                                                                            NUMBER
    SPAREN3                                                                                                            NUMBER
    SPAREN4                                                                                                            NUMBER
    SPAREN5                                                                                                            NUMBER
    SPAREVC1                                                                                                           VARCHAR2(4000)
    SPAREVC2                                                                                                           VARCHAR2(4000)
    SPAREVC3                                                                                                           VARCHAR2(4000)
    SPAREVC4                                                                                                           VARCHAR2(4000)
    SPAREVC5                                                                                                           VARCHAR2(4000)I am not getting the JOB% AND SQL% column names please.

  • ISCSI volume lost, have the .img file but no access to data. Help please, WD support worthless!

      Basically, I have a iSCSI target which I cannot access  after re-installing windows because the CHAP "secret"  I thought I knew was wrong.  Although I was told there was no way to acess the .img file by WD, I was able to pull the image using an SSH connection to the EX2 from a hidden folder.  So now I have that file stored locally.  Of course it would just be too easy to be able to mount that file and I understand why that is.  However, through research, I am seeing that it may in fact be possible some how.   Can anyone please help me with the resources that I have?  I have alot of info that I really do not want to lose and I dont have the funds to pay a data recovery company thousands of dollars like WD support suggested.  Is the .img file encrypted or is it just a FS that windows wont recognize?  Please help and I would really appreciate any info. Thank you.

    if the iSCSI target is protected with a username and password.  It would not do any good even with a linux tool to open it. Like WD tech support suggest to find a recovery company is all your best bet.  If you still have access to your NAS, you should be able to change the iSCSI target to with CHAP enable to NONE.  From your Windows try to access your iSCSI target again without a password. bda714 wrote:
    After being told multiple times by WD support that there was nothing I could possibly do to access my LUN i have gotten to a point that I believe is close to where I am trying to be.  Along the way, there were many times that the support tech's at WD had told me what was said to be rock solid information, was proven to be wrong. . . at this point I feel like I am better off on my own and hopefully with some help from the community. Basically, I have a iSCSI target which I cannot access  after re-installing windows because the CHAP I thought I knew was wrong.  Although I was told there was no way to acess the .img file by WD, I was able to pull the image using an SSH connection to the EX2.  So now I have that file stored locally.  Of course it would just be too easy to be able to mount that file and I understand why that is.  However, through research, I am seeing that it may in fact be possible some how.   Can anyone please help me with the resources that I have?  I have alot of info that I really do not want to lose and I dont have the funds to pay a data recovery company thousands of dollars like WD support suggested.  Is the .img file encrypted or is it just a FS that windows wont recognize?  Please help and I would really appreciate any info. Thank you. 

  • Data storage help please!

      Hi,
    I just moved from pc to an iMac (27" i5 with 16gb RAM) and loving it! I am new to data storage as well and need some help with the setup. I have a ton of pics and I'm getting into edditing a lot of pictures and retouching using photoshop cs5. Based on what i have been able to read I was thinking of using maybe 2 drives as RAID 1, and an extra drive as a scratch disk and one more as a time machine... does this make sense?  Is it better just to stack 4 drives?
    Thanks!

    I would recommend using some high quality external HD to store your raws and tiffs. The drives I'd recommend are:
    G-Tech G-DRIVE series
    LaCie d2 Quadra series
    OWC Mercury Elite Pro series
    Each have excellent build quality and good features.  Personally I use the LaCie's ( I have 4 currently) but the other two would be more than welcome on my desk. I would also get a separate drive to use as a Time Machine drive. There are numerous backup strategies you can use and TM is a good place to start. Here are some MacWorld articles that discuss different strategies, as you will see when it comes to back up redundancy is a wise decision.
    Backup Plan I
    Backup Plan II
    Backup Plan III
    There is no "best" solution, you need to search for what fits your needs best and research to see if it is totally compatilble with your system and applications.

  • Date cell help please...

    I have a cell that adds 14 days to the date for invoicing purposes =CONCATENATE(TODAY()+14," latest")
    The problem is I want the value of this cell to be based on a date that I input elsewhere on the spreadsheet and not the current date.
    Any ideas please!
    James :-}

    you need not use the function concatenate() and can do the same thing like this:
    =today()+14 & "latest"
    if you can to enter the date in cell B1, then the formula can be adjusted to:
    Enter in B1
    formula is in B2:
    B2=MONTH(B1+14)&"/"&DAY(B1+14)&"/"&YEAR(B1+14)& " latest"
    this is shorthand for in cell B2 type (or paste) the formula "=MONTH(B1+14)&"/"&DAY(B1+14)&"/"&YEAR(B1+14)& " latest"" without the double quotes

  • Data Recovery Help Please!

    I lost all my data during the iOS 7 update... is there anyway i can get it back? i didnt back up my phone before the update.

    Well you can only recover your data from a backup.
    If you don't have a current one, then maybe you have an old one to backup to.http://support.apple.com/kb/HT1766

  • Firefox won't open at all since May 4 update, yet no error message appears. Am not savvy/brave enough to test for corrupt Profile data. HELP, PLEASE!

    Tried to start Firefox 3.6.16 from Desktop May 4. Instead of opening, message showed an update in progress, then a message that it could not install because two Firefox programs were running (?). After the install message closed Firefox wouldn’t open from the Desktop, the Start Menu, or the Run command. I’ve rebooted numerous times & even did a System Restore to May 3.
    C:\Program Files\Mozilla Firefox currently shows only one firefox.exe, last modified 03/23/11, and the only changes May 4 to chrome folder (6 Executable Jar Files), components folder (browser.xpt), & blocklist.xml.

    Thank you very, very much for providing the simple, concise directions that solved my problem! After sorely missing Firefox 3.6.16 for a month, today I finally worked up the courage/got desperate enough to attempt (with much trepidation!) the download and re-installation.
    Step 4 was a bit of a challenge, but following Uninstall directions in the 3.6.16 Release Notes advising removal through Control Panel appears to have preserved my Profile and worked fine. Was not quite sure how to go about properly removing the Firefox program folder, so I opened Local Disk (C:)/Program Files/ and deleted (to Recycle Bin) the Mozilla Firefox folder – and am keeping fingers crossed that that was the correct method.
    It was quite a satisfying thrill when Firefox 3.6.17 opened, but very distressing to note that “Firefox 3.6.x will be maintained with security and stability updates for a short amount of time. All users are strongly encouraged to upgrade to Firefox 4”. Sadly, it seems all things Internet seem to be evolving towards mobile devices, social networking, and the ability to sync all the fancy new toys – and getting much to complex for us old dogs who don’t learn new tricks easily, or need them for that matter.
    Thanks again!

  • Performa 6500 to G4 PPC data transfer help please

    I now need to recover some files to my current G4 (Leopard) from my old Performa 6500/225 with ethernet but no monitor, no zip, no printer now and read-only CD. Then I will recycle the tower, kb and mouse.
    If the HD is difficult to remove, should I risk having the technicians try to do it (main Apple dealer techs says they won't touch it but another Mac dealer technician says maybe-- but if it's difficult to remove, what's the risk?)
    Can I easily use a converter to use my current LCD with the Performa (not sure I can locate an original monitor to use) or what other options?
    I see the links on how to set up a network between the macs but is this something a novice can do easily between these systems?
    I did keep my classic/OSX option open with my G4 but then upgraded to Leopard so no longer have the classic option.
    Thanks for any advice

    You can use almost any monitor with the 6500, if you have a suitable adapter.
    Do not let the 15-pin two-row Mac display connector scare you. It uses EXACTLY the same basic signals as the 15-pin 3-row \[aka "VGA"] connector: Red, Green, Blue intensity signals, and Horizontal and vertical Sync signals.
    The difference is that the adapter must also supply some ID bits, which the Mac reads at startup to determine what display is attached.
    If your existing monitor can do VGA resolutions, adapters to use a PC VGA monitor on a Mac are common. Just look at it carefully, and make sure the Mac-side of the adapter has pins, and the VGA-cable side has holes, and not the reverse.
    RE: networking
    If you have Broadband Ethernet access (via DSL or Cable Modem) you have seen the Control Panels/Preferences and used the cables you need to set up a small Ethernet network. It is a little complicated, but not difficult.
    106658- Creating a Small Ethernet Network

  • How to create a line type in data dictionary

    How to create a line type in data dictionary?Please explain step by step?
    Thanks & Regads,
    Sairam

    Hi,
    the details abbout the line type.
    The line type of a table type can be defined by:
    o Specification of a type that already exists (data element,
    structure, table type, table, view) whose properties are then copie
    as properties of the defined table line.
    o Direct type input, where data type, number of positions, and, if
    required, decimal places, are entered directly.
    o Specification of a reference type.
    and SE11 and click on datatype and click on table type and enter the line type.
    Thanks
    Shiva

  • HT1349 hi guys i have 2 ? 1 my daughters iphone is trying to update on my mac cant get it off help please ,,, 2 i have an old apple id and when i try to up date it keeps looking for the password how do i delete this old apple id help

    hi guys i have 2 ? 1 my daughters iphone is trying to update on my mac cant get it off help please ,,, 2 i have an old apple id and when i try to up date it keeps looking for the password how do i delete this old apple id help

    Hi.
    I had a similar problem myself. This is what helped me.
    I went to the App store app, scrolled to the bottom, logged out of the account, re logged in with my Apple ID.  Then went back to app updates. Once I put in my ID password all was fine.

  • TS3297 when I press the iTunes button on my ipod touch I get the message 'cannot connect to iTunes store' .  My wifi is working fine, I can connect to safari & you tube, no parental setting in place, and time and date are correct. Can anyone help please?

    When I press the iTunes button on my ipod touch I get the message 'cannot connect to iTunes store' .  My wifi is working fine, I can connect to safari & you tube, no parental setting in place, and time and date are correct. Can anyone help please? I have restored my ipod to factory settings and rest it.

    I also tried moving the date forward by a year and then moving it back to normal and it still doesn't work.  i can't find an automatic update of time zones on my itouch to turn this off.

  • All of my playlists made on my Ipod touch 3rd gen keep disappearing when I sync it to itunes. Drivng me crazy. All software up to date on both itunes and Ipod. Help please.

    All of my playlists made on my Ipod touch 3rd gen keep disappearing when I sync it to itunes. Drivng me crazy. All software up to date on both itunes and Ipod. Help please.
    I tend to make my playlists right on my ipod. This did not happen for the last 2 years. Just started recently. Did get a new computer recently.

    That is because you got a new computer. You can only sync all media from one syncing computer. You can sync from any computer to iPod using the manual method but that does not sync from iPod to computer.
    To make this your syncing computer:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • Dowloaded After Effects and says its up to date but there is no trace of it being anywhere on my computer. All other Softwares are there, except that one. Can't re-dowload it. Help Please!

    Dowloaded After Effects and says its up to date but there is no trace of it being anywhere on my computer. All other Softwares are there, except that one. Can't re-dowload it. Help Please!

    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6 Do as Mylenium told you. If you don't know where it is. Go to www.adobe.com, sign in, search for the cc cleaner tool downloader and it should fix the issues. Have you went into your control panel, under programs and features and removed it from there?

  • How do I retrieve photos/data etc. from my iPhone 4 before a completely erasing restore! It'stuck on a "connect to iTunes" to restore screen!  Help please!!!

    I connected my iPhone 4 to my PC to sync all my new info to iTunes/PC, but it said it was not able to recognize it and needs to do a complete restore!  How do I retrieve photos from my iPhone 4 before a complete restore! It'stuck on a "connect to iTunes" to restore screen and won't do anything else!  I tried rebooting the phone (holding the top button and the home button and the SAME "connect to iTunes" screen comes up.  If I restore, I will lose ALL my unsynced photos, apps, and data from the past week (INCLUDING pics from a concert WITH band members!) Help please!  MAYDAY!  My prior backup does NOT contain these photos/apps/data! Ahh!!!!

    I am having the same problems as this person. I see that someone said there is no way to retrieve the pictures once it gets stuck in recovery mode.
    Then further along someone said that there are data retrieval methods except they have something to do with jail breaking a phone.
    My phone is already jail broken. It was kind of a gift from the company I work for- it was a fellow employees before. He jail broke it and then it was given to me. After I got it I activated the 4 and tried to back up everything. It didn't work and "Springboard" forced the phone into safety mode. So I could use it with the old dude's apps and my contacts. I made the mistake of using the phone for wedding dress shopping with a friend. I took tons of pictures.
    After this I found out the messages I was seeing meant it was jail broken. At&t said to force restore the phone - iTunes wouldn't recognize it in safety mode. I'm an idiot and didn't realize what this meant for my pictures. It didn't work (error 1611) - thankfully. Now it is stuck in recovery mode (iTunes icon and USB cable picture).
    Can I access that media in any way? It never suceeded restoring itself so is it still there? The phone is jail broken already so is there a method I can use?

  • My Macbookpro has turned into microsoft windows and lost all data, how do I recover it with my windows 7 still inside? I accidentally install directly, Help please...

    My Macbookpro has turned into microsoft windows and lost all data, how do I recover it with my windows 7 still inside? I accidentally install directly, Help please...

    ok turn it off manually and turn it back on while holding the apple logo bottor or the function botton this will give you  an option to choose if you want to startup with osx ow windows. let me know if this works
    <Email Edited By Host>

Maybe you are looking for

  • Premiere Pro & SpeedGrade CC keep crashing in Windows 8.1

    I just bought a brand new MSI laptop with Windows 8.1 and installed the CC suite. Premiere Pro and SpeedGrade continually crash when I try to use them. Premiere Pro crashes almost every other time I open it. Once it is open it works fine, but almost

  • Company code chart of accounts

    Hi can any one of you explain me the procedure to create company code GL accounts and the group GL accounts: our client scenario is: he has a 5 different company codes and in those 4 company codes are using one kind of GL accounts and one company cod

  • Graph Dynamic Row Labels

    Hi, I am creating a stacked bar graph that contains 7 row lables. The row labels are represented on seperate columns in the underlying table and I would like to dynamically select the row labels & count(values) instead of specifying 7 rowlabels due t

  • Booting without initrd - what am I missing [solved]

    Can one use the contents of the system's kernel.img to determine exactly what needs to be built into the kernel to avoid booting with the initrd image, and boot to the kernel directly? For example, initially, I found 5 modules in the image: bsdtar -t

  • Inbound processing using SO50

    Hi Experts, We have the Special user id specifically created to receive emails. The requirement is to send Notification mail to the emails received after few verifications. We have assigned the Z class in SO50 for this recipient address. And this Z c