A single table line generating more than 2 lines when exporting to Excel

Guys,
I do have an interactive report on apex with a varchar2(4000) column that is generating more than 1 excel row per table row. In another words:
Table my_report
file_id number,
file_comment varchar2(4000)
Query on report
select file_id, file_comment from my_report
It generates 5 lines on report screen but, when I export to excel using csv or xls format, it generates more than 5 lines. On file_comments field on excel, some of them has a break in 2 or 3 lines. Seems to me a line feed problem with CHR(13) or chr(10).
Anyone as a solution or a similar problem like this? Any idea?
Andre.

you could try to remove the linebreaks in the select.
select file_id, file_comment, replace(replace(file_comment,CHR(13)),CHR(10)) file_comment_nobreak
from my_reportThen depending on the type of report you could show one column, but export the other column in the excel/csv file. Not sure if this works with an interactive report too.

Similar Messages

  • Taking too much time for saving PO with line item more than 600

    HI
    We are trying to save PO with line items more than 600, but it is taking too much time to save. It is taking more than 1 hour to save the PO.
    Kindly let me know is there any restriction for no. of line items in the PO. Pls guide
    regards
    Sanjay

    Hi,
    I suggest you to do a trace (tcode ST05) to identify the bottleneck.
    You can know some reasons in Note 205005 - Performance composite note: Purchase order.
    I hope this helps you
    Regards
    Eduardo

  • Clear the line items more than 999 through F-28

    Hi,
    I have one issue,
    senario is like below:
    Step1:
    F110 - Create the payment order for customer. if customer have more than 999 line items also payment order is updating
    Step2:
    Clear the invoices with referece to Payment order in F-28
    here while clearing the customer line items using payment order referece if line items is more than 999 for customer it is not allowing to clear. error message is line items more than 999.
    I have checked with tecnical people can we split the clearing if more than 999 line items. as per them is if it is not referece to payment order it is possible to write some code based on document type or posting date they can split.
    here it is not possible. I tried with summrizaiton senario as specified in sap notes if line items more than 999. it is not also working.
    i have one more question also while running f110 can we restrect the payment order to geneare upto 999 line items if it exceeds it should create other payment order of remaing line items so on.. is it possible?
    can any body give a light to resove this issue.
    BR:
    Venkat.Gurram

    Hi,
    I have already checked that link .
    I have implemented the note: 36353 for summrizaiton.
    for payment order we can't do sumarization due to we can't the payment order while cleargin.
    give me some other idea
    BR:
    Venkat.Gurram

  • Update gives "single-row subquery returns more than one row"

    Hi,
    I have to update a table by getting values from two other tables. While doing that the inner query returns more than one value. I am not sure how to implement the logic without returning more than one row in sub quesry. Need help on that.
    My query:
    update buf_office_str o
    set o.manager_ident =
    (select sp.ident
    from se2_r_src_sourceperson sp ,
    (select distinct director_name, team_name from buf_sales_dump )t
    where SP.SRCNAME = upper(substr(t.director_name,instr(t.director_name,' ')+1,length(t.director_name))||', '||substr(t.director_name,1,instr(t.director_name,' ')-1 ) )
    and o.office_descr = t.team_name
    Basically the query gets teh manager id from sp table where sp.srcname = t.team-name.
    The office descr should be equal to the team_name.
    This is the logic I am working towards:
    For each office, i get the office_descr and get corresponding team_name. Match the team's director_name (from table t) with the sp.name and return the employee's id (sp.ident) for that office_descr.
    I need to update all 50 offices with corresponding managerid for that office in buf_office_str table.
    Is it possible to get done in one update? Pls let me know.

    Hi,
    "Single-row subquery returns more than one row" is one of those error messages that actually means what it says: the correlated sub-query in your SET clause is sometimes returning 2 or more rows .
    The solution could be as simple as making the sub-query SELECT DISTINCT , as its in-line view, t, already is.
    It's possible you have bad data, or a mistake in your statement.
    To find the problem cases, you can run something like this:
    WITH  sub_q     AS
                       SELECT  -- DISTINCT ?
                                sp.ident
                       ,         t.team_name
                       ,         COUNT (*) OVER (PARTITION BY t.team_name)     AS cnt
                       FROM    se2_r_src_sourceperson     sp
                       ,         (  SELECT DISTINCT director_name
                                   ,                  team_name
                               FROM            buf_sales_dump
                             )                    t
                       WHERE   sp.srcname     = UPPER ( SUBSTR ( t.director_name
                                                         , INSTR ( t.director_name
                                                  ) + 1
                                                , LENGTH (t.director_name)
                                          || ', '
                                          || SUBSTR ( t.director_name
                                                          , 1
                                                   , INSTR ( t.director_name
                                                        ) - 1
    SELECT     o.*     -- or whatever helps you
    ,     sq.*
    FROM     buf_office_str     o
    JOIN     sub_q          sq     ON     o.office_descr = sq.team_name
    WHERE     sq.cnt          > 1
    ;If you'd like more help, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables as they exist before the UPDATE, and the results you want from that data (that is, the contents of buf_office_str after the UPDATE). Make sure the problem occurs with the sample data you post.

  • How to create a table cell occupy more than one row using PDF.

    Hi,
    I want create a pdf report,which contains a table cell occupied more than one line.
    just like html language: <rowspan = 2>
    merge cells in one row is allowed,we can use merge cells command(like colspan in html).
    but how to mege cells in one column?

    Hi,
    I want create a pdf report,which contains a table cell occupied more than one line.
    just like html language: <rowspan = 2>
    merge cells in one row is allowed,we can use merge cells command(like colspan in html).
    but how to mege cells in one column?

  • Single row subquery Returning more than one row

    Hi,
    This is urgent.............
    could u any one please suggest me on this query it returning single row subquey returnin more than one row
    In this 2nd suquery fails some of the order_numbers returning more than price_list based on dates and in that situvation also my query has to successfull
    fro that i added this condition l.ordered_quantity between trunc(product_attr_value_from) and (product_attr_value_to) for that condition also failing this query
    pls give me the correct condition to approach this solution
    select
    substr(party.party_name,1,13),
    c.account_number,
    substr(h.order_number||'-'||l.line_number||'-'||l.shipment_number,1,15),
    q.name,l.unit_selling_price,
    (select qll.operand
    apps.qp_list_headers qlh,
    apps.qp_list_lines qll,
    apps.qp_list_lines qllx
    apps.qp_pricing_attributes qpa,
    apps.qp_rltd_modifiers qrm,
    apps.mtl_system_items msi
    wherer qll.list_header_id=qlh.list_header_id
    and qpa.list_header_id=qlh.list_header_id
    and qpa.list_line_id=qll.list_line_id
    and qrm.rltd_modifier_grp_type='PRICE BREAK'
    and qll.list_line_id=qrm.to_rltd_modifier_id
    and qll.list_line_type_code='PLL'
    and qllx.list_header_id=qlh.lsit_header_id
    and qllx.list_line_id=qrm.from_rltd_modifier_id
    and qllx.list_line_type_code='PBH'
    and qlh.list_header_id=l.price_list_id
    and qpa.product_attr_value=msi.inventory_item_id
    and qpa.product_attr_value=l.inventory_item_id
    and msi.segment2 is null
    and msi.organization_id=89
    and trunc(l.request_date) between trunc(qllx.start_date_active) and trunc(nvl(qllx.end_date_active,sysdate))
    and l_ordered_quantity between qpa.pricing_attr_value_from and qpa.pricing_attr_value_to
    and qpa.product_uom_code=l.pricing_quantity_uom),
    substr(l.ordered_item,1,13),
    u.user_name,
    t.name,
    l.ordered_quantity,
    l.creation_date,
    l.request_date,
    l.pricing_date,
    l.flow_status_code
    from apps.oe_order_headers_all h,
    hz_cust_Accounts c,
    hz_parties party,
    apps.oe_order_lines_all l,
    apps.qp_list_headers_tl q,
    apps.qp_list_headers_b qb,
    apps.fnd_user u,
    apps.so_order_types_all t
    where h.header_id=l.header_id
    and h.sold_to_org_id=c.cust_account_id
    and c.party_id=party.party_id
    and trunc(l.request_date)!=trunc(l.pricing_date)
    and qb.attribute1='Q'
    and q.list_header_id=qb.list_header_id
    and l.price_list_id=q.list_header_id
    and l.flow_status_code=!='CANCELLED'
    AND t.name!='ECOM'
    and t.name!='RMA'
    and l.open_flag='Y'
    and l.item_type_code='MODEL'
    and u.user_id=l.created_by
    and t.order_type_id=h.order_type_id
    and u.user_name='XXCONVERSION'
    and (l.unit_selling_price -
    (select qll.operand
    from apps.qp_list_headers qlh,
    apps.qp_lsit_lines qll,
    apps.qp_list_lines qllx,
    apps.qp_pricing_attributes qpa,
    apps.qp_rltd_modifiers qrm,
    apps.mtl_system_items msi
    where qll.list_header_id=qlh.list_header_id
    and qpa.list_header_id=qlh.lsit_header_id
    and qpa.list_line_id=qll.list_line_id
    and qrm.rltd_modifier_grp_type='PRICE BREAK'
    AND qll.list_line_id=qrm.to_rltd_modifier_id
    and qll.list_line_type_code='PLL'
    and qllx.list_header_id=qlh.list_header_id
    and qllx.list_line_id=qrm.from_rltd_modifier_id
    and qllx.list_line_type_code='PBH'
    and qlh.list_header_id=l.price_list_id
    and qpa.product_attr_value=msi.inventory_item_id
    and qpa.product_Attr_value=l.inventory_item_id
    and msi.segmetn2 is null
    and msi.organization_id=89
    trunc(l.request_date) between trunc(qllx.start_date_active) and trunc(nvl(qllx.end_date_active,sysdate)) and
    and l.ordered_quantity between qpa.pricing_attr_value_from and qpa.pricing_attr_value_to
    and qpa.product_uom_code=l.pricing_quantity_uom)!=0)
    order by creation_date

    Hi,
    995631 wrote:
    Hi,
    This is urgent.............Then don't use this forum.
    could u any one please suggest me on this query it returning single row subquey returnin more than one row
    In this 2nd suquery fails some of the order_numbers returning more than price_list based on dates and in that situvation also my query has to successfullRemember, none of the people who want to help you are as familiar with your application as you are, so you have to explain things that are obvious to you.
    What does "sucessful" mean in this case? Does is mean producing the right results? What are the right results? How can you tell them apart from the wrong results?
    As the errror message says, the (immediate) problem is that a single-row sub-query is returning more than a single row. If the sub-query tries to bring back more than 1 row, which one do you want to use? Or do you want to use some kind of aggregate, such as the average, which might not be the same as any of them?
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Simplify the problem as much as possible. For example, remove all columns and tables that have nothing to do with the part you don't know how to do.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • ORA-01427: single-row subquery returns more than one row

    I have a problem something like this:
    table A
    id col1 after_update
    1 ? 11
    2 ? 22
    3 ? 33
    3 ? 44
    3 ? 55
    4 ? 66
    5 ? 88
    5 ? ? /* won't be updated */
    6 ? 99
    7 ? null /* updated to null */
    9 ? 20
    table B
    id col2
    1 11
    2 22
    3 33
    3 44
    3 55
    4 66
    4 77
    5 88
    6 99
    8 10
    9 20
    When I try the query:
    update table A
    set col1 = (select distinct col2 from table B) it gives me the error ORA-01427: single-row subquery returns more than one row
    When I try the query:
    update (select x.col1 x_col1,y.col2 y_col2
    from (select id,col1,row_number() over (partition by id order by null /*col1*/) rn
    from table_a
    ) x,
    (select id,col2,row_number() over (partition by id order by col2) rn
    from table_b
    ) y
    where x.id = y.id
    and x.rn = y.rn
    set x_col1 = y_col2
    it gives me an error saying ora-01779 :cannot modify a column which maps to a non key- preserved table. It shows the same even when I add the key to the tables.
    My Database version is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Kindly help.

    Another way, not waterproof too relay on rowid, but in your case it could work.
    You have to verify it by yourself
    update test_a aa
    set col1 =
    (select b.col1 from
    (select
    id, col1
    ,row_number() over
      (partition by id order by col1) rn
    from table_b) b,
    ( select
      rowid, id, col1
    ,row_number() over (partition by id order by col1) sort_order
    from test_a
    ) a
    where
    a.id=b.id
    and
    sort_order = rn
    and
    aa.rowid=a.rowid
    )Edited by: chris227 on 03.04.2013 06:42
    Table name corrected

  • ORA-01427: single-row subquery returns more than one row HELP

    I need to update baemployee.Stock_nbr field with select substr(C.CHECK_DIGIT, 3, 10)
    from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE
    Please help.
    update baemployee e
    set Stock_nbr = (select substr(C.CHECK_DIGIT, 3, 10)
    from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE)
    where exists
    (select C.CHECK_DIGIT
    from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE)
    and exists (select 1 from EMPLOYEE ee where ee.employee = e.employee and ee.emp_status like 'A%');
    ORA-01427: single-row subquery returns more than one row

    Hi,
    Welcome to the forum!
    Whenever you have a question, please post some sample data, so that people can re-create the problem and test their solutions.
    CREATE TABLE and INSERT statements, like the ones below, are great:
    CREATE TABLE      baemployee
    (     employee     NUMBER (4)
    ,     stock_nbr     VARCHAR2 (10)
    INSERT INTO baemployee (employee, stock_nbr) VALUES (1234, 'FUBAR');
    CREATE TABLE     employee
    (     employee     NUMBER (4)
    ,     emp_status     VARCHAR2 (10)
    INSERT INTO employee (employee, emp_status) VALUES (1234, 'ACTIVE');CREATE TABLE AS is good, too:
    CREATE TABLE     emp_check_dig
    AS          SELECT  1234 AS employee, 'AA1234567890ZZZ' AS check_digit     FROM dual
    UNION ALL     SELECT  1234,            'AA2121212121ZZZ'               FROM dual
    ;Also post the results you want from that data. In this case, the results would be the contents of the baemployee table after you run the UPDATE.
    Would you want:
    employee  stock_nbr
    1234       1234567890or would you want
    employee  stock_nbr
    1234       2121212121If you run the UPDATE statement you posted with the data above, you'll get the "ORA-01427: single-row subquery returns more than one row" error, and you can see what causes it: there is more than one row from emp_check_dig that could be used to UPDATE the same row of baemployee. Say what you want to do in this situation (and why), and someone will help you find a way to do it.

  • ORA-01427: single-row subquery returns more than one row -- no solution

    Hello to all:
    I have to tables:
    Table a anwender (Email,Dept). --> all fields are filled
    Table b dingo (Name,email,dept) --> all fields are filled
    I now want to update the table a with the data from table b:
    update anwender a set a.abteilung = ( select distinct b.abteilung from dingo b where b.email = a.email);
    Then I got the error: ORA-01427: single-row subquery returns more than one row
    Every dept is about 100x in the database, so it is clear that i got more than one row back. But how can I update the table now?

    Okay, I got several duplicates, and I deletet a lot of data in my database.
    Now I want to remove all entries with more than one departments per mail adresses.
    a
    select email,count(abteilung) from dingo group by email having count(abteilung)>1 order by count(abteilung)
    shows me all the fake mailadresses.
    But a
    delete from dingo where email in (select email,count(abteilung) from dingo group by email having count(abteilung)>1 order by count(abteilung) );
    gives me a
    SQL Error: ORA-00907: missing right parenthesis
    I´m very confused now ...
    Oops, now I got the solution:
    delete from dingo where email in (select email from (select email,count(abteilung) from dingo group by email having count(abteilung)>1 )) ;
    Edited by: user8309218 on Dec 18, 2009 6:24 AM

  • Still problem with single-row subquery returns more than one row

    //i did join each table but query runs forever and fail. looks Cartesian join so comes up the following SQL
    the following query has a problem. would you please help me, please
    Select pe.expense_id
    ,PE.CODE
    ,PE.PROJECT_ID
    ,PE.LDATE
    ,PE.INAMOUNT pe_amount
    ,(SELECT TRX.INV_AMOUNT FROM TRXEXPENSES TRX
    WHERE PE.EXPENSE_ID=TRX.EXPENSE_ID) AS invamount
    ,(SELECT RE.AMOUNT FROM REEXPENSES RE WHERE
    PE.EXPENSE_ID=RE.EXPENSE_ID) AS recogamount
    ,(SELECT MLE.M_AMOUNT FROM MATEXPENSES MLE
    WHERE PE.EXPENSE_ID=MLE.EXPENSE_ID) AS matamount
    from EXPENSES PE
    where pe.expense_id=5600
    group by expense_id,CODE,PROJECT_ID,LDATE,inamount
    //get error message
    ora-01427:single-row subquery returns more than one row
    //check database
    select expense_id,count(*) from TRXEXPENSES
    where expense_id in(select expense_id from
    expenses)
    group by expense_id
    having count(*)>1
    //here is duplicate record a lot
    EXPENSE_ID     COUNT(*)
    4176     2
    5600     3
    9572     2
    9573     2
    9574     2

    Yes, Expense_id has so many returning rows for trx.inv_amount from trxexpenses in subquery.
    I want to show Expense_id with retruning rows using the above query.
    ex)The result of the query is like that;
    Expense_ Id project_id Ldate InvAmount RecogAmount MatAmount
    5600 123 3/2/02 $100(InvAmount)
    5600 432 3/12/02 $200(recogAmount)
    5600 432 4/12/02 $250(MatAmount)
    Thank you so much
    Message was edited by:
    user524064
    Message was edited by:
    user524064

  • Spool generated more than 1

    Hi Expert,
    My functional assigned my program (subroutine entry) and my smartforms to output type in MB1B.
    I tried to posted MB1B, and the smartforms display correctly. But when i check in SP02 spool generated more than 1 for the same smartforms.
    Seems like the smartforms was called for several times (same with how many spool created) --> i checked in the code the smartforms was called one time only in subroutine entry.
    Maybe this information make you guys more idea:
    Before i forgot to clear my internal table in the print program (subroutine entry) that called the smartforms and the internal table was append.
    This what happened:
    1 smartforms = 1 page (itab 1 record)
    When i posted MB1B --> 2 spools --> 1 is 1 page (correct), 2 is 2 pages.
    1 smartforms = 2 pages (itab 2 records)
    When i posted MB1B -> 4 spools --> 1 is 2 pages (correct), 2 is 4 pages, 3 is 6 pages, 4 is 8 pages.
    What i try to show is, why the itab also append? Even i forgot to clear the itab should be 1 soubroutine entry called 1 time only every time posted MB1B right? so the itab should not be append.
    Now i clear the itab before call the smartforms.
    This what happened:
    1 smartforms = 1 page (itab 1 record)
    When i posted MB1B --> 2 spools --> 1 is 1 page (correct), 2 is 1 page.
    1 smartforms = 2 pages (itab 2 records)
    When i posted MB1B -> 4 spools --> 1 is 2 pages (correct), 2 is 2 pages, 3 is 2 pages, 4 is 2 pages.
    The pages correctly already, but why the spool still generated more than 1 spool?
    Any idea for the possibility why this happen?
    Best Regards,
    Victor.

    Hi Prashant,
    If let say inside smartforms got multiple loop? is it can cause multiple spool?
    I thought only if multiple call on the smartforms (not multiple loop inside the smartforms itself) will create multiple spool?
    Btw Prashant,
    If you see what happened when i forgot to clear my internal table.
    2 records --> become 4 records --> become 6 records --> become 8 records..
    What make me confuse is, this smartforms or the entry program that append that itab was called only by output type?
    Is it possible the ouput type itself that triggered the smartforms more than 1 time?
    Best Regards,
    Victor.

  • Generate more than 36 subroutines?

    Dear all,
    how can I generate more than 36 subroutine pools or dynamic programs (not perstistent programs)?
    Best regards,
    Christoph
    what I do (test case):
    Data: it_prog type stringtab.
    append 'Program SUBPOOL.' to it_prog.
    append 'Data: result type i.' to it_prog.
    append 'form eval changing result.' to it_prog.
    append ' result = result + 1.' to it_prog.
    append 'endform.' to it_prog.
    Do 100 times.
    Do 100 times.
    CALL METHOD lc_test->process
    EXPORTING
    it_tab = it_prog
    receiving
    RESULT = result
    enddo.
    method PROCESS.
    Data: prog type string.
    generate subroutine pool it_tab name prog.
    endmethod.
    Message was edited by:
    Christoph Aschauer

    HI,
    see this example.
    REPORT  ZBHEX2.
    DATA: prog TYPE string,
          tab  TYPE STANDARD TABLE OF string,
          mess TYPE string,
          sid  TYPE string.
    APPEND 'PROGRAM subpool.'                        TO tab.
    APPEND `DATA spfli_tab TYPE TABLE OF spfli.`     TO tab.
    APPEND `LOAD-OF-PROGRAM.`                        TO tab.
    APPEND `  SELECT *` &
           `         FROM spfli` &
           `         INTO TABLE spfli_tab.`          TO tab.
    APPEND `FORM loop_at_tab.`                       TO tab.
    APPEND ` write:/ 'abcd'. `                       TO tab.
    APPEND `  DATA spfli_wa TYPE spfli.`             TO tab.
    APPEND `  LOOP AT spfli_tab INTO spfli_wa.`      TO tab.
    APPEND `    PERFORM evaluate_wa USING spfli_wa.` TO tab.
    APPEND `  ENDLOOP.`                              TO tab.
    APPEND `ENDFORM.`                                TO tab.
    APPEND `FORM evaluate_wa USING l_wa TYPE spfli.` TO tab.
    APPEND `  WRITE: / l_wa-carrid, l_wa-connid.`    TO tab.
    APPEND `ENDFORM.`                                TO tab.
    GENERATE SUBROUTINE POOL tab NAME prog
             MESSAGE mess
             SHORTDUMP-ID sid.
    IF sy-subrc = 0.
      PERFORM ('LOOP_AT_TAB') IN PROGRAM (prog) IF FOUND.
    ELSEIF sy-subrc = 4.
      MESSAGE mess TYPE 'I'.
    ELSEIF sy-subrc = 8.
      MESSAGE sid TYPE 'I'.
    ENDIF.
    rgds,
    bharat.

  • Workflow generate more than one instnace

    Hello All,
                I had called my work flow from Module Pool using Event "SAP_WAPI_CREATE_EVENT"  and also calling two other event which also working as terminating event in that same work flow which i had called using  "SAP_WAPI_CREATE_EVENT_UPD_TAST".. it is not inmy work flow but for all workflow it generate more than one instance..... in our system...
    Please give appropriate solution as soon as Possible.....
                                                                             Thank You....

    Hi all,
    Thanks for ur replies.
    I wud elaborate on the issue..
    Basically I am trying to execute a multilevel approval scenario.
    For that I have an initiator of the workflow and multiple approvers (acting one at a time - i.e at single instance, single approver would be available)
    When Initiator clickd on 'Send for approval' - command button in module pool, "SAPI_WAPI_CREATE_EVENT" is being called to trigger the workflow.
    I have created a business object which will get me the next approver. Here, it happens, at times , that the multiple work items for the same workflow event are being sent to approver's Inbox. (altho' at times it works fine - single work item). Checking the event queue : TCODE : SWEL ; the EVENT INSTANCE IDs are same for all the work item instances.
    Later on when the approver executes the workitem (approves/rejects - command button in module pool), again multiple instances are created ( with same event instance ID). Here we are using the function module "SWE_CREATE_EVENT_IN_UPD_TASK".
    Althou' things work perfect sometimes, all this happens randomly.
    Glad to hear to ur suggestions and comments.
    Thanks & Regards.
    Edited by: HardikParikh on May 28, 2009 7:05 PM

  • TWO ERRO ORA-01427: single-row subquery returns more than one row

    Hi,
    I have a procedure which contains a cursor. If i run the select statement in the cursor separetly, it returns only value and works fine. But the same select statement in the cursor of a procedure throws me the error as below:
    TWO ERRO ORA-01427: single-row subquery returns more than one row
    Not sure what going on...any help appreciated.
    Below is the select statement:
    SELECT DISTINCT PSE.PARENT_POSITION_ID,
    (SELECT DISTINCT PPD1.SEGMENT2
    FROM PER_POSITION_DEFINITIONS PPD1,
    HR_ALL_POSITIONS_F HAPF2,
    PER_POS_STRUCTURE_ELEMENTS PSE2
    WHERE TRUNC(SYSDATE) BETWEEN
    HAPF2.EFFECTIVE_START_DATE AND
    HAPF2.EFFECTIVE_END_DATE
    AND PPD1.POSITION_DEFINITION_ID =
    HAPF2.POSITION_DEFINITION_ID
    AND
    HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
    AND PSE2.PARENT_POSITION_ID =
    PSE.PARENT_POSITION_ID
    AND ROWNUM = 1) SEGMENT2,
    (SELECT DISTINCT PAPF1.FIRST_NAME || ' ' ||
    PAPF1.LAST_NAME CHIEF_NAME
    FROM PER_ALL_PEOPLE_F PAPF1,
    PER_ALL_ASSIGNMENTS_F PAAF1
    WHERE TRUNC(SYSDATE) BETWEEN
    PAPF1.EFFECTIVE_START_DATE AND
    PAPF1.EFFECTIVE_END_DATE
    AND TRUNC(SYSDATE) BETWEEN
    PAAF1.EFFECTIVE_START_DATE AND
    PAAF1.EFFECTIVE_END_DATE
    AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
    AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
    AND ROWNUM = 1) CHIEF_NAME
    FROM PER_POS_STRUCTURE_ELEMENTS PSE,
    HR_ALL_POSITIONS_F HAPF,
    PER_POSITION_DEFINITIONS PPD
    WHERE PSE.SUBORDINATE_POSITION_ID = 52744
    AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND
    HAPF.EFFECTIVE_END_DATE
    AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
    AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;
    Thanks
    PK
    Edited by: user539616 on Jun 30, 2009 6:30 PM

    Hi,
    The cursor has a different parameter? Maybe the query is not exactly the same. Could you check this?
    This is your query (formatted):
    SELECT DISTINCT PSE.PARENT_POSITION_ID,
                    (SELECT DISTINCT PPD1.SEGMENT2
                       FROM PER_POSITION_DEFINITIONS   PPD1,
                            HR_ALL_POSITIONS_F         HAPF2,
                            PER_POS_STRUCTURE_ELEMENTS PSE2
                      WHERE TRUNC(SYSDATE) BETWEEN HAPF2.EFFECTIVE_START_DATE AND
                            HAPF2.EFFECTIVE_END_DATE
                        AND PPD1.POSITION_DEFINITION_ID = HAPF2.POSITION_DEFINITION_ID
                        AND HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
                        AND PSE2.PARENT_POSITION_ID = PSE.PARENT_POSITION_ID
                        AND ROWNUM = 1) SEGMENT2,
                    (SELECT DISTINCT PAPF1.FIRST_NAME || ' ' || PAPF1.LAST_NAME CHIEF_NAME
                       FROM PER_ALL_PEOPLE_F      PAPF1,
                            PER_ALL_ASSIGNMENTS_F PAAF1
                      WHERE TRUNC(SYSDATE) BETWEEN PAPF1.EFFECTIVE_START_DATE AND
                            PAPF1.EFFECTIVE_END_DATE
                        AND TRUNC(SYSDATE) BETWEEN PAAF1.EFFECTIVE_START_DATE AND
                            PAAF1.EFFECTIVE_END_DATE
                        AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
                        AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
                        AND ROWNUM = 1) CHIEF_NAME
      FROM PER_POS_STRUCTURE_ELEMENTS PSE,
           HR_ALL_POSITIONS_F         HAPF,
           PER_POSITION_DEFINITIONS   PPD
    WHERE PSE.SUBORDINATE_POSITION_ID = 52744
       AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND HAPF.EFFECTIVE_END_DATE
       AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
       AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;Tips: To put formatted code you must use {noformat}{noformat} tags, start tag and end tag are the same,you don't need to put '/' in the close tag.
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Table referenced by more than one other table

    I'm no DBA so I was wondering if you could answer this fairly basic question. If I have a table that references more than 1 other table. For example Order links to a customer or Order can link to an Employee how would I represent that in the data model?
    I'm guessing I could have the Order table have both an Employee ID and a Customer ID columns and null one or the other out depending on whether it was linked to an Employee or Customer but that seems a bit redundant in that there would always be at least one column being null.
    Perhaps I could use table inheritance and just add the relevant foreign key col on the inherited tables but I'm fairly sure you can't have abstract tables.
    Thanks for the help.

    For example:
    table a = Primary_key1, col2, col3
    table b = Primary_key1, primary_key2, col3
    table c = Primary_key2, col2
    To join all this tables you must do something like this:
    select ....
    from tablea,tableb,tablec
    where tablea.Primary_key1=tableb.primary_key1 and
    tableb.Primary_key2=tablec.primary2;

Maybe you are looking for

  • Saving a website on the hard drive so that you can put it on another host

    I just made a website and want to save it to my hard drive just in case everything crashes or there is a dispute with the host and then I will have the website ready to put on another host. For example, if the host decides they don't like my content

  • EBS -note to payees

    Hi can some body tell me how do we clear/post customer payment using EBS. I am not sure about how do we search open items, note to payees field & defining variant for EBS. Thanks Nik

  • Change codepage in OIM reports saved in CSV format (e.g. UTF8 - Win1251)

    Hello guys. I have OIM V.9.1 installed on WebLogic. For some reason my customer would like to have OIM reports saved in CSV format encoded with codepage differ from default UTF8 (actually desired codepage is Windows 1251 but it is doesn't matter). I

  • Paste a paragraph in Photoshop

    I am trying to copy and paste a paragraph and only get a single line and not the paragraph here are the steps I take: - Copy text - select text tool - drag text box - paste text I get all the words but bunched in one line. I have tried selecting the

  • What is the Status of CAR 136677?

    Is CAR 136677 on a 'Dead Bugs' list? I, like others before me, am now in a situation where this bug is a major obstacle to my development.  I have a project using multiple cRIO chassis and need to display/control the remote panels of each on a single