ORDER SIBLINGS not working in Forms

This code run fine in Toad BUT giving me error in forms.
SELECT
       LEVEL                           LOC_NAME,
       LOCATION_NAME                   LOC_ID,
       LOCATION_ID                     HLOC_ID,
       HEAD_LOC_ID MUDRA
  FROM AS_LOCATION_HDR
CONNECT BY PRIOR LOCATION_ID = HEAD_LOC_ID
START WITH HEAD_LOC_ID is null
ORDER SIBLINGS BY LOC_IDThe error is:
"Encountered sysbol "SIBLINGS" when expecting one of the following:
by
The symbol "by inserted before the "SIBLINGS" to continue.Is the SIBLINGS keyword not acepted in forms? What would be the alternative?
I am using oracle forms 10G (10.1.2.0.2)

hi
Oracle's START WITH and CONNECT BY clauses in the
SELECT statement automatically traverse a hierarchy.
Without this feature, a complex self-join would be required to identify
which rows are logically related to others.
The START WITH clause identifies the row or rows to be considered
the starting points, or "roots," of the hierarchy.
The CONNECT BY PRIOR clause
then indicates how to identify which rows are related to each other.
example, the query in Listing A produces a "Reports To" listing from the EMPLOYEES table in the HR sample schema provided by Oracle.
The LEVEL pseudocolumn indicates how deeply the report is currently nested; here,
I use it to LPAD the employee names to indent them.
The START WITH condition states that only employees 101 and 102 are to be considered as starting points.
The CONNECT BY PRIOR clause then links the employee_id
column in one row to the manager_id column in the next, to indicate who reports to whom.
If you run this query in the HR schema,
you'll notice that the last names are not sorted within the listing for a specific manager;
they are listed in the order Oracle encountered them in processing the hierarchy.
If you want the subordinates in alphabetical order,
you might try to ORDER BY the original last_name column.
However, this would break up the hierarchy, and turn it back into a flat list of names.
You might also try to ORDER BY the pseudocolumn LEVEL first,
which tells how deep a specific row is in the hierarchy. This, too,
breaks up the hierarchy—all the managers will be listed first, followed by people who report to any of them.
In Oracle 10g (both releases),
it's now easy to do this: You can use the new SIBLINGS keyword to create the correct ordering. The syntax is:
ORDER SIBLINGS BY <expression>So adding the clause:
ORDER SIBLINGS BY last_nameto the end of the query will preserve
the hierarchy and also alphabetize the last names within each level.
Note that the original last_name was used not the alias "Reports To."
The extra space padding in "Reports To" would affect the sort, so the original must be used.
Listing B shows the output, both before and after adding ORDER SIBLINGS BY.
The ORDER SIBLINGS BY clause is valid only in a hierarchical query. The optional SIBLINGS keyword specifies an order that first sorts the parent rows, and then sorts the child rows of each parent for every level within the hierarchy.
Rows that have duplicate lists of values in the columns specified after the SIBLINGS BY keywords are arbitrarily ordered among the rows with the same list of values and the same parent. If a hierarchical query includes the ORDER BY clause without the SIBLINGS keyword, rows are ordered according to the sort specifications that follow the ORDER BY keywords. Neither the ORDER BY clause nor the ORDER SIBLINGS BY option to the ORDER BY clause is required in hierarchical queries.
The hierarchical query in the following example returns the subset of rows in the hierarchical data set whose root is Goyal, as listed in the topic Hierarchical Clause. This query includes the ORDER SIBLINGS BY clause to sort by name the employees who report to the same manager:
SELECT empid, name, mgrid, LEVEL
   FROM employee
      START WITH name = 'Goyal'
      CONNECT BY PRIOR empid = mgrid
   ORDER SIBLINGS BY name;The rows returned by this query are sorted in the following order:
         empid name             mgrid       level
         16 Goyal               17           1
         12 Henry               16           2
          7 O'Neil              12           3
          9 Shoeman             12           3
          8 Smith               12           3
         14 Scott               16           2
         11 Zander              16           2
          6 Barnes              11           3
          5 McKeough            11           3
9 row(s) retrieved.Here the START WITH clause returned the Goyal row at the root of this hierarchy. Two subsequent CONNECT BY steps (marked as 2 and 3 in the level pseudocolumn) returned three sets of sibling rows:
Henry, Scott, and Zander are siblings whose parent is Goyal;
O'Neil, Shoeman, and Smith are siblings whose parent is Henry;
Barnes and McKeough are siblings whose parent is Zander.
The next CONNECT BY step returned no rows, because the rows for which level = 3 are leaf nodes within this hierarchy. At this point in the execution of the query, the ORDER SIBLINGS BY clause was applied to the result set, sorting the rows in the order shown above.
Because the sort key, name, is a VARCHAR column, the returned rows within each set of siblings are in the ASCII order of their employee.name values. Only the sets of siblings that are leaf nodes in the hierarchy of returned rows appear consecutively in the sorted result set, because the managers are immediately followed by the employees who report to them, rather than by their siblings. An exception in this example is Scott, whose child nodes form an empty set.
The SIBLINGS keyword in the ORDER BY clause is an extension to the ISO standard syntax for the SQL language. The SELECT statement fails with an error if you include the SIBLINGS keyword in the ORDER BY clause of a query or subquery that does not include a valid CONNECT BY clause. hope this helps u.
sarah

Similar Messages

  • SQL Code not working in Forms Developer?

    Hi all,
    I'm using Oracle 10g and I have th following code running on iSQL+ but not working on Forms and I got the following erro
    The SQL code:
         select returningreason
            from (
                     select returningreason,
                     dense_rank() over (partition by 1 order by count(*) desc) as drnk
                     from returned_goods
                     group by returningreason)
           where drnk = 1;And the error happens near the word over to the right and the error statement is:
    Error 103 at line 18, column 19
       Encountered the symbol "(" when expecting one of the following:
             , formThanks in advance :)

    Triggers are compiled in forms so need to use only the features available to forms, which doesn't include all the new stuff in the database.
    select over partition
    NVL2They don't work in forms and reports too.
    Also if you use them in record Group
    Forms/SQL Compiler was not lined up to the database(10G).
    Meanwhile,for example. Pipelined TABLE and relative Select work in Reports AND Forms.

  • Ole2 commands not working in forms 10g

    OLE2.set_property(Application, 'Visible', true);
    above statement not working in forms 10g;

    Try to use the OLE2 fuction from WEBUTIL library. There is function in webutil CLIENT_OLE2.
    -Ammad

  • Layout Options - Page Order Does Not Work Correctly

    I have a Photosmart C7280 All-in-One printer.  The Layout Option - Page Order does not work as expected.  The User Guide (page 95) states that the default for a multiple page document is to print first page first.  The manual states that to print last page first requires one to change the Page Order to "Back to Front".  For my Excel, Word, Internet Explorer and PDF pages, I need to leave the Page Order as "Front to Back" if I want the last page to print first.  This makes no sense.  In addition, I can't get my Quicken reports to print last page first no matter what I try.  Does anyone no why the Page Order does not work as expected for Excel, Word, IE and PDF, and does not work at all for Quicken?

    Keisha,
    If you uncheck the "show" option, then the corresponding HTML for that item is not rendered on the page. Thus, when you try to inspect that item via APEX_APPLICATION.G_F02, it simply doesn't exist.
    One trick that I use when I want to have hidden items on the page, but not make them take up any space, is to concatenate them to items that will be visible.
    Using your query as an example, I would re-write it like this:
    SELECT APEX_ITEM.CHECKBOX(1,ROWNUM,'CHECKED')ATTENDED,
    APEX_ITEM.HIDDEN(2,C.PARTY_ID)
      || APEX_ITEM.HIDDEN(3,C.PARTY_TYPE_CODE)
      || C.PARTY_TYPE_CODE PARTY_TYPE_CODE,
    S.PERSON_ID,
    S.PERSON_FIRST_NAME AS NAME,
    C.PARTY_CASE_ID
    FROM CASE.PARTY C
    INNER JOIN DN.PERSON S
    ON C.PARTY_ID = S.PERSON_ID
    WHERE C.PARTY_CASE_ID = :P18_CDBCASE_ID
    AND C.PARTY_SEQ_NO = :P18_SEQThus, the second APEX report column will contain the HTML for the hidden items PARTY_ID & PARTY_TYPE_CODE, as well as the value for PARTY_TYPE_CODE. When you submit the page, you should not encounter any issues.
    Thanks,
    - Scott -
    http://sumnertechnologies.com/
    http://spendolini.blogspot.com/

  • Help, my tab order will not work? Tried to troubleshoot, no luck!

    I created a form used the manual tab order and it would not work. I adjusted the hierarchy and erased all the traversal's in the XML. The tabbing order is now automatic but still out of order pretty badly. Can someone please guide me in the right direction. I really want this form to be over with.

    Hope you considered following point.....When you set the Tab order you set the order starting 1 to n with in each subform. Setting taborder across the subforms is not an option at least in LC 7 and 8. However there is workaround for this, using setFocus() method.... look more in the help.
    Example: xfa.host.setFocus("xfa.form.form1.TextField1");
    If you still have difficulty attach a copy of your template and explain in detail what you try to do.

  • Help is not working in Form Builder 6i

    Hi all,
    I'm using Forms builder 6i in Windows7 system. When i go to Help menu and click 'Form Builder Help Topics' a error message is coming.
    I've reinstalled it many times. In Windows XP system it's working fine. Why it's not working in Windows7?
    Any suggestions??

    Check this:
    http://support.microsoft.com/kb/917607
    Regards

  • TABLE_FROM_BLOCK is not working in forms 10g ??????

    Hi all,
    How to use TABLE_FROM_BLOCK in forms 10g. its working in forms 6i .
    the same form is not working in 10g . i got this error.
    frm-40933 Cannot populate table because datatype is incorrect.
    pls help me
    Regards
    Gopinath M

    According to Metalink's Developer 2.1 Release Notes (Doc ID #90090.1), section 4.2.1, "TABLE_FROM_BLOCK Built-In":
    DO NOT use the TABLE_FROM_BLOCK built-in described in the
    documentation. It is reserved for internal use only. No support
    for this built-in will be provided under any circumstances.
    If you used this built-in, you will need to recode your from(s) for 10g.
    Message was edited by:
    Mark Roberts

  • Button based on data is not working in form/ report / region

    create or replace procedure "BUT2"
    is
    begin
    declare
    cursor c1 is select plot_id,plot_status from re_plot;
    tno number;
    v1 varchar2(500);
    c2 c1%rowtype;
    begin
    open c1;
    loop
    tno := nvl(tno,0) + 1;
    fetch c1 into c2;
    exit when c1%notfound;
    if c2.plot_status='BLOCKED' then
    v1 := v1 || ' ' ||'<input inline type =submit style="color:BLUE;background-color:RED" value='||c2.plot_id||'>';
    else
    v1 := v1 || ' ' ||'<input inline type =submit style="color:ORANGE;background-color:GREEN" value='||c2.plot_id||'>';
    end if;
    if mod(tno, 4)= 0 then
    --v1 := v1 || '<br/>' || ' ';
    htp.p(v1);
    v1 := null;
    end if;
    end loop;
    close c1;
    htp.p(v1);
    end;
    end;this above procedure works fine in SQL Command browser. I am unable to make it as page form / report.
    My requirement is i want to bring this images in form / report. Based on click button, the value need to be parsed to other page?
    how to do it?
    yours
    andi_raj

    is not working Insufficient information. In what way is it "not working"? The page doesn't render as required? There's an error message? The browser crashes? The server room has been trampled into dust by a herd of buffalo?
    >
    I am unable to make it as page form / report.
    v1 := v1 || ' ' ||'<input inline type =submit style="color:BLUE;background-color:RED" value='||c2.plot_id||'>';
    ...It is not possible to generate form elements in an APEX page in this way. The [APEX_ITEM API|http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/apex_item.htm#CACEEEJE] is the only way to create APEX items in PL/SQL. However it contains no procedures to generate button items, so an alternative design is required in this case, e.g. a report with links.
    (Also what is the intention of "inline" in the above code? [There is no *inline* attribute|http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#h-17.4].)

  • Target Load order is not working properly in 11.2.0.2

    Hi,
    Mappings whihc are migrated from OWB10.2 version to 11.2 which contains multiple targets are not working in accordance with the target load order given in the mapping.
    The order in which targets are loaded changes between execution.
    To test is this a problem with migration we had created a smaple mapping containg 3 targets and mentioned loading order in each target table as well as in mapping property.
    The order in which the targets are loaded was random. But when we have 2 targets it seems to be working. But for migrated maps this is also not working.
    Is there any bug reported in 11.2.0.2 for this issue? Any help is highly appreciated.
    Thanks and Regards,
    Pnreddy

    Target load ordering is set to false by default in 11.2.
    You need to set it to true if you want your mapping to use it.

  • F7 & F8 key is not working in forms 10g

    Dear all,
    I am working with oracle application version 10.1.2.3.0, installed on windows server 2003 and database 10gR2 on windows server 2008. When i open any form and tries F8 / F7 to executed & enter
    query, its not working. But its owrking with with F11 and shitp + F11. I want to use F7 & F8 for enter/execute the query. I have same another same environment with same configuration, there F7
    & F8 is working fine. To enable these keys i rename fmrpcweb.res to fmrweb.res. But guide me with your sincere suggessions & experience.
    Regards,
    Ahmed.

    According to Metalink's Developer 2.1 Release Notes (Doc ID #90090.1), section 4.2.1, "TABLE_FROM_BLOCK Built-In":
    DO NOT use the TABLE_FROM_BLOCK built-in described in the
    documentation. It is reserved for internal use only. No support
    for this built-in will be provided under any circumstances.
    If you used this built-in, you will need to recode your from(s) for 10g.
    Message was edited by:
    Mark Roberts

  • Enter key not working in forms 10g

    Hi guys,
    Enter key to select a form is not working
    on my application.
    I have to double click the form to open it using the mouse.
    Then if we try to exit we have to press exit that many number of times as we have pressed enter key.
    So it seems to be storing the key processes.
    We are using forms 10g.
    Please help.
    Thanks and Regards,
    Rohan

    Fixed.
    Changed KB.
    However, this is still strange as the old KB was working fine in other applications.

  • New settlement parameters  in   sales order  does not  work

    Hi
    I have a    sales order for  service material.    It is invoiced.    I  have to settle it.    The  existing  settlement rule  is  wrong. So  I have created a new allocation structure and   changed   settlement  parameter  in     the  sales order.   I save the  sales order.
    But in VA88 the settlement does not work. I get error message ' receiver cost element not defined and thet cat. PSG not defined.'
    But the same allocation structure work good for new sales order.
    Pl advise how  I  can  do the settlement for  old   sales orders,  subsequently changed for  settlement parameter ie allocation structure. 
    Thanks
    kamala

    Hello Kamala
    Not an expert on this subject, but here is what I suggest, Try and see if it works.
    1) Firstly retract the changes you did in sales order and settle first with the wrong settlement parameter (Old data).
    2) Now change the existing allocation structure, don't create NEW ONE. If you change an allocation structure, the changes only affect future settlements.
    3) Then reverse the settlement.
    4) Now re-do the settlement.
    Let me know how it goes. Take care.

  • SQL (Reverse) not working in Forms 6i

    Hi:
    Env 6i c/s 8i DB.
    SELECT REVERSE ( '321' ) FROM DUAL works in SQL*Plus but does not accept the REVERSE function from within a Trigger. I could put the logic in a Package on the DB but I'd like to know why it does not work in F6i ?
    Thanks
    N.

    Forms 6i uses an older version of PL/SQL than the database, so it does not recognize the newly introduced function. You will need to create a database function to call from the form.

  • MAXIMIZE WINDOW DOES NOT WORK IN FORMS 9i

    Hi,
    I am performing forms conversion and developing new forms in Forms 9i. The problem I am running into is that :
    the SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW, WINDOW_STATE, MAXIMIZE)
    and SET_WINDOW_PROPERTY(ROOT_WINDOW, WINDOW_STATE, MAXIMIZE)
    in the When_new_form_instance trigger don't work.
    I've also tried adding a parameter to initiate the running mode as WEB as suggested in a response that I saw on this
    forum, with that parameter I would set the ROOT_WINDOW State to NORMAL
    then set WIDHT=800, HEIGHT=600, POSITION=0, 24.........
    but it still does not work. When I run the form, the browser opens up as a full screen, but the form only fills up the gray rectangular
    area when the Jiniator is running and loading the applet.
    If I don't set the Maximize property of the main window to Yes then the vertical and horizontal scroll bars are automatically added,
    if I do set so then no scroll bar is added and the form is cut off.
    Is it a known problem ? and is there a solution to it?
    Any response is greatly appreciated.
    Thanks.
    TLe

    Thanks, it worked, and I've been playing with other parameters, such as replacing the lookandfeel (this works), but splashscreen and background don't when I specified the .GIF file name, it did not display the GIF image.
    Thanks again.

  • Sort Order Column not Working

    I have set a sort order column on one of A VARCHAR field, but the functionality is not working. The sorting is enabled in the table view and when I sort by the said column it still sorts based on the VARCHAR values of the column instead of the other INT column I want to sort by. The logical SQL and physical query never even includes the column to sort. Are there any exceptions for the 'Sort Order Column' setting? Is there a config setting or data connections setting that I need to check to make this work?
    Thank You!
    Edited by: VNC on Oct 3, 2011 9:08 AM

    hi,
    can you give me more detailes like some sample column data like below kind
    Like Ex: varchar month column it sould display based on month id
    month : Fev-2011,Dec-2011,jan-2011 and month id 1 to 12
    set your month id as sort order column of month name.
    double click month name ->In general tab set the sort order column as month id
    FYI...see the sample link
    http://www.biconsultinggroup.com/obiee-tips-and-tricks/setting-a-sort-order-column.html
    i hope helped you
    THanks
    Deva
    Edited by: Devarasu on Oct 4, 2011 12:39 AM

Maybe you are looking for

  • Assign chart of dep with company code

    Hi All SAP Guru, I want to Assign new chart of dep in company code. When i assign the system is not allow. It is not showing white color field.  Please advice how can i assign the new COD. Regards, Pankaj

  • Songs not showing up under artists on my ipod.

    Trying to update my ipod but the new artists are not showing up under "artists". They only appear under "Albums". What can I do to fix this??

  • Need an example to add an Invoice via DIAPI

    Hi, I'm trying to add an invoice, but the Totals aren't calculated right. probably due to the fact that I'm missing something or there's something I dont know My invoice is added but when I look at the totals, it doesn't make sence Document.DocTotal

  • Solaris 8 (x86) on IBM xSeries 330

    Hi, has anybody experienced to run Solaris 8 on an IBM xSeries 330? Is there any device driver for IBM ServeRAID 4L controllers under Solaris 8? regards, Oliver

  • MX922 -Problem opening scanned photos saved as jpgs

    When I scan a photo, the image is saved as jpg but cannot be opened by Preview or iPhoto. Message: "file is damaged or is in an unrecognizable format." I scan from my pc, as the printer "defaults" to "set the pc to start scanning." The file extension