Doubt's regarding the Hierarchial Queries in Oracle

Hi,
i have a doubt regarding the Hierarchial Queries in Oracle.
SELECT * FROM TMP_TEST;
ID     NUMVAL     STRVAL
1     100     Hello
1     -100     World
2     1     Concatenate
2     2     In String
2     3     using Connect By
2     4     Using SYS_CONNECT_BY_PATH
i am clear with my execution of IN_Line view (mechanism how it work's) .
But i have also read about the Hierarchial queries in the Oracle product documentation's. i am also aware of the
SYS_CONNECT_BY_PATH , LEVEL & START WITH , CONNECT BY Keywords.
But i couldnot able to Manually work out as how this below Query works.
Can you please explain me how this Hieracial query works ?
SELECT ID, (SYS_CONNECT_BY_PATH(STRVAL,',')),LEVEL
FROM
SELECT ID,STRVAL,ROW_NUMBER() OVER(PARTITION BY ID ORDER BY ID) RNUM,
COUNT(*) OVER(PARTITION BY ID ORDER BY ID) CNT,NUMVAL
FROM TMP_TEST
START WITH RNUM = 1
CONNECT BY PRIOR RNUM = RNUM - 1
Many Thanks,
Rajesh.

Hi, Rajesh,
My first message was in response to your first message.
In your latest message, the query is:
SELECT  ID, (SYS_CONNECT_BY_PATH(STRVAL,',')),LEVEL
FROM    (
        SELECT  ID,STRVAL,ROW_NUMBER() OVER(PARTITION BY ID ORDER BY ID) RNUM,
                COUNT(*) OVER(PARTITION BY ID ORDER BY ID) CNT,NUMVAL
        FROM TMP_TEST
WHERE   RNUM = CNT
START WITH  RNUM = 1
CONNECT BY  PRIOR RNUM = RNUM - 1;It looks like you lost the second CONNECT BY condition:
AND PRIOR ID = IDPut it back: it's important.
Now you're confused about the output row:
2    ,Hello,World,using Connect By,Using SYS_CONNECT_BY_PATH   4It doesn't seem to correspond to anything results that you got when you ran the sub-query alone.
That's because the resutls from your sub-query may change every time you run it, even though the data doesn't change. The ORDER BY clauses in both of the analytic functions do not result in a complete ordering. In fact, they're completely meaningless. It never makes any sense to PARTITON BY and ORDER BY the same value; "PARTITION BY id" means that only rows with the same id will be compared to each other; you might as well say "ORDER BY 0" or "ORDER BY dmbs_random.value".
The ORDER BY clause of ROW_NUMBER whould reflect that way in which you want the results to appear within each id, for example:
ROW_NUMBER () OVER (PARTITION BY id ORDER BY UPPER (strval))Note that this is very similar to what was in my first reply.
In the COUNT function, why do you want an ORDER BY clause at all? Just say:
COUNT (*) OVER (PARTITION BY id)

Similar Messages

  • Regarding the timestamp usage in oracle 11g

    Hi All,
    I am using the following query in 11g.
    SELECT DISTINCT TO_DATE(SHIP_DTTM,'mm/dd/yyyy') FROM PS_IN_DEMAND WHERE SHIP_DTTM BETWEEN TO_DATE(fromdate,'mm/dd/yyyy') AND TO_DATE(todate,'mm/dd/yyyy')
    The error i am getting is
    System.Data.Odbc.OdbcException: ERROR [22007] [Microsoft][ODBC driver for Oracle][Oracle]ORA-01858: a non-numeric character was found where a numeric was expected
    at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
    at System.Data.Odbc.OdbcDataReader.Read()
    at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
    at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
    at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
    After my analysys i am getting the problem with the column SHIP_DTTM column and its datatype is Timestamp.
    Please help me out in resolving this issue.
    Thanks in advance

    Hi,
    This is an Oracle Database specific error, ORA-01858.
    You posted on the wrong forum, this is the Berkeley DB (Core) forum.
    Your question should probably be best posted on General Database Discussions.
    Regards,
    Andrei

  • Urgent help!!!!!!Regarding the Credit Memo for oracle project customer invoices

    Hi,
    Can somebody help me in this issue
    we have a requirement from the users that they dont want the system to apply
    the credit memo automatically on the invoice when it released from the projects
    Scenario1: Invoice already been paid now they want to create a credit memo,
    system dont allow them to cancel the invoice the only way as per the theory is
    create a negative invoice and adjust it but the issue here is when ever you
    create a negative invoice it creates as invoice not credit memo which will be
    confusing to the users.
    in this case can we use billing extension to create the transaction type as
    credit memo when ever the invoice has negative amount?
    Or let me know if there is a way to perform this step?
    Scenario2: Invoice is created but they dont want to create a credit memo
    against that invoice since it gets applied automatically, the customer
    requirment will be they want to apply the credit memo for any future invoices
    as requested
    Is there a wya to have a credit memo created with out auto applying to an
    invoice, so that user can apply when ever they want
    what is credit memo on accoutn how it works with these above scenarios.
    sicne i tried setting up but the credit meo or concession is getting appled to
    the particular invoice automatically
    need urgent help required on this issue !!!!!
    Regards
    Lavanya

    Hi,
    For Scenario 1 you have two options:
    1) Update the AR transaction type extension for project invoice- Identify negative amount invoice and change the transaction type to project credit memo. This will update the transaction type on negative invoices before they are interfaced to Oracle AR.
    This is preferred option
    2) Update AR invoice Pre-processor to do the same thing.
    There is no standard setup which will allow you to change trx type of negative invoices.
    For Scenario2 - I dont think there is any direct way to create a credit invoice from Projects and keep it unapplied (again, apart from creating a negative amount invoice). You can create a credit memo in AR and use it to apply against future invoices.
    Regards
    Kaushal

  • Help regarding the calling of a oracle function from the OTL.

    Hi,
    I created a Oracle function like get_employee_id() which will return the employee id if the name and department exists.
    If not exists it will insert the record and return the emp_id.
    get_employee_id(name,department)
    if name and department exists id will be returned
    else record will be inserted and emp id will be returned.
    emp_id is a sequence which will be triggered to auto increment.
    Problem is::
    Not getting a correct way to access get_employee_id() from OTL interface.
    I am trying like
    query << "BEGIN :3<int> := get_employee_id(:1<char[128]>,:2<char[1024]>); END;" ;
    otl_stream oos(1, query.str().c_str(), db());
    oos << emp_name ;
    oos << emp_dept ;
    while(true){
    oos >> emp_id ;
    if(!oos) break ;
    Please let me know what is the correct way of accessing this.Thanks for the help in advance.

    Sorry, I posted this on another forum. C++ Call Interface (OCCI)
    Thanks,
    Jagdish.

  • What is the role of PRIOR in hierarchial queries

    hi all,
    what is the role of prior operator in CONNECT BY Clause of the hierarchial queries, what is the effect when it is used on the right side or left side of the condition ? almost all the queries contains this clause, if it is omitted the child values are not coming. what is the reason. plz explain.
    please check the following outputs:
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by empno = mgr;
    ENAME HIERARCHY
    KING \KING
    Elapsed: 00:00:00.04
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by prior empno = mgr;
    ENAME HIERARCHY
    KING \KING
    JONES \KING\JONES
    SCOTT \KING\JONES\SCOTT
    ADAMS \KING\JONES\SCOTT\ADAMS
    FORD \KING\JONES\FORD
    SMITH \KING\JONES\FORD\SMITH
    BLAKE \KING\BLAKE
    ALLEN \KING\BLAKE\ALLEN
    WARD \KING\BLAKE\WARD
    MARTIN \KING\BLAKE\MARTIN
    TURNER \KING\BLAKE\TURNER
    JAMES \KING\BLAKE\JAMES
    CLARK \KING\CLARK
    MILLER \KING\CLARK\MILLER
    14 rows selected.
    Elapsed: 00:00:00.09
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by empno = prior mgr;
    ENAME HIERARCHY
    KING \KING
    Elapsed: 00:00:00.06
    SQL>
    thanks and regards,
    sri ram.

    Hi, Sri Ram,
    Sri Ram wrote:
    hi all,
    what is the role of prior operator in CONNECT BY Clause of the hierarchial queries, "PRIOR x" means a value of x from one of the rows that were added to the result set at the previous level.
    what is the effect when it is used on the right side or left side of the condition ? There is no difference between
    CONNECT BY  PRIOR  x  = yand
    CONNECT BY  y  = PRIOR  xjust like there is no difference between
    WHERE  x  = yand
    WHERE  y  = x
    almost all the queries contains this clause, No, most queries do not contain a CONNECT BY clause.
    Most queries that have a CONNECT BY clause do use a PRIOR operator.
    if it is omitted the child values are not coming. what is the reason. plz explain.No, that's not true. A common example is a Counter Table :
    SELECT  SYSDATE + LEVEL - 1
    FROM    dual
    CONNECT BY  LEVEL  <= 7;
    please check the following outputs:
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by empno = mgr;
    ENAME HIERARCHY
    KING \KING
    Elapsed: 00:00:00.04
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by prior empno = mgr;
    ENAME HIERARCHY
    KING \KING
    JONES \KING\JONES
    SCOTT \KING\JONES\SCOTT
    ADAMS \KING\JONES\SCOTT\ADAMS
    FORD \KING\JONES\FORD
    SMITH \KING\JONES\FORD\SMITH
    BLAKE \KING\BLAKE
    ALLEN \KING\BLAKE\ALLEN
    WARD \KING\BLAKE\WARD
    MARTIN \KING\BLAKE\MARTIN
    TURNER \KING\BLAKE\TURNER
    JAMES \KING\BLAKE\JAMES
    CLARK \KING\CLARK
    MILLER \KING\CLARK\MILLER
    14 rows selected.
    Elapsed: 00:00:00.09
    SQL> select ename,sys_connect_by_path(ename,'\') hierarchy from emp start with ename='KING' connect by empno = prior mgr;
    ENAME HIERARCHY
    KING \KINGOkay, I checked them. I get the same results. Did you have a question about them?

  • Regarding the ipv6 address handling in oracle pl/sql

    Hi,
    This is regarding the ipv6 address handling in pl/sql.
    Can we use any c program inside the oracle as C/C++ provides more buitl in function for address handling.
    Are there are any similar functions in pl/sql.
    Kindly let me knoe if there is a way to calculate ipaddress masking.
    Are there any system functions in oracle similar to inet_ntop/inet_pton to validate ipv6 addresses.
    If not kindly let me know if there is any alternate way.
    Thanks and Regards,
    Anantha.

    Billy  Verreynne  wrote:
    Sven, he means converting a numeric network address to a presentation (character) address - and vice versa.Ok I understand. Validating for me had been either
    a) validate that the IP address does really exist. This could have been implemented by executing some kind of ping command.
    or
    b) validate that the string that hold the human readable IPv6 address is correct same a as string like "[email protected]" looks like a valid email address. This of cause would be implemented with some kind of regexp expression.
    However it seems he wants a conversion of the string (human readable ipv6) into a machine readable (hex) representation. Not sure why this is needed, But I agree that simply reusing the OS C routines seems to be the best way to do it.
    I strongly doubt that the result is very useful in Pl/sql. So the big question (as so often) would be what is the business case behind this requirement. Maybe some part of the logic needs to be implemented outside the database anyways. Then it could be useful to add this conversion to this outside part as well.

  • A few queries regarding the beauty that is Nokia 5...

    I got this beautiful lil machine a lil over a week back. It looks lovely, and sounds even better. And even though, being a student/intern, it cost me more than my monthly salary, I am mighty pleased I got it. And despite the opposition before, it's a great hit, both at home and work. 
    Just a few queries regarding the usage from my experience so far, the answers to which I could not find in this forum and a few other review sites. [Apologies if I'd missed something.]
     1- First, the battery. It only lasts for a little over a day on full charge. From what I'd heard and read, it looked like it should last quite a bit a more, atleast 2 full days. The phone even hung up a couple of times, while recording/playing video. Upon which I had to remove and reinsert the battery. How seriously wrong is this ?
    2- How do you forcefully exit an application, if need be ? It suggests in the guide, and from the reviews I read, there's supposed to be an exit and a start button with the applications when you bring up the task manager. Where're they?
    3- There's this option where you can insert a Slideshow as your Wallpaper. But when I go to it, select the desired images, [ Tried various random images, yes ]it only shows Options and Back button, when select Back, it just goes, well, back. Nothing really happens to the wallpaper. How does that work ?
    4- This might seem like a petty issue, but it can be pretty annoying. Once you go to Options and tell it you are marking, e.g. in the Inbox or the File Manager, how do you mark multiple items, WITHOUT having to go to Options >Mark >Mark/Unmark for each item ? What's the point of having a seperate Marking option in the first place then, when I could just Move or Delete each item seperately anyway. 
    5- And last, any news on a free full version of a document viewer ? From what I looked up, it costs around US$70, which is about a quarter of the phone's purchase price itself. And that's not a modest sum, that too for a basic application such as this, for a anyone with my status.
    Just so any prospective buyer or amateur user such as myself doesn't get scared off by the seemingly long list of inquiries, the phone's an absolute pleasure to use. Specially, for someone with their first Touchscreen/Symbian experience. I got this phone after a LOT of research, both online and in the field. And it's bloody well worth it so far. 
    I know, it's a huge post, but you'd have my utmost gratitude for an accurately detailed response. Thankyou. =)
    Solved!
    Go to Solution.

    Why of course. Something happening to your phone during the process would brick it, not to mention that the attempt would install something in your phone that voids the warranty, meaning that you just made yourself a very expensive paperweight. ^_^. We're not really allowed to talk about it, other than the fact that with the above possibility, I strongly advise you not to do so. There is a way to do it without hacking it. I know of people who have managed to do it without hacking, but it was on the 5800. Hmm, ok, maybe they'll work for you too though.
    http://forum.dailymobile.se/index.php/topic,4254.0.html 
    If you find my post helpful please click the green star on the left under the avatar. Thanks.

  • Have some doubt regarding the  weblog (Lookup's in XI made simpler)

    Hi All,
    I have created the same scenario as mentioned in Siva's weblog (Lookup's in XI made simpler).
    I having some doubts regarding the scenario, it will be great if you help me to resolve the same.
    I am having a file-file scenario where I need to do lookup in database(MS-Access)  through mapping.
    The standard file-file scenario is in place and in addition I have created a receiver jdbc channel . I  have also created the receiver agreement for the same in the cofiguration.
    While creating the receiver agreement you have to specify the interface name which includes the message type…I have specified the normal format which we specify while configuring the jdbc receiver adapter.
    In the message mapping I have created a advance user defined function as mentioned in your weblog which calls my receiver jdbc channel.
    I have also specified the select query to be executed in the mapping program.
    While testing I am getting the following error
    Cannot produce target element /ns0:Role_MT/URole. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    <b>Can you please suggest me what all I need to do in addition to the file-file scenario for this lookup scenario to work.</b>
    Thanks and Regards
    Rahul

    Hi,
    Following is my user defined function
    //write your code here
    String Query = "";
    Channel channel = null;
    DataBaseAccessor accessor = null;
    DataBaseResult resultSet = null;
    Query = "Select URole from  Lookup where UName = '  " + UName[0] + "  ' and UPassword = '  " + Pwd[0] +" '  ";
    try{
    channel = LookupService.getChannel("DB_service","JDBC_channel_receiver");
    accessor = LookupService.getDataBaseAccessor(channel);
    resultSet  = accessor.execute(Query);
    for(Iterator rows = resultSet.getRows();rows.hasNext();){
    Map rowMap = (Map)rows.next();
    result.addValue((String)rowMap.get("URole"));
    catch(Exception ex){
    result.addValue(ex.getMessage());
    finally{
    try{
    if (accessor!= null) accessor.close();
    catch(Exception ex){
    result.addValue(ex.getMessage());
    Thanks and Regards
    Rahul

  • Query regarding the tutorial for Oracle Service Bus (OSB 10gR3)

    Hi,
    I am working on a tutorial of Oracle Service Bus (OSB 10gR3).
    I have created the proxy service and the Business Service, using Oracle Service Bus console.
    The details are as follows:
    Proxy service: LoanGateway
    Business service1: A value of 4.9 or less causes the message to be routed to the ManagerLoanReview business service.
    Business service2: A value of 5.0 or greater causes the message to be routed to the NormalLoan business service.
    When i send the request message, so that it gets routed from proxy service to one of the business service than it gives following error.
    Request Document
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    </soap:Header>
    <soapenv:Body>
    <exam:processLoanApp xmlns:exam="http://example.org">
    <loanRequest xsi:type="java:LoanStruct" xmlns:java="java:normal.client" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!--Optional:-->
    <java:Name>Smith</java:Name>
    <!--Optional:-->
    <java:SSN>1234567</java:SSN>
    <!--Optional:-->
    <java:Rate>4.1</java:Rate>
    <!--Optional:-->
    <java:Amount>9000000</java:Amount>
    <!--Optional:-->
    <java:NumOfYear>10</java:NumOfYear>
    <!--Optional:-->
    <java:Notes>Manager Loan Application Review Service</java:Notes>
    </loanRequest>
    </exam:processLoanApp>
    </soapenv:Body>
    </soapenv:Envelope>
    Response Document
    The invocation resulted in an error: .
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <soapenv:Fault>
    <faultcode>soapenv:Server</faultcode>
    <faultstring>
    BEA-380002: Tried all: '1' addresses, but could not connect over HTTP to server: 'localhost', port: '7021'
    </faultstring>
    <detail>
    <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-380002</con:errorCode>
    <con:reason>
    Tried all: '1' addresses, but could not connect over HTTP to server: 'localhost', port: '7021'
    </con:reason>
    <con:location>
    <con:node>RouteNode1</con:node>
    <con:path>request-pipeline</con:path>
    </con:location>
    </con:fault>
    </detail>
    </soapenv:Fault>
    </soapenv:Body>
    </soapenv:Envelope>
    Response Metadata
    <con:metadata xmlns:con="http://www.bea.com/wli/sb/test/config">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </con:metadata>

    I have the same problem and I'm not able to telnet localhost on port 7021. How can I change this port number I think that port must be 7001, it is correct?Examples server domain is pre-configured for port 7021. The samples domain will have the examples properly deployed in this domain out of box. You dont need to change any thing in {BEA_HOME}\osb_10.3\samples\domains\servicebus\config.
    I doubt this has to do something with firewall . Check the last statement in the log after starting the domain.
    <May 19, 2009 8:50:09 AM IST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 10.177.242.25:7001 for protocols iiop, t3, ldap, snmp, http.>
    <May 19, 2009 8:50:09 AM IST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
    <May 19, 2009 8:50:09 AM IST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "base_domain" running in Development Mode>
    <May 19, 2009 8:50:09 AM IST> <Warning> <Server> <BEA-002611> <Hostname "mneelapu", maps to multiple IP addresses: 10.177.242.25, 127.0.0.1>
    <May 19, 2009 8:50:09 AM IST> <Warning> <Server> <BEA-002611> <Hostname "XYZ-v411-10-177-242-25.oracle.com", maps to multiple IP addresses: 10.177.242.25, 127.0.0.1>
    <May 19, 2009 8:50:09 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
    <May 19, 2009 8:50:09 AM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    What are you seeing in your log file?
    Edited by: mneelapu on May 19, 2009 9:58 AM

  • Query regarding the Position Hierarchy.

    Client Version:R12.1.3
    We are setting up Position Hierarchy.
    Have a query in the setup.
    We have a position called Clerk--Number of Holders---2
    Clerk --Holder 1 is reporting to Manager 1
    Clerk Holder2 is reporting to Manager 2.
    When we are trying to set the Hierarchy.
    It is taking both the holders in consideration.
    Request to assist.
    Thanks in advance
    Regards
    Srini

    914612 wrote:
    Dear user13056460,
    your query is very obvious you have a position type pooled and two employees are assigned to this position where in the hierarchy it shows two holder, if you want my opinion let each clerk have his own unique position as Clerk LA and CLerk DC by this you will not go through the headache of having two hierarchies and if youre having two hierarchies you need also to enable the document type (can change approval path option) the workflow engine by your scenario will get lost because two individuals have the same position so it will go to only one, options youre having
    1- let the postion with a two holder but enable the users to select approval path and employee while submiting PO's
    2- give each clerk a unique position name which is easier.
    Let me know if you have any more inquiries
    Regards
    Ammar M. GhazalehAmmar,
    That is what we have the requirment..
    I tried changing the existing hierarchy..but it is not working..
    For 2 clerks here..we created say 100.Purchase Clerk as Job and position as 200.Purchase clerk
    for the second clerk it has same job as 100.Purchase Clerk as Job and position as 200.Purchase clerk1
    (we changed a bit)
    one clerk reports to one manager..and the manager reports to dept head.
    one clerk reports to dept head..
    so while in hierarchy dept has total 3 sub ordinates and when we drill down manager has 1 sub ordinates..
    which makes sense...
    i created approval groups also...and assignments too..
    but when the newly created clerk logins and when he forwards documents..he is not seeing the default heiarchy..we have set this up in documents types..
    and the second old clerk he is seeing this when he is forwading documents for approval..
    where did i miss the setup?
    Please Advise
    Thanks
    Mahendra
    Edited by: 843237 on Feb 16, 2012 4:24 PM

  • Top n analysis using hierarchial queries

    hi all,
    can we do top n analysis in hierarchial queries using level pseudo columns. if so please give an example.
    thanks and regards,
    sri ram.

    Hi,
    Analytic functions (such as RANK) often interfere with CONNECT BY queries. Do one of them in a sub-query, and the other in a super-query, as shown below.
    If you do the CONNECT BY first, use ROWNUM (which is assigned after ORDER SIBLINGS BY is applied) to preserve the order of the CONNECT BY query.
    WITH     connect_by_results     AS
         SELECT     LPAD ( ' '
                   , 3 * (LEVEL - 1)
                   ) || ename          AS iname
         ,     sal
         ,     ROWNUM               AS r_num
         FROM     scott.emp
         START WITH     mgr     IS NULL
         CONNECT BY     mgr     = PRIOR empno
         ORDER SIBLINGS BY     ename
    SELECT       iname
    ,       sal
    ,       RANK () OVER (ORDER BY sal DESC)     AS sal_rank
    FROM       connect_by_results
    ORDER BY  r_num
    ;Output:
    INAME                  SAL   SAL_RANK
    KING                  5000          1
       BLAKE              2850          5
          ALLEN           1600          7
          JAMES            950         13
          MARTIN          1250         10
          TURNER          1500          8
          WARD            1250         10
       CLARK              2450          6
          MILLER          1300          9
       JONES              2975          4
          FORD            3000          2
             SMITH         800         14
          SCOTT           3000          2
             ADAMS        1100         12 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data. If you use only commonly available tables (such as those in the scott or hr schemas), then you don't have to post any sample data; just post the results.
    Explain how you get those results from that data.
    Always say what version of oracle you're using.

  • Problem with the hierarchial fields in a Purchase order xml report

    Hi,
    I am having a problem with the hierarchy problem. We are populating attribute 15 of a PO header. some times it can be null. FYI, we are using 11.5.10 instance where oracle supports direct PO template rather than having a rdf file.
    And now in the xml report, if attribute15 of po header is not null then it is fine.
    But if attribute15 is null, then the template is picking from the next available attribute15 that is from the po lines. As the line level group of "LINES" is between the "PO_DATA" (header group), hence the template is checking for next available attribute15.
    Can any one please suggest how to design the template where we can make the template to check only for that tag at the header level group rather than the line level group tag?
    Thank You in advance.
    Regards,
    Srinivas.

    Hi
    Incase you want to transfer attachements from SRM to R/3, then you try implementing the BADI in SRM side. The BADI which will help in this case is
    <b>BBP_CREATE_PO_BACK</b> BADI.
    <b>Please read the standard SAP documentation of this BADI using SE18 Transaction, before making any code changes.</b>
    <u>Few Important SAP OSS notes to refer in this case -></u>
    Note 989184 - Transferred shopping cart with internal attachments
    Note 550071 - FAQ: EBP - Shopping Cart
    Note 916347 - Transfer shopping cart with internal attachments
    Note 1001130 - FAQ - Attachment questions (Buyside)
    <u>Few useful links -></u>
    <b>http://help.sap.com/saphelp_srm50/helpdata/en/49/b32640632cea01e10000000a155106/frameset.htm
    Re: Attachments to backend
    Re: Document Attachments in Shopping Cart
    Re: Attachment in SRM
    Re: SRM Documents and Attachments
    Re: Limit in Attachments of an item in Shopping Cart
    Re: return delivery text from material document is not passed to SUS
    </b>
    Do let me know, incase you face any problems.
    Regards
    - Atul

  • List of queries in oracle forms

    Hi can any one help me out for the following doubts: ( Please relate the requirements to oracle apps.)
    1. How to close one screen using 'x' button in the right corner for which I have written close_form('form_name') in the on_exit trigger but I am not able to achieve it. Is there any property setting.
    2. When to use parameters.
    3. What is text-parameter and data-parameter (specified while adding parameters to parameter list)
    4. Can we provide access key to editors, if so, how to add access key
    5. How to update the values in a screen from another screen
    6. How to pass multiple parameters to a form
    7. How to read the value of parameters
    8. While saving the data in the first screen (database block) I want to store the data from the second screen also which is transaction details related to the first master screen.
    Regards,
    Chandra sekar

    1. Use key-exit trigger, not on_exit.
    2. Parameters are good for passing values from one form to another, or when starting a form from Windows or the browser. They are also useful sometimes as bind variables used in where clauses, or to hold the result from an LOV selection.
    6. What environment are you asking about?
    8. Issue a Post; in the details (second screen) before returning to the first screen.

  • Getting an autosuggest Search working with the Hierarchy Viewer

    Hi,
    I recently raised an issue with Oracle Support 3-7934581791 : Hierarchy Search not working in HTMl5 version, this was promoted to being a bug in ADF HV
    Bug 17601664 - NON-FLASH VERSION OF HIERARCHY VIEWER DOES NOT DISPLAY A SEARCH FORM
    So, my question is what other option preferably programmatically to provide the user with an auto suggest list of employees, selecting this list then re-queries the Hierarchy Viewers query and thus providing the user with an updated HV with the selected employee showing. Any help appreciated; Just not I am running the page with flash disabled and therefore the default search form available cant be used due to bug above.

    just note I have reviewed
    http://jdevadf.oracle.com/adf-richclient-demo/faces/feature/hv/hvSearch.jspx
    This is perfectly fine if running Flash and have this working, but I am tryinto get this to work on an iPad and non Flash enabled browsers.

  • XML queries in ORACLE 10gR1 vs ORACLE 10gR2

    Hi
    in the research project where I'm involved in, we have two databases. One is the test database, upgraded recently in ORACLE 10gR2 and the production database in ORACLE 10gR1.
    We have the same table with the same data in both test and production database.
    I can run successfully the query and get result in test db ORACLE 10gR2:
    SELECT XMLQuery('declare namespace
    mpeg7="urn:mpeg:mpeg7:schema:2001";for $i in /mpeg7:Mpeg7
    return $i' PASSING xmlcolumn RETURNING CONTENT) FROM
    XMLTable WHERE existsNode(xmlcolumn,
    '//@id="2005"',
    'xmlns="urn:mpeg:mpeg7:schema:2001"') = 1;
    but if I try the same query in production db ORACLE 10gR1, I get the error
    return $i' PASSING xml_column RETURNING CONTENT) FROM
    FEHLER in Zeile 3:
    ORA-00907: missing right parenthesis
    Is there any difference in the queries syntax between R1 and R2?
    What should I change in my query?
    Please help. I’m really facing with some problems with XML storage and retrieve.
    Any kind of help will be appreciable
    Best regards,
    Evanela

    Hi Evanela,
    XQuery is available from 10gR2 and higher - the XQuery functionality
    is just not available in 10gR1 ...
    Does this help ...?
    -Carsten

Maybe you are looking for

  • One of my database did not migrate in V11 (From 9.3) ?

    Hello, we just have migrated our hyperion server from 9.3.1 to 11.1.1 We have two applications in the same application group. When I open shared Services, In the frame "Application Management", if I click on "Application Group" I see my Application g

  • Can dreamweaver (CS3) play the middleware between flash AIR as 3.0 and MSSQL

    I have developed a Flash AIR AS3 form, 7 input text fields, one submit button. I know that Flash can't communicate with a server unless a PHP script is in the middle. Sadly, I am on microsoft sql server 2008 not mySQL. Does anybody out there, know of

  • Bt wifi login credentials

    Hello, I've been puzzling over this problem for two days now and I hope someone ca help me please. I have bt unlimited broadband with inclusive bt wifi. I'm opted in to bt wifi and I've used the status checker (bt.com/wifi/secure/statuscheck.do) whic

  • Problems syndicating Vendor from MDM5.5 to BI via XI

    Hello colleagues: So far I've been succesful when syndicating products from MDM 5.5 Material repository to SAP BW 3.5 using XI 3.0. We are using the standard business content for BW in BW as well as in XI, and the standard GenericProduct MAP. I've ac

  • Microphone doesn't work for Creative Live! Cam Socialize HD AF HD Webcam

    Microphone doesn't work for Creative Live! Cam Socialize HD AF HD Webcam (for Windows 7). I have to use external microphone from Logitech now. I send few emails to Customer Service. They answered once to check my Device Manager and disappeared after