How do I obtain detailed View Info

II am working with someone who is trying to develop a procedure capable of creating "Instead of" triggers against any view that is passed in as a parameter. Such a procedure could reduce development time, as the "Instead of" trigger creation of the more complex views are somewhat time consuming. We plan to use updatable views more in the future as they seem to greatly simplify the interface on web development projects, between the database and the application developers.
Unfortunately, we seem to have encountered a limitation in being able to do this in an automated way, which according to the developer is insurmountable.
The challenge is that we are unable to consistently and reasonably determine the hierarchy of the tables within a view. For example, to populate the foreign key column in children tables, the primary key of the parent table must first either be created (i.e., in the case of an insert in the parent table), or selected if the parent record existed previously. The developer has tried two different approaches to resolving this problem, and has stated that neither were successful. The approaches already tried were:
1) Running an explain plan against the view, and then retrieving the table hierarchies from the explain plan tables. His remark about this solution was:
"Explain plain doesn't show hierarchy of table joins."
2) Attemping to derive the hierarchy from the Foreign Key Constraints of tables being used in the view. His remark about this solution was:
"It works but only for simple joins. When there are several references to same table "where" clause should be parsed to find out what field references some table instance which is not trivial."
Apparentlty when we join to the same table multiple times within the view (i.e., getting both a persons home phone and their cellphone from the PHONES table), it somehow complicates the matter.
Is anyone aware of a method of reliably getting table hierarchy information from a view, so that we can accomplish our goal? The only other idea which someone suggested was to temporarliy create a "Materialized View" of the view, and then retrieve the table hierarchy from the "Materialized View" tables. He will attempt that approach shortly.
Ay thoughts or suggestions would be greatly appreciated!

While updateable views and instead of triggers do have their place, I'm not convinced that that place is to "... greatly simplify the interface on web development projects, between the database and the application developers". Personally, I think that is why Larry invented packages.
It seems to me that what you are trying to do is something like:
CREATE VIEW everything_there_is_to_know_about_an_employee AS
SELECT every_column
FROM every_table_sometimes_two_or_three_times
WHERE all_possible_joinsThen use instead of triggers on that single view to do all operations.
It seems to me that a package based API would be much cleaner, easier for developers to use, more maintainable, more extensible, and more scalable. I would seriously consider creating a package along the lines of:
CREATE PACKAGE employees AS
   FUNCTION get_demographics(p_empid IN NUMBER) RETURN SYS_REFCURSOR;
   FUNCTION get_job_history(p_empid IN NUMBER,
                            p_enddt IN DATE DEFAULT sysdate) RETURN SYS_REFCURSOR;
   FUNCTION get_sal_history(p_empid IN NUMBER,
                            p_enddt IN DATE DEFAULT sysdate) RETURN SYS_REFCURSOR;
   PROCEDURE hire_employee (p_frname IN VARCHAR2,
                            p_srname IN VARCHAR2
                            p_empid OUT NUMBER);
   PROCEDURE transfer_employee (p_empid IN NUMBER,
                                p_tojob IN NUMBER,
                                p_effdt IN DATE DEFAULT SYSDATE);
END;If you want to pass the "objects" form your web service instead, that is relatively easy to do. You could create objects in the database like:
CREATE TYPE emp_job_tp AS OBJECT (
   empid   NUMBER,
   empname VARCHAR2(50),
   jobid   NUMBER,
   jobname VARCHAR2(50),
   eff_dt  DATE);
CREATE TYPE emp_job_tbl AS TABLE OF emp_job_tpand pass those into and out of the stored procedures.
JPublisher, a component of Jdeveloper, can automatically build the classes and methods to transform java objects to SQL Objects and vise versa. So, you get a set of re-usable methods on the app side that can be used for other applications, as well as a set on the database side.
Sure, somebody needs to write the packages, but a fair bit of that (particulalry the single table APIs) could be automated just as easily as the instead of triggers on simple views.
One of the in-house applications I work on gets interfaces from several of our applications dealing with patient demographics, visits, orders and results. For a variety of reasons, the incoming messages do not necessarily come in strict time order, so a typical setter procedure has a signature something like:
PROCEDURE set_medication (p_med  IN Medication_tp,
                          p_pat  IN Patient_tp,
                          p_vis  IN Visit_Tp,
                          p_auth IN VARCHAR2,
                          p_fac  IN VARCHAR2);The java message parser creates objects (in the java sense) from the message for the medication order, the patient demographics and the visit information. Using the Jpub created classes, these are converted to the defined Oracle types, and then passed to the procedure. The procedure, not the java app, determines whether the patient already exists or not and takes appropriate action (insert, update or nothing), similarly, it determines whether the visit exists and whether the medication order exists, and takes appropriate action.
On the other side, there are web services calling multiple getter procedures and serving those to one of several dozen user facing applications. In general, the getter procedures return either an object (e.g. a patient object), a table of objects, or a refcursor, depending on the expected volume of data. Some of these getters are specific to one of the user facing applications, others are used my most, if not all, of them.
Not an updateable view or instead of trigger in the lot, although I do use both in other applications.
Just my 0.02 $CDN.
John

Similar Messages

  • How to save the detail view of a task in a database?

    Hi experts,
    I need to save the detail view which we get after selecting the work item in the table list in UWL. Can anyone provide me the solution for it step by step as I have no prior knowledge of portal.
    Thanks,
    Amit.
    PS: Points will be rewarded.
    Edited by: amit sinha on Jun 4, 2008 5:41 PM

    Hello,
    take a look on the below example :
    --Initialize data
    Create table #tmp (id int,name varchar(50),marks int)
    Insert into #tmp values (1,'a' ,3)
    Insert into #tmp values (2,'b',5)
    --Decalare variable
    Declare @maxid int, @minMarks int
    --Take data from table
    Select @maxid=max(id),@minMarks= min (marks) from #tmp
    --Select data storead in variables
    Select @maxid,@minMarks
    Drop table #tmp
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • How do I see a detailed view of what's on my hard drive and how much space it's consuming?

    I have an early 2007 iMac (3GB RAM) and a 320 GB hard drive.  I'm trying to clear some of the programs and files I don't need to free up space, but I'm not sure how to get a similar look at my files and how much space they take up individually (as I would with a PC).  Under system info I'm able to get the high-level overview, but how do I see a detailed view that I can then edit?

    Thanks for your help.  I did just that and was able to get a much better view with OmniDiskSweeper.  I was shocked to find that my MobileSync files were 125 GB of about 270 being used!  Guess I shouldn't be surprised with 4 iPhones and 4 iPads syncing to the same iMac at one time or another -- just kind of surprised Apple/iTunes doesn't make it any clearer that this can turn into a big problem if you don't initially create the appropriate backup settings for your devices.  Thanks again!

  • How to set a page template for news detailed view?

    Is there a way to set a page template for the detailed view of the news module?
    I have a page template setup and added the {module_announcement,,,,,} to the page. When the news item is clicked it always opens the default template - is this how it is designed to work or is there a way I can specify it to use a different page template?
    Dave.

    Hey Dave, See the image below:

  • Can there be multiple Master Detail Views, if yes then how? Please suggest

    Dear All,
    In first master-detail view, I have a button, which when clicked will trigger the second detail view.
    I tried invoking second master detail view but was not able to see the second master view. Could you please guide as to how to go about this.
    Thanks.

    Do a Google search. Here's one link.
    http://mobiforge.com/developing/story/developing-split-view-based-apps-ipad
     Cheers, Tom

  • How do I make a Portfolio open in Details view ?

    Anytime I create a PDF Portfolio it opens in LAYOUT View in both READER and
    Acrobat (it was created in Acrobat Acrobat 9 Pro).
    How can I program the Portfolio open in DETAILS View when a user opens the file in Reader ? (or Acrobat for that matter)

    When opening the JS Console by pressing Ctrl-K,  the PREFERENCES menu opens.
    There is an option in this dialog on the left for JavaScript - but this
    isn't necessarily a JS Console. Am I in the right place ?
    With JavaScript selected on the left hand of the Preferences dialog, on the
    right are JavaScript options, one being Enable Interactive Console - so I
    selected that. There is no TRASHCAN icon as you instruct.
    I believe where you want me to go is Control-J, is that correct ?
    Assuming it is the JavaScript Debugger (Control-J_, I click trashcan, then I
    am in INSPECT: Local Variables, VIEW: Console. I enter the text as
    instructed:
    this.collection.initialView = "Details";
    Now what ? Clicking ENTER just gives me a carriage return in the Console
    window.
    Please advise.

  • I recently tried to update my iPhone 3 software via my mothers Mac book comp - during the upgrade I lost all my music and calendar dates and now the iTunes on my phone has my mothers iTunes detail - how do I get all my info back on the phone?

    I recently tried to update my iPhone 3 software via my mothers Mac book comp - during the upgrade I lost all my music and calendar dates and now the iTunes on my phone has my mothers iTunes detail - how do I get all my info back on the phone?

    Restore it using the computer you normally sync with.

  • Webapps.  How can I create a link to a page instead of showing the details-view

    I want my client to define what page a webapp shall point to in list-view, instead of showing the  details view, but I cant figure out how.  I have tried this, but it seams that tags don't work inside links:
    <a href="{tag_my_custom_link}">{tag_name}</a>
    .. does any one know how to do this?

    The problem is the format of your tag.  If your field name in the web app is "My Custom Link" then your tag is {tag_My Custom Link} (note the spaces).
    Cedric is right though, make sure the field is a textfield and not a hyperlink field in your web app.  If you use BC's new "Develop" tab up top you can navigate to your web app detail layout in /Layouts/Web Apps/<yourwebapp> and find "list.html".  Then, you can use the toolbox on the right (click the data tab) to insert tags without having to guess.  You can choose your custom field and insert the tag.

  • How to default printing to details view

    I upgraded to 10.8 and now every time I print, it defaults to the small window whereas I want the Details view of the print menus by default. 10.6 used to be in Details mode all the time; how do I make it use the Details view of printing options?

    If I click on the Show Details button in the print window on my system (10.8.4), it shows the details view in the print window.  Once I do that, the next time I print from that same application, it defaults to the details view. 
    It doesn't default to that if I try printing in a new application that I have not clicked that on though.
    When you click on Show Details in the print window and then print again from that same application, does it open with the details view?

  • How to enable detail view interactive report as default for public user?

    Hello all,
    I'm currently developing a search results page.
    I'm trying to do a nice view instead of a default table like view from the interactive reports. So in this case i enabled the detail view so i could make fancy designs.
    all worked well and looked neat but however when i pass value from my search page using IR_ROWFILTER and clear the results page using page_no,RIR, it brings me to the interactive reports result page with the default table like view.
    i have to press the detail view to get it. i tried saving it as default but it wont work. this issue is for public user.
    if i make the page requires authentication, and save the detail view as default i would not have any problem. i could search and it will straightly bring to the detail view of the search page.
    of course the other reason i found is because im using the IR_ROWFILTER and clearing page using page_no,RIR..without it,it works well but i need it coz im doing a a search result. i need to send search text from another page and put it in the filter in the search page. i would need to use RIR to clear it for searching again.
    is this a limitation for public user? it doesnt happened for authenticated user though..
    how can i make this view as default for public user?

    T101_cyberdyne wrote:
    how can i make this view as default for public user?
    Flip the report into Detail view on page load using an Page Load dynamic action with the following Execute JavaScript Code true action:
    gReport.data.view('DETAIL');
    I'm trying to do a nice view instead of a default table like view from the interactive reports. So in this case i enabled the detail view so i could make fancy designs.
    Do you really need this to be an IR? Other than the detail layout, do you require any of the interactive features? If not, try using a standard report with a custom report template.

  • How can I display pdf file details on 64-bit Windows 7 detail view?

    I'd like to display some pdf file details in order to classify them by author, title, subject... This option was simply possible for pdf file on windows xp (just by selecting the desired details on detail view when exploring folders) but it seems to be impossible for windows 7 (It's possible for other file like *.jpg, mp3...). Is there a program or a plugin to solve this problem? Thank you very much.

    It would appear, very annoyingly, that Acrobat is still lagging in the x64 department! It will, at the moment, only run as an x86 sub.....

  • How to set the display ratio of master and detail view

    Currently, I use SplitApp that contain the master and detail view. And I would like to show the master view on the left half and detail view on the right half. Is there any proper way to adjust this?
    Thank you in advance.

    You can set the width ratio by adding css. Check this,
    http://jsbin.com/dakir/1

  • HT1918 how do i remove credit card info from account

    how do i remove credit card info from acct

    On your computer's iTunes you should be able to edit your payment info by going into the Store > View Account menu option and logging into your account, and on your account's details page there should be a payment link.  If you are doing it on an iOS device (iPad, iPhone or iPod Touch) then you could try tapping on your id in Settings > Store (Settings > iTunes & App Store on iOS 6+) and selecting 'View Apple ID' on the popup - that should also give you a payments link on your account's page.
    Changing payment info : http://support.apple.com/kb/HT1918

  • How do I delete credit card info from my AppleID account profile?

    How do I delete credit card info from my AppleID account profile?

    To remove it from your account, tap on your id in Settings > iTunes & App Store and then tap on 'View Apple ID' on the popup and log into your account  - that should give you a payments link on your account's page from where you can change remove/change your payment details.
    Changing payment info : Change or remove your payment information from your iTunes Store account (Apple ID) - Apple Support
    If you don't get the 'none' option on the payment details screen : Why can’t I select None when I edit my Apple ID payment information? - Apple Support

  • Was playing game for months. Tonite, I went to play and it started me back as a new user. How do I find my player info and continue playing my origional game??

    Was playing game for months, when I turned ipad on tonite and went to continue playing, it started me as a new user. My old achievements are still in game, but can only view them as the game recognizes me as a new user. How can I retrieve my player info to continue where I left off in game?

    snozdop wrote:
    If I bought a new iPad and wanted to continue as on the old iPad, I would setup the new iPad from a backup of the old iPad, thereby transferring everything from old to new.
    Exactly, a full backup of the previous device would contain all the app workfiles that stored the current state of the game.
    I'm thinking if your kids got ahold of the iPad and decided to start with a new/fresh character, it may not be possible to go back. Given that the device is not altogether geared for multiuser usage (Apple would rather everyone got their own), many games don't support multiple users, besides those on other devices when in networked multiplayer mode.
    But hopefully they will answer and set the record straight. While you wait may want to interrogate the infractors on what they specifically did so you can provide details to the maker if they need them.
    snozdop wrote:
    Can be either iCloud or iTunes depending on where you chose to do your backups to.
    I'm not sure iCloud stores everything. Even iTunes states that iCloud "Backs up the most important data..." whereas locally there will be "A full backup..."

Maybe you are looking for