How to retrieve linked records effciently from the database

Hi,
I have some records in database related to supply chain.
e.g. N1 supplies item I1 to Node N2 is represented as N1 I1 N2.
Now I want to find all parent nodes or say chain of nodes supplying to particular node in an efficient way.
Can you please tell me how I can do it with efficient query. Currently it needs multiple queries & performance drops considerably.
Regards,
Veena

please check the link
http://wiki.oracle.com/thread/1246329/findrecentmostrowsaddedinatable?t=anon
Here you can find the new inserted data/ modified data from a table.

Similar Messages

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • How to install Pro*C apart from the database?

    I would like to know how one could Pro*C apart from the database. Thanks.

    Just unzip all Instant Client zip files in the same directory, they all have "instantclient_11_2" as first path element,
    so everything will end up in the right place in this directory.
    If your Instant Client directory has a different name, unzip the package somewhere and move all files and
    directories in it to your instant client directory.
    Yours,
    Laurenz Albe

  • How to check my job name from the database...

    I have written one job scheduler which is as follows :
    SQL> ED
    Wrote file afiedt.buf
    1 DECLARE
    2 X NUMBER;
    3 JobNumber NUMBER;
    4 BEGIN
    5 SYS.DBMS_JOB.SUBMIT
    6 (
    7 job => X
    8 ,what => 'scott.SPLITSMS;'
    9 ,next_date => SYSDATE+1/1440
    10 ,interval => 'SYSDATE+1/1440 '
    11 ,no_parse => FALSE
    12 );
    13 JobNumber := to_char(X);
    14* END;
    15 /
    PL/SQL procedure successfully completed.
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not exist
    how to check my job name from the database...
    what is the command used to check the job_name ????
    and how can i ensure that my job scheduler is running properly...???
    please help ........my dear friends.....!

    957029 wrote:
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not existYou can use DBA_* views only if the User has been Granted a DBA Privilege.
    how to check my job name from the database...
    what is the command used to check the job_name ????You can use USER_JOBS view to check. But, is it not that you have just created the Job, so you must be knowing it?
    and how can i ensure that my job scheduler is running properly...???If USER_JOBS.FAILURES is Non Zero, that means the Job has encountered a problem that needs to be Investigated. Similarly, the LAST_DATE, LAST_SEC, NEXT_DAY, NEXT_SEC can be used to determine if the Job has been running successfully.
    if you are on 11g, you should consider using DBMS_SCHEDULER.

  • How do I remove a row from the database?

    Guys and Gals,
    I'm using Studio Edition Version 11.1.1.3.0.
    The code below will delete a row from my table, but how do I actually delete the row from the database as well?
        DCBindingContainer dcbc = (DCBindingContainer)getBindings();
        DCIteratorBinding dcib = dcbc.findIteratorBinding("TipsSelectorIterator");
        dcib.removeCurrentRow();
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("Commit");
        Object result = operationBinding.execute();
        AdfFacesContext adffacesctx = AdfFacesContext.getCurrentInstance();
        adffacesctx.addPartialTarget(this.getQueryTable()); In this post, I believe Frank sums up what I should do: Remove row from af:table
    >
    The problem in your case is that this removes the row from the iterator but not your business service. EJB exposes explicit methods to remove an entity. A method lime removeEmployees(employee) >expsed on the EJB model must be called.
    You can drag and drop the "removeEmployees" method then as a button to your page. Rename the text label to "Remove" or "Delete". In the opened dialog box, point the method argument to the >following EL #{bindings.iteratorName.currentRow.dataProvider}. Next time you press the button, the row is deleted from the iterator and the business service
    Huh? So to delete the row, I need to expose a method. But where? Do I do this in the AppModuleImpl so I can expose it to the Client Interface? But then how do I access entities? And what data type is the #{bindings.iteratorName.currentRow.dataProvider}?
    If anyone could point me in a general direction, it'd be great.

    Frank and Shay,
    Thank you both for your posts. I'm amazed there's such a great place to get help. Between the forums, ADF code corner, Not Yet Documented ADF Samples, various blogs and tutorials, it's obvious you guys really care about what you do.
    On my example, that approach doesn't seem to work. I tried following it like so in one of the video tutorials by Shay: http://blogs.oracle.com/shay/2010/04/doing_two_declarative_operatio.html. Following Shay's approach, in my particular case, deletes only from the table. Perhaps it is due to my iterator / collection setup?
    TipsSelector (1 to 1) -> TipsView (1 to *)-> DependentBom -(1 to * Recursive)> RecursiveBom
    TipsSelector references the same View Object as TipsView, but it is set as a 1 to 1 relationship so that I can show TipsView on the page one record at a time. This is the same setup as Tuhra2's hierarchy veiwer example. TipsView / DependentBom is a classic parent / child setup. RecursiveBom is DependentBom referencing itself. Think of it as departments within departments within departments etc...
    I have dragged TipsSelector's Named Criteria (All Queriable Attributes) onto my page and created an ADF Query with Table. A remove button on the table's toolbar calls the two actions, Delete (from TipsSelector's iterator) and then Commit. I have modified the code slightly from my previous post but the end result seems to be the same.
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("Delete");
        operationBinding.execute();
        bindings = getBindings();
        operationBinding = bindings.getOperationBinding("Commit");
        operationBinding.execute();
        AdfFacesContext adffacesctx = AdfFacesContext.getCurrentInstance();
        adffacesctx.addPartialTarget(this.getQueryTable());Page Def file
        <action id="Commit" InstanceName="AppModuleDataControl"
                DataControl="AppModuleDataControl" RequiresUpdateModel="true"
                Action="commitTransaction"/>
        <action IterBinding="TipsSelectorIterator" id="Delete"
                InstanceName="AppModuleDataControl.TipsSelector"
                DataControl="AppModuleDataControl" RequiresUpdateModel="false"
                Action="removeCurrentRow"/>On ppr of the query table, the row is gone. However, when I press the Search button on the query again, the record reappears.
    This is beyond me. Am I somehow deleting from the query results but not the database?

  • How to delete a purchase order from the database

    I thought that I was in development machine but I was wrong., I have created a purchase order that I would like to delete from the database.
    Thanks in advance.

    >
    Amarnath Reddy Gurappa wrote:
    > Hi ,
    >
    > I would suggest you to put the deletion mark and save the PO .
    >
    > IF you really want to delete the po in the database  then go to the table ekko and
    > ekpo and delete them ,but for this you should have access to se16n and
    > &sap_edit
    PLEASE, do not recommend such, because it is a wrong approach.
    a purchase order has certainly more entries than jsut in table EKKO, and EKPO.  you can check in DB15 how many tables belong to the object MM_EKKO. If you delete jsut entries from EKKO and EKPO, then you create inconsistencies.
    SE16N and &sap_edit, is not anymore possible having current patches installed. SAP revoked this option, because people like you spread this thru the internet and this is causing security issues.
    A phyiscal deletion should only be done via archiving, this is the standard process.
    If you entered something in error, then set the deletion indicator, everybody can do mistakes, but deleting it with irregular options from the database is certainly a much bigger error.

  • How to remove only one row from the database using labview6.1

    using labview 6.1 I create a table with various rows and columns and store bulk of data's in them.,, what procedure should I follow to remove only one paticular row from the database? Help me out with an example please,,
    Thanking you in advance!

    Hi,
    If you have the database toolkit you can delete a row using just a SQL Query to "DB Tools Execute Query.VI"
    Example:
    DELETE FROM Table name Where SerialNum='Value' And Date='Value' And Time='Value'
    See also attached VI
    Best Regards
    Johan
    Attachments:
    Delete_a_row_in_a_database_table.vi ‏48 KB

  • ADF BC - How to get validation picked up from the database.

    Is there a way the ADF BC can be created so it contains the check constraints from the database?
    I assume if it did, it would pre-fill the "validation" branch in the Entity Object Editor.

    Frank,
    Thank you very much for your reply. I've set "valuePassThrough" property of the dropdownlist to true. In the valueChangeListener, my code looks like this.
    public void TD_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    System.out.println("+++++++++");
    System.out.println("TD_valueChangeListener");
    Number n = null;
    BindingContainer bc = this.getBindings();
    if(bc != null){
    System.out.println("bc is not null");
    //get the selected TD
    FacesCtrlListBinding TdIter = (FacesCtrlListBinding)bc.get("LandLegalView1Td");
    if(TdIter != null){ 
    System.out.println("TdIter is not null");
    if(valueChangeEvent.getNewValue() != null)
    try{n = new Number(valueChangeEvent.getNewValue());}
    catch(Exception e){
    e.getMessage();
    System.out.println("selected TD index="+n);
    //Object td = TdIter.getAttributeFromRow(n.intValue(), "Td");
    Object td = TdIter.getAttribute(n.intValue());
    System.out.println("real value of td=" + td);
    }else{
    System.out.println("TD is null");
    }else{
    System.out.println("TdIter is null");
    My question here is: I tried two ways of getting the real value of the new selected value. One is "Object td = TdIter.getAttributeFromRow(n.intValue(), "Td");". The other is "Object td = TdIter.getAttribute(n.intValue());". None of them give me the new selected value but the old value. Did I do anything wrong?
    Regards,
    Annie

  • How to remove links to adobe from the image viewer

    On my site I need to display lots of pictures. I used the
    image viewer flash element from the `insert`-`media` tabs.
    Everything works great, but the first few pics in the
    slideshow are clickable, and link to the adobe home page. How could
    I remove the links and make the pics not clickable. I already went
    into the flash element properties window and made the `image links`
    and `image link targets` blank. I don`t know what else to try.
    Please help!
    thank you: Tibor

    It's only necessary to post once. No answer usually means
    that nobody knows
    the answer....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "serestibi" <[email protected]> wrote in
    message
    news:frm8qo$26v$[email protected]..
    > On my site I need to display lots of pictures. I used
    the image viewer
    > flash
    > element from the `insert`-`media` tabs.
    > Everything works great, but the first few pics in the
    slideshow are
    > clickable,
    > and link to the adobe home page. How could I remove the
    links and make the
    > pics
    > not clickable. I already went into the flash element
    properties window and
    > made
    > the `image links` and `image link targets` blank. I
    don`t know what else
    > to
    > try. Please help!
    > thank you: Tibor
    >
    >

  • How to retrieve query string value from the URL in my portlet

    Hi,
    When user clicks on "Advance Search", i am redirecting to page in the community. At the same i am adding some more values to the query string (to the URL).
    My URL will look like this.
    http://ctp-mc0149/portal/server.pt?space=CommunityPage&parentname=CommunityPage&parentid=0&in_hi_userid=200&cached=true&control=SetCommunity&PageID=202&CommunityID=200&searchType=2
    Now in one of my portlet in that page, i want to retrieve the query string values from the URL.
    Please help me regarding this.
    Thanks in advance.
    Thanks,
    sreekanth.

    Hi,
    Look at the following threads,
    For programmatically getting the iview properties,
    Programmatically getting iView Properties
    Also,
    Get Properties of IView Programmatically
    Permanent change of iView property programmatically
    Hope these threads help u.
    Regards
    Srinivasan T

  • How to retrieve a statistic sample from a database table

    Hi experts,
    Let's say I have a 100.000 rows table and I want to take a representative statistical sample from that table.
    Say, it should be 5% (or 5000 rows).
    Question is: How to ensure that the sample is representative?
    This is not guaranteed by UP TO N ROWS because the database selects without having an order by  or WHERE starting reading the first db blocks until it reaches  the limit of 5000 rows.
    SELECT * UP TO 5000 rows into table .... from ZSAMPLE.
    This means I miss mostly of the records in the table, hence the sample is not representative.
    Do you ever encounter such a problem?

    You could SELECT (with package size if desired) into an internal table.  Then:
    Select * from table into internal table........
      package size 10000.  "not really necessary for 100000 row table
    *Initialize a counter of type i.
      lv_counter = 0.
    loop at the internal table.
      lv_counter = lv_counter + 1.
       if lv_counter lt 20. "1 in 20 = 5%
         delete internal table. "drop this row.
       elseif lv_counter eq 20.
         lv_counter = 0. 
    endif.
    endloop.
    endselect.  "if you used package size.
    at the end you would have kept every 1 out of every 20 records from your original table select.  Be sure to use a package size (if needed ) that is an exact multiple of 20.  To futher randomize the table, you could sort on some field that has random values, etc. before doing the every 20th record retention.

  • How to parse XML string fetched from the database

    i want to parse the XML string which is fetched from the oracle database.
    i have inserted the string in xml format in the database. The type of the field in which it is inserted is varchart2.
    I am successfully getting it using jdbc, storing it in a String.
    Now it is appended with xml version 1.0 and string is ready for parsing.
    Now i am making following programming.
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = Builder.parse(xmlString);
    Element root = doc.getDocumentElement();
    NodeList node = root.getElementsByTagName("product");
    But i am getting IOException at the statement
    Document doc = Builder.parse(xmlString);
    there fore i request u to kindly help me in solving this error.
    -regards
    pujan

    DocumentBuilder does not have a method parse with xml string as aparameter. The string should be a xml document uri.
    Convert xml string to StringReader.
    parse(new InputSource(new StringReader(xmlString)));

  • To display records fetched from the DB through ALBPM, in a custom JSP

    I want to display the records fetched from the database through ALBPM in a custom JSP as a table.
    Currently I am fetching the records and putting them in a BPM object group and sending it to the JSP as a BPM object. Now in the JSP I am trying to iterate and create a table to display the fetched data using the JSTL tag ==&gt;
    &lt;c:forEach ...... &gt;
    &lt;/c:forEach&gt;
    But I am always getting the following error in ALBPM workspace:
    The task could not be successfully executed. Reason: 'java.lang.RuntimeException: /webRoot/customJSP/CustomerSearch1.jsp(29,2) No such tag forEach var in the tag library imported with prefix c'
    Though there is a tag forEach var in the JSTL?? How to solve this error or is there any altrnative way to display the records in a JSP ??
    Thanks,
    Suman.

    Hello. I use custom JSP and it works well. You have to make sure 2 things:
    a) You have imported the libs, including these lines in your JSP:
    <%@ page session="true" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://fuego.com/jsp/ftl" prefix="f" %>
    b) The variable you are using in the "forEach" statement is stored in the BPM object you pass to the JSP in the call.
    Hope this helps.... Bye

  • How I can transfer data from the database into a variable (or array)?

    I made my application according to the example (http://corlan.org/2009/06/12/working-in-flash-builder-4-with-flex-and-php/). Everything works fine. I changed one function to query the database - add the two parameters and get the value of the table in String format. A test operation shows that all is ok. If I want to display this value in the text area, I simply drag and drop service to this element in the design mode
    (<s:TextArea x="153" y="435" id="nameText" text="{getDataMeanResult.lastResult[0].name}"  width="296" height="89"  />).
    It also works fine, just a warning and encouraged to use ArrayCollection.getItemAt().
    Now I want to send the value to a variable or array, but in both cases I get an error: TypeError: Error #1010: A term is undefined and has no properties..
    How can I pass a value from the database into a variable? Thank you.
    public var nameTemp:String;
    getDataMeanResult.token = authors.getDataMean(arrayOfNumber[0], dir_id);
    nameTemp = getDataMeanResult.lastResult[0].name;
    public var nameArray:Array = new Array();
    for (var i:uint=o; i<3; i++){
    getDataMeanResult.token = authors.getDataMean(arrayOfNumber[i], dir_id);
    nameArray[i] = getDataMeanResult.lastResult[0].name;
    And how i can use syntax highlighting in this forum?

    Astraport2012 wrote:
    I have to go back to the discussion. The above example works fine when i want to get a single value of the database. But i need to pass an array and get an array, because i want to get at once all the values for all pictures tooltips. I rewrote the proposed Matt PHP-script and it works. However, i can not display the resulting array.
    yep, it won't work for Arrays, you'll have to do something slightly more intelligent for them.
    easiest way would be to get your PHP to generate XML, then read that into something like an ArrayList on your HTTPService result event (depends what you're doing with it).
    for example, you could have the PHP generate XML such as:
    <pictures>
         <location>test1.png</location>
         <location>test2.png</location>
         <location>test3.png</location>
         <location>test4.png</location>
         <location>test5.png</location>
         <location>test6.png</location>
    </pictures>
    then you'll read that in as the ResultEvent, and perform something like this on it
    private var tempAC:ArrayList = new ArrayList
    protected function getStuff_resultHandler(event:ResultEvent):void
        for each(var item:Object in event.result.pictures)
           var temp:String = (item.@location).toString();
           tempAC.addItem(temp);
    in my example on cookies
    http://www.mattlefevre.com/viewExample.php?tut=flash4PHP&proj=Using%20Cookies
    you'll see an example of how to format an XML structure containing multiple values:
    if($_COOKIE["firstName"])
            print "<stored>true</stored>";
            print "<userInfo>
                    <firstName>".$_COOKIE["firstName"]."</firstName>
                    <lastName>".$_COOKIE["lastName"]."</lastName>
                    <userAge>".$_COOKIE["userAge"]."</userAge>
                    <gender>".$_COOKIE["gender"]."</gender>
                   </userInfo>";
        else
            print "<stored>false</stored>";
    which i handle like so
    if(event.result.stored == true)
                        entryPanel.title = "Welcome back " + event.result.userInfo.firstName + " " + event.result.userInfo.lastName;
                        firstName.text = event.result.userInfo.firstName;
                        lastName.text = event.result.userInfo.lastName;
                        userAge.value = event.result.userInfo.userAge;
                        userGender.selectedIndex = event.result.userInfo.gender;
    depends on what type of Array you're after
    from the sounds of it (with the mention of picture tooltips) you're trying to create a gallery with an image, and a tooltip.
    so i'd probably adopt something like
    <picture>
         <location>example1.png</location>
         <tooltip>tooltip for picture #1</tooltip>
    </picture>
    <picture>
         <location>example2.png</location>
         <tooltip>tooltip for picture #2</tooltip>
    </picture>
    <picture>
         <location>example3.png</location>
         <tooltip>tooltip for picture #3</tooltip>
    </picture>
    etc...
    or
    <picture location="example1.png" tooltip="tooltip for picture #1"/>
    <picture location="example2.png" tooltip="tooltip for picture #2"/>
    <picture location="example3.png" tooltip="tooltip for picture #3"/>
    etc...

  • Re: send message from the database trigger(URGENT)

    Hi,
    I am using forms 6.0 and oracle 8.0. My question is I am calling a stored procedure in the BEFORE UPDATE TRIGGER on database. This trigger will be fired and update another table(table B) when user update any record in the forms based on different table (table A).
    I want to pass the message to the forms from the database trigger when records gets updated in the database e.g. (10 records are updated). Since I am not calling my database procedure from the forms, rather it is being called from the database trigger, How can i display message to the forms.
    Thanks all your help in advance.

    Thanks Parker for ur reply but that subprogram raise_application_error only works if there is an error in the store procedure. But in my case there is no error, I just need to pass a message saying that e.g. "12 rows updated". How can I pass this message from the database trigger to the forms application.
    Thanks

Maybe you are looking for

  • Are there any plans to fix Apple ID's? Please don't answer unless you work for Apple.

    The only reason I have 2 apple IDs is poor planning by Apple. Mobile Me users were assigned a me.com ID, despite the fact that I already had an Apple ID. Now the me.com ID has followed me to iCloud and I can't get rid of it. When I set up iCloud I at

  • Widget madness?

    hi, still learning how to use my new ibook, and been downloading widgets, but there are two in particular that when i download one, it deletes another and replaces it with that one. i thought maybe it was a space issue, so deleted some widgets didnt

  • FRM-41072 - Cannot create Group GRP_NAME

    In the layout I'm trying to populate Grp_name column values from GRP_TAB table, in the 'GRP_NAME' item list. This is the code I had written. But when I run the Form, I'm getting 'FRM-41072 - Cannot create Group GRP_NAME'error. What could be the error

  • When I startup, the sound is automatically mute, When I startup, the sound is automatically mute

    I have the latest version of OS X, but since I upgraded, when I start-up my computer, the sound is automatically muted and I don't know why.  Any ideas? Thank you.

  • Create a BI client in SM7.0

    To implement the E2E monitoring on SM, we need to create a BI client.  1) How to create a BI client on SM? 2) We have a client100 which is used for CHARM.  Can we use the same client for E2E? Thanks a lot!