Datatype-Name for multiple rows return

Hi
If I return multiple rows says ex:100 rows then what will be data type for that return values...

Using PL/SQL Collections and Records
Using Ref Cursors To Return Recordsets

Similar Messages

  • Return Code - Query for Multiple Rows as XML

    Hi,
    I'm executing an MSSQL stored procedure through the "Query for Multiple Rows as XML" activity in LiveCycle ES. I do this through a call statement such as this:
    { call MyStoredProc(?) }
    This works great, the stored procedure always returns a record set (with or without records). I use this activity rather than "Call Stored Procedure" because I can transform the record set into XML right away within this activity. Unfortunately any exception arising from invoking this stored procedure cannot be handled within the workflow as this activity does not have an exception handler (lightning bolt). In an attempt to handle at least some exceptions we have decided to use try/catches within the stored procedures and return different error codes. Now the problem I am faced with is that there is no way to retrieve the returned code within any of the SQL activities. We don't want to have to write an execute script for each of these SQL calls. Is there any way to do this? Seems like I'm 95% there.
    Thanks
    Nic

    Thanks for the offer, unfortunately we would need something certified by Adobe.
    Nic

  • [Forum FAQ] How do I send multiple rows returned by Execute SQL Task as Email content in SQL Server Integration Services?

    Question:
    There is a scenario that users want to send multiple rows returned by Execute SQL Task as Email content to send to someone. With Execute SQL Task, the Full result set is used when the query returns multiple rows, it must map to a variable of the Object data
    type, then the return result is a rowset object, so we cannot directly send the result variable as Email content. Is there a way that we can extract the table row values that are stored in the Object variable as Email content to send to someone?
    Answer:
    To achieve this requirement, we can use a Foreach Loop container to extract the table row values that are stored in the Object variable into package variables, then use a Script Task to write the data stored in packages variables to a variable, and then set
    the variable as MessageSource in the Send Mail Task. 
    Add four variables in the package as below:
    Double-click the Execute SQL Task to open the Execute SQL Task Editor, then change the ResultSet property to “Full result set”. Assuming that the SQL Statement like below:
    SELECT   Category, CntRecords
    FROM         [table_name]
    In the Result Set pane, add a result like below (please note that we must use 0 as the result set name when the result set type is Full result set):
    Drag a Foreach Loop Container connects to the Execute SQL Task. 
    Double-click the Foreach Loop Container to open the Foreach Loop Editor, in the Collection tab, change the Enumerator to Foreach ADO Enumerator, then select User:result as ADO object source variable.
    Click the Variable Mappings pane, add two Variables as below:
    Drag a Script Task within the Foreach Loop Container.
    The C# code that can be used only in SSIS 2008 and above in Script Task as below:
    public void Main()
       // TODO: Add your code here
                Variables varCollection = null;
                string message = string.Empty;
                Dts.VariableDispenser.LockForWrite("User::Message");
                Dts.VariableDispenser.LockForWrite("User::Category");
                Dts.VariableDispenser.LockForWrite("User::CntRecords");     
                Dts.VariableDispenser.GetVariables(ref varCollection);
                //Format the query result with tab delimiters
                message = string.Format("{0}\t{1}\n",
                                            varCollection["User::Category"].Value,
                                            varCollection["User::CntRecords"].Value
               varCollection["User::Message"].Value = varCollection["User::Message"].Value + message;   
               Dts.TaskResult = (int)ScriptResults.Success;
    The VB code that can be used only in SSIS 2005 and above in Script Task as below, please note that in SSIS 2005, we should
    change PrecompileScriptIntoBinaryCode property to False and Run64BitRuntime property to False
    Public Sub Main()
            ' Add your code here
            Dim varCollection As Variables = Nothing
            Dim message As String = String.Empty
            Dts.VariableDispenser.LockForWrite("User::Message")
            Dts.VariableDispenser.LockForWrite("User::Category")
            Dts.VariableDispenser.LockForWrite("User::CntRecords")
            Dts.VariableDispenser.GetVariables(varCollection)
            'Format the query result with tab delimiters
            message = String.Format("{0}" & vbTab & "{1}" & vbLf, varCollection("User::Category").Value, varCollection("User::CntRecords").Value)
            varCollection("User::Message").Value = DirectCast(varCollection("User::Message").Value,String) + message
            Dts.TaskResult = ScriptResults.Success
    End Sub
    Drag Send Mail Task to Control Flow pane and connect it to Foreach Loop Container.
    Double-click the Send Mail Task to specify the appropriate settings, then in the Expressions tab, use the Message variable as the MessageSource Property as below:
    The final design surface like below:
    References:
    Result Sets in the Execute SQL Task
    Applies to:
    Integration Services 2005
    Integration Services 2008
    Integration Services 2008 R2
    Integration Services 2012
    Integration Services 2014
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • How to run a select count(*) with multiple rows returned

    Hi,
    I have to run a select count(*) for different reports.
    1) Select count(*) from table
    where state = 'CA'
    2) Select count(*) from table
    where state = 'NY'
    3) Select count(*) from table
    where state = 'NV'
    Instead of running this query again for 50 times, is there a way for me to just put it in one query and get multiple row returns? Thank you.

    Samantha wrote:
    Hi,
    I have to run a select count(*) for different reports.
    1) Select count(*) from table
    where state = 'CA'
    2) Select count(*) from table
    where state = 'NY'
    3) Select count(*) from table
    where state = 'NV'
    Instead of running this query again for 50 times, is there a way for me to just put it in one query and get multiple row returns? Thank you.select state, count(*) from table group by state order by 1;

  • Formula to calculate SUM of multiple sheets of excel and the result to be stored in another excel sheet and pop up alerts for multiple rows

    I have a excel with multiple
         sheets with data as shown below
    SHEET 1
    A 1
    B 2
    C 3
    SHEET 2
    B 1
    C 2
    A 3
    SHEET 3
    C 1
    A 2
    B 3
    My
    query is splitted into 3 categories
    I want to have a formula to do math calculation such that data of "A" of SHEET 1 is  calculated with "A" of SHEET2 irrespective of the location of "A".
    When I include SHEET3, the formula should automatically identify the location of "A" or "B" or "C" and give the result corresponding to A, B or C. Since I want to bifurcate daily report and output printed. I want to use another
    excel for output. How to link multiple sheets of one excel and print the output of above in
         another excel?
    Assume, I have 4 SHEETS,  "SHEET 1", "SHEET 2", "SHEET 3" and "SHEET 4". Math calculation need to be done using all 4 sheets. If
    I include "SHEET 5", the formula should ignore SHEET 1  automatically and give the results of SHEETS 2 to 5. Similarly, if I include SHEET 6, SHEET 1 and 2 need to be ignored for further calculation and SHEET 3-6 need to be used. How to write
    such formula?
    How to get pop up alert for multiple rows, if a specific condition is hit?

    Maybe VBA Code should be a good option for you. I suggest you post you issue to
    Excel for Developers forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Best Regards,
    Wind

  • Calling a stored procedure for each row returned

    I need to call a stored procedure for each row returned by a repeating frame. I called the stored procedure from the repeating frame format trigger, but that did not work( it did no populated the tables populated by the stored procedure)
    How can I call a stored procedure for each row returned by a repeating frame.
    Thank you

    Include it as a formula column in your data model.

  • Can I use Concatenate function for multiple rows?

    I have a lead list that contains 5000 leads. The format of this list contains address data that is saved in separate columns (ie: address, address 2, city, state, zip). I need this data in 1 column. I tried to use the concatenate function to combine the data for 1 row and it worked perfectly. I tried to do this for multiple rows and the function is greyed out. Is there a work around or way that I can combine this data for all 5000 rows without doing it 1 by one?

    Look at this table;
    In B9, the formula is;
    =B2&" "&C2&" "&D2&" "&E2&" "&B3&" "&C3&" "&D3&" "&E3
    Yvan KOENIG (VALLAURIS, France) dimanche 18 octobre 2009 20:51:47

  • Query for Multiple Rows as XML

    Ok I've seen this topic in the forums, but have failed to get this to work within my process. Basically I have a process that has a user fill out a form, and upon submittal the form writes it's information to a database (via a data connection within the form that invokes a separate process upon submittal.), once this is done the main process is invoked and it's first step is to query that same database and bring back the data in a lower (now exposed) portion of the form that contains certain fields that track the issue history. The query brings back the xml document and I store it in an xml variable (xml_output). I then take this information and use the Set Value object to assign the returned nodes values to the location fields in the form. This works if the query returns only one row. But once the form is moved beyond the initial Task Assignment, (first user), and query returns more than just one row, the added nodes to not show up on the form, i.e I still just get information about the first row in my form. From what I've read the form should be able to recognize the xpath expression, and bring back all the nodes, by in a sense using instance manager to create an instance for each node on the form. My question is how can I get this to work. Jasmin if your still out there... Help!
    Also We're using Adobe LiveCycle ES 8.0
    created the process using Workbench
    the form was reader enabled and saved as a dynamic PDF.
    Thanks
    Mike

    Ok have done the binding of the schema to the form, and I'm getting the information to flow as it's supposed to.  The problem I'm having now, (I know I'm having a bunch.) is that once I've placed the form into my process, and I use the set value operation to pre-fill information I get the form to flow, but the rest of the information that was previously filled in is blank.  So I have checked the variable and nothing wrong there.  It appears the problem is how I'm using the set value operation.  If I don't use the set value operation, the form retains it's information.  And if I use the set value by trying to set the subform value, the form retains it's information, but no pre-fill.  I'm going to try to be a little more detailed here.  The xml that is returned looks like this:
            0016-03-30
            Mike
            Public Works
            alone in the dark
            Type sleep
            -1
            Council
            FYI
            Important
    Flowed and positioned are actual subforms on the form that have their properties set as their names indicates.  The entire path is /form1/Page1/flowed/positioned .  The way I was able to get the form to flow correctly upon the injection of this xml data, was to bind the subforms in the form in this manner, positioned[*].  Designer didn't place the [*] for me so I had to do this myself.  But once I previewed the document, the form pre-populated and created the necessary number of subforms and placed information into the fields correctly.
    Now on the process side, I have created an xfaform variable that stores the form (bound to xsd.)  information, and another xml variable that stores the query return that looks like the xml listed above (has an xsd associated with it for navigating xpath).  My first operation performs the query (JDBC- Query Multiple Rows as XML) and stores it into the xml variable.  The next step of the process is the Set Value operation which is supposed to inject the xml data retrieved from the query into the form.  Initially I tried the an xpath similar to the following:
    /process_data/object/data/form1/page1/flowed/positioned = /xml_data/flowed/positioned.
    No dice.  On this one the form retains the information filled out by the user (didn't explain this earlier, the form is filled out first, and upon submittal the process starts.), but doesn't pre-populate the bottom part of the form.  Next I tried the following xpath:
    /process_data/object/data/form1/page1/flowed = /xml_data/flowed/positioned.
    This time it retained the form information which was filed in by the user, but the bottom part is becomes hidden!  Didn't understand this.  But I started to kinda think that I had to navigate he xpath in order to correctly inject the xml into the form.  That being said my next attempt was:
    /process_data/object/data/form1/page1 = /xml_data
    My thinking was that if on location, I stop at page1, the xml in the variable will allow it to navigate correctly through the form.  Well it worked, but too well.  The top part of the form is blank, but the bottom portion is pre-populated correctly.  Now I'm stuck.  Not sure how to get the rest of the information in the form.  I thought about creating variables form each of the fields and then re-populating them after the injection of xml, but that didn't seem practical.  I'm almost positive it's something I'm not doing correctly with xpath.  Anyway, thanks for all your help on this.
    Mike

  • Password Masking & Background Color for Multiple Rows in Tabular Form

    Hi all,
    I have a requirement of making a column in Tabular form, having multiple rows, masked(password field). I also want to give bg color to this field indicating that its a mandatory field.
    I am unable to accomplish both at a time in my page. I am using Apex 3.2.
    Waiting for your valuable comments. Thanks,
    Regards,
    Sandeep

    APEX_ITEM API doesnot have a password function, but input fields of type password are available in HTML.
    So you would have to change the field type to password in JS
    That is from :
    <input type="text" ...change it to
    <input type="password" ...If you were using jQuery it would have been simpler, but to do it in native JS it is a bit more hard work.
    Anyway here goes (a quick check in a tabular form seens to work fine)
    var password_array=document.getElementsByName("f04");
    for(var i=0;i<password_array.length;i++)
       password_array.type = 'password';
    password_array[i].style.backgroundColor = 'RED';
    +Replace the "f04" with your password field's array name(use firebug to identify the field name)+
    Does that solve your problem ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Oracle Query failing for multiple rows:

    Hey Guys,
    I have been given a task to produce an ad-hoc report based on the following conditions (I will give you the structure of the table and details in the table below the requirements)
    Requirements: Adhoc Report for Audit on CIT Income Allocation
    1. Select from the RETURNS table:
    • Id > 3600000 and
    • Prog_program_cd = '01' and
    • Return_status in ('ASSESSED', 'DU") and
    • Tax year ending in 2009 (i.e. year portion of the Period_end_date is in 2009)
    2. Retrieve the following fields from the RETURNS table :
    • Id
    • Entp_abn
    • Acct_id
    • Prog_program_cd
    • Period_start_date
    • Period_end_date
    • Amend_ind
    • Return_status
    • Status_date
    • Loctr_nbr
    3. If there are multiple entries from the same account and tax year, only retain the latest record: From the records selected in step 2, if there are multiple records with the same Acct_Id and Period_end_date, only retain the record with the most recent Status_date (i.e. MAX value on the date).
    4. Using the results from step 3, link to the applicable RETURN_LINE_ITEMS table where:
    • RETURNS.Id = RETURN_LINE_ITEMS.Rtrn_Id
    5. From the selected return on RETURN_LINE_ITEMS table, retrieve records where (value on Sch 000 Line 062 > 500,000) and (value on Sch 000 Line 066 < value on Sch 000 Line 062) :
    • Sched_nbr = '000', and Litm_line_item_nbr = '062', and Active_ind = 'Y', get Revise_val_amt as 'ab_taxable_income'
    • Sched_nbr = '000', and Litm_line_item_nbr = '066', and Active_ind = 'Y', get Revise_val_amt as 'amt_taxable_in_ab'
    • Retain the return only if (ab_taxable_income > 500,000) and (amt_taxable_in_ab < ab_taxable_income)
    The tables used in this are : RETURNS and RETURN_LINE_ITEMS
    Structure of RETURNS table is:
    ID
    PROG_PROGRAM_CD
    ACCT_ID
    ACPE_ID
    JENT_ID
    PREV_RTRN_ID
    ENTP_ABN
    ACCT_OCCURNC_NBR
    SOURCE_TYPE
    RECEIVE_DATE
    AMEND_IND
    CMPLT_IND
    PENALTY_OR_IND
    RETURN_STATUS
    STATUS_DATE
    STATUS_USERID
    PERIOD_START_DATE
    PERIOD_END_DATE
    NOTICE_STATUS
    NOTICE_STATUS_DATE
    NOTE_TEXT
    PENALTY_OR_BY
    PENALTY_OR_TMST
    FILING_ID
    CASE_ID
    DOC_CONTRL_NBR
    LOCTR_NBR
    STATUTE_BARRED_DATE
    MEDIA_TYPE
    DISPSTN_TYPE
    AMEND_TYPE
    CALC_MODE
    PROCESS_PASS_CNT
    CONVRTD_IND
    LOSS_PERIOD_END_DATE
    MF_SYNC_CD
    CREATED_BY
    CREATED_TMST
    MODIFIED_BY
    MODIFIED_TMST
    Structure of RETURN_LINE_ITEMS is:
    ID
    RTSC_ID
    RTRN_ID
    SCLI_ID
    LITM_ID
    ENTP_ABN
    PROG_PROGRAM_CD
    ACCT_OCCURNC_NBR
    ACPE_END_DATE
    SCHED_NBR
    SCHD_VERSION_YR
    SCHD_VERSION_NBR
    RTSC_OCCUR_NBR
    LITM_LINE_ITEM_NBR
    SLIN_LINE_ITEM_ID
    OCCUR_NBR
    PREV_VAL_MOD_IND
    VIABLE_IND
    ACTIVE_IND
    ACTION_CD
    PREV_VAL_AMT
    REVISE_VAL_AMT
    PREV_VAL_TEXT
    REVISE_VAL_TEXT
    DISPLAY_SEQ_NBR
    SYS_VAL_AMT
    LITM_INNER_PASS_SEQ_NBR
    CREATED_BY
    CREATED_TMST
    MODIFIED_BY
    MODIFIED_TMST
    So scripts to create the able tables are:
    RETURNS
    CREATE TABLE RETURNS
    ID NUMBER(12),
    PROG_PROGRAM_CD VARCHAR2(2 BYTE),
    ACCT_ID NUMBER(12),
    ACPE_ID NUMBER(12),
    JENT_ID NUMBER(12),
    ENTP_ABN NUMBER(9),
    ACCT_OCCURNC_NBR NUMBER(4),
    SOURCE_TYPE VARCHAR2(30 BYTE) DEFAULT 'BLANK',
    RECEIVE_DATE DATE,
    AMEND_IND VARCHAR2(1 BYTE) DEFAULT 'N',
    CMPLT_IND VARCHAR2(1 BYTE) DEFAULT 'N',
    PENALTY_OR_IND VARCHAR2(1 BYTE) DEFAULT 'N',
    RETURN_STATUS VARCHAR2(12 BYTE),
    STATUS_DATE DATE,
    STATUS_USERID VARCHAR2(8 BYTE),
    PERIOD_START_DATE DATE,
    PERIOD_END_DATE DATE,
    NOTICE_STATUS VARCHAR2(12 BYTE),
    NOTICE_STATUS_DATE DATE,
    LOCTR_NBR NUMBER(10),
    MEDIA_TYPE VARCHAR2(30 BYTE),
    DISPSTN_TYPE VARCHAR2(30 BYTE),
    CONVRTD_IND VARCHAR2(1 BYTE) DEFAULT 'N')
    RETURN_LINE_ITEMS
    CREATE TABLE RETURN_LINE_ITEMS
    ID NUMBER(12),
    RTSC_ID NUMBER(12),
    RTRN_ID NUMBER(12),
    LITM_ID NUMBER(12),
    ENTP_ABN NUMBER(9),
    PROG_PROGRAM_CD VARCHAR2(2 BYTE),
    ACCT_OCCURNC_NBR NUMBER(4),
    ACPE_END_DATE DATE,
    SCHED_NBR VARCHAR2(3 BYTE),
    SCHD_VERSION_YR NUMBER(4) DEFAULT 0,
    SCHD_VERSION_NBR NUMBER(3),
    RTSC_OCCUR_NBR NUMBER(3),
    LITM_LINE_ITEM_NBR VARCHAR2(3 BYTE),
    SLIN_LINE_ITEM_ID NUMBER(12),
    OCCUR_NBR NUMBER(3) DEFAULT 1,
    PREV_VAL_MOD_IND VARCHAR2(1 BYTE) DEFAULT 'N',
    VIABLE_IND VARCHAR2(1 BYTE) DEFAULT 'N',
    ACTIVE_IND VARCHAR2(1 BYTE) DEFAULT 'Y',
    PREV_VAL_AMT NUMBER(15,2),
    REVISE_VAL_AMT NUMBER(15,2),
    DISPLAY_SEQ_NBR NUMBER(3),
    SYS_VAL_AMT NUMBER(15,2),
    LITM_INNER_PASS_SEQ_NBR NUMBER(3)
    So when you run the scripts above, the tables are created (I have tested it in TOAD)
    Now let's feed data into both the tables
    RETURNS table:
    insert into RETURNS
    VALUES
    (3602448 , '01' ,288151,3876821,9345370 , 403232531, 1, 'TAXPAYER' ,12/4/2008 ,'N', 'Y','N','ASSESSED', 2/18/2009,'SANDEEP',1/2/2008,1/2/2009,
    'PRINTED','2/18/2009, 6043073664,'PAPER', 'NOTICE','N');
    insert into RETURNS
    VALUES
    (4117092 , '01' ,57794,3864551,10566221 , 400571410, 1, 'TAXPAYER' ,6/30/2010 ,'N', 'Y','N','ASSESSED', 2/18/2009,'SANDEEP',1/2/2008,1/2/2009,
    'PRINTED','2/18/2009, 6043073664,'PAPER', 'NOTICE','N');
    RETURN_LINE_ITEMS table:
    INSERT INTO RETURN_LINE_ITEMS
    VALUES
    (266000770,7749234,3602448,1603,403232531, 01, 1, 1/1/2009, 000, 1998, 1,1, '062', 40,1, 'N','Y', -5440, -5440, 200,-5440,130);
    INSERT INTO RETURN_LINE_ITEMS
    VALUES
    (266000773,7749234,3602448,1539,403232531, 01, 1, 1/1/2009, 000, 1998, 1,1, '066', 43,1, 'N','Y', NULL, 0, 215,0,200);
    INSERT INTO RETURN_LINE_ITEMS
    VALUES
    (319820233,9028477,4117092,1603,400571410, 01, 1, 1/1/2009, 000, 1998, 1,1, '062', 40 ,1, 'N','Y', 790068, 790068, 200,790068,130);
    INSERT INTO RETURN_LINE_ITEMS
    VALUES
    (319820236,9028477,4117092,1539,400571410, 01, 1, 1/1/2009, 000, 1998, 1,1, '062', 40 ,1, 'N','Y', NULL, 790, 215,790068,200);
    This completes the test data.
    Now based on the question posed by the Business Analyst, until "5 b" i.e where it's said:
    Sched_nbr = '000', and Litm_line_item_nbr = '066', and Active_ind = 'Y', get Revise_val_amt as 'amt_taxable_in_ab'
    I am able to retrieve data perfectly fine and the query for that is:
    SELECT r1.id, r1.entp_abn, r1.acct_id, r1.prog_program_cd, r1.period_start_date, r1.period_end_Date, r1.amend_ind, r1.return_status, r1.status_date, r1.loctr_nbr,
    rtlnms.sched_nbr, rtlnms.litm_line_item_nbr,
    decode(rtlnms.litm_line_item_nbr, '062', RTLNMS.REVISE_VAL_AMT)AB_TAXABLE_INCOME,
    decode(rtlnms.litm_line_item_nbr, '066', RTLNMS.REVISE_VAL_AMT)AMT_TAXABLE_IN_AB
    from returns r1, return_line_items rtlnms
    where r1.id = rtlnms.rtrn_id
    and r1.id > 3600000
    AND r1.prog_program_cd = '01'
    AND r1.return_status in ('ASSESSED', 'DU')
    and r1.period_end_Date between to_date('01-01-2009','DD-mm-YYYY') and to_date ('31-12-2009', 'DD-mm-YYYY')
    and r1.status_date = (select max (status_date) from returns r2 where r2. acct_id= r1.acct_id and r2.period_end_date = r1.period_end_date)
    and rtlnms.sched_nbr = '000'
    and RTLNMS.LITM_LINE_ITEM_NBR IN('062', '066')
    and rtlnms.active_ind = 'Y' and r1.id in(4117092, 3602448)
    The out put is : 4 rows returned which has litm_line_item_nbrs for all the returns in question (4117092, 3602448) and that is - 066,062,062, 066 with their respective amounts.
    However against the business analyst's question 5 "C" which is - Retain the return only if (ab_taxable_income > 500,000) and (amt_taxable_in_ab < ab_taxable_income)
    I should be getting 2 rows(one with '062' and '066') with return -4117092
    So I am applying the logic as mentioned by business analyst's "5C" and run the following query:
    SELECT r1.id, r1.entp_abn, r1.acct_id, r1.prog_program_cd, r1.period_start_date, r1.period_end_Date, r1.amend_ind, r1.return_status, r1.status_date, r1.loctr_nbr,
    rtlnms.sched_nbr, rtlnms.litm_line_item_nbr,
    decode(rtlnms.litm_line_item_nbr, '062', RTLNMS.REVISE_VAL_AMT)AB_TAXABLE_INCOME,
    decode(rtlnms.litm_line_item_nbr, '066', RTLNMS.REVISE_VAL_AMT)AMT_TAXABLE_IN_AB
    from returns r1, return_line_items rtlnms
    where r1.id = rtlnms.rtrn_id
    and r1.id > 3600000
    AND r1.prog_program_cd = '01'
    AND r1.return_status in ('ASSESSED', 'DU')
    and r1.period_end_Date between to_date('01-01-2009','DD-mm-YYYY') and to_date ('31-12-2009', 'DD-mm-YYYY')
    and r1.status_date = (select max (status_date) from returns r2 where r2. acct_id= r1.acct_id and r2.period_end_date = r1.period_end_date)
    and rtlnms.sched_nbr = '000'
    and RTLNMS.LITM_LINE_ITEM_NBR IN('062', '066')
    and rtlnms.active_ind = 'Y' and r1.id in(4117092, 3602448)
    and r1.id in (select rtrn2.id
    from returns rtrn2, return_line_items rtlnms2
    where rtrn2.id= rtlnms2.rtrn_id
    and rtrn2.id=r1.id
    and nvl(decode(rtlnms.litm_line_item_nbr, '062', RTLNMS.REVISE_VAL_AMT),0) > 500000 or rtlnms2.litm_line_item_nbr='066') and (
    nvl(decode(rtlnms.litm_line_item_nbr, '066', RTLNMS.REVISE_VAL_AMT),0) < nvl(decode(rtlnms.litm_line_item_nbr, '062', RTLNMS.REVISE_VAL_AMT),0))
    order by r1.acct_id , r1.period_end_date desc
    I am only getting one row with for RETURN = 4117092 with litm_line_item_nbr (line item number) '062' where as I should also be getting line item number '066' along with '062'
    Could any one of you please help me out. I am stuck and have tried everything at the office with no luck.
    Many Many Thanks in Advance!
    Sandeep

    Hi there,
    I agree that without test case it's a bit complicated for you folks to solve. However I just could not. Anyways this is the query that I had to use to come to my solution and that is:
    SELECT r1.id, r1.entp_abn, r1.acct_id, r1.prog_program_cd, r1.period_start_date, r1.period_end_Date, r1.amend_ind, r1.return_status, r1.status_date, r1.loctr_nbr,
    rtlnms.sched_nbr, rtlnms.litm_line_item_nbr,
    decode(rtlnms.litm_line_item_nbr, '062', RTLNMS.REVISE_VAL_AMT)AB_TAXABLE_INCOME,
    decode(rtlnms.litm_line_item_nbr, '066', RTLNMS.REVISE_VAL_AMT)AMT_TAXABLE_IN_AB
    from returns r1, return_line_items rtlnms
    where
    r1.id = rtlnms.rtrn_id and
    r1.prog_program_cd = rtlnms.prog_program_cd and
    r1.entp_abn = rtlnms.entp_abn and
    r1.id > 3600000 AND r1.prog_program_cd = '01' AND r1.return_status in ('ASSESSED', 'DU')
    and r1.period_end_Date between to_date('01-01-2009','DD-mm-YYYY') and to_date ('31-12-2009', 'DD-mm-YYYY')
    and r1.status_date = (select max (status_date) from returns r2 where r2. acct_id= r1.acct_id and r2.period_end_date = r1.period_end_date)
    and rtlnms.sched_nbr = '000'
    and rtlnms.active_ind = 'Y'
    and r1.id in (4117092,3715944,4382179,3691435)
    and RTLNMS.LITM_LINE_ITEM_NBR IN('062')
    AND nvl(decode(litm_line_item_nbr, '062', REVISE_VAL_AMT),0) > 500000
    and NVL(RTLNMS.REVISE_VAL_AMT,0) >( select NVL(RTLNMS2.REVISE_VAL_AMT,0)
    FROM RETURN_LINE_ITEMS RTLNMS2
    WHERE RTLNMS2.RTRN_ID=RTLNMS.RTRN_ID
    AND RTLNMS2.LITM_LINE_ITEM_NBR = '066'
    AND SCHED_NBR='000'
    UNION
    SELECT r1.id, r1.entp_abn, r1.acct_id, r1.prog_program_cd, r1.period_start_date, r1.period_end_Date, r1.amend_ind, r1.return_status, r1.status_date, r1.loctr_nbr,
    rtlnms.sched_nbr, rtlnms.litm_line_item_nbr,
    decode(rtlnms.litm_line_item_nbr, '062', RTLNMS.REVISE_VAL_AMT)AB_TAXABLE_INCOME,
    decode(rtlnms.litm_line_item_nbr, '066', RTLNMS.REVISE_VAL_AMT)AMT_TAXABLE_IN_AB
    from returns r1, return_line_items rtlnms
    where r1.id = rtlnms.rtrn_id
    AND r1.prog_program_cd = rtlnms.prog_program_cd
    AND r1.entp_abn = rtlnms.entp_abn
    AND r1.id > 3600000 AND r1.prog_program_cd = '01'
    AND r1.return_status in ('ASSESSED', 'DU')
    and r1.period_end_Date between to_date('01-01-2009','DD-mm-YYYY') and to_date ('31-12-2009', 'DD-mm-YYYY')
    and r1.status_date = (select max (status_date) from returns r2 where r2. acct_id= r1.acct_id and r2.period_end_date = r1.period_end_date)
    and rtlnms.sched_nbr = '000'
    and rtlnms.active_ind = 'Y'
    and r1.id in (4117092,3715944,4382179,3691435)
    and RTLNMS.LITM_LINE_ITEM_NBR IN('066')
    and NVL(RTLNMS.REVISE_VAL_AMT,0) <( select NVL(RTLNMS2.REVISE_VAL_AMT,0)
    FROM RETURN_LINE_ITEMS RTLNMS2
    WHERE RTLNMS2.RTRN_ID=RTLNMS.RTRN_ID
    AND RTLNMS2.LITM_LINE_ITEM_NBR = '062'
    and NVL(RTLNMS2.REVISE_VAL_AMT,0)>500000
    AND SCHED_NBR='000'
    order by ID
    This above query works fine. No worries.
    One more question and that is:
    I need to find out details of another condition. However what happens is using the same query above, when I try to add "and RTLNMS.LITM_LINE_ITEM_NBR IN('066' ,029')" (in the bold part),
    it does give me another extra value for row 029 and that's something that I don't want. Based on the above results, I get 4 rows ; 2 each for 062 and 069.
    The question asked by business is based on the above results, bring out even values for 029, so which in this case should be 2 rows, making it overall 6, but then I get 7, is there any way to get rid of extra row
    or rather : is there any way to retrieve additional row based on results from a query?

  • ALV Grid Column name in multiple rows

    Hi,
    When ALV Grid is display columns are displayed horizontally in a single line.
    Is there ne way to display the column names in 2 rows
    e.g : Functional Location column should be shown as
         Functional 
          Location

    Hi,
    Actually it is not possible to disaply in multiple lines.
    ALV grid Multiple Header ... ?
    Re: Multiple lines in alv column headings
    This problem was discussed many times in this forum, u can search for more results.
    Message was edited by: Judith Jessie Selvi

  • DB get step: managing multiple row returned from a table

    Hi,
    please can someone tell me if it is possible to manage multiple row when returned in a db get step?
    For example, I execute a SELECT in db read step to read an SQL table which returns two rows. From each row I get two string variables, let's say: "Var1", "Var2".
    Assigning them to local variables, I am able to assign just the 2 variables of the first row, not the variables of the second row.
    I tried to use array as local variables with not success, how can I do?
    Thanks

    mmaddalena,
    You have two options, you can pre populate, or work row by row.
    Prepopulate:
         String[] Var1
         int row
         DBGet Loop:
              DBGet
                   Successful:
                        save to Var1[row]
                        increment row
                        Goto DBGet Loop
                   No data:
                        /* this is the last row */
                        Goto After DB Get Loop
        After DB Get Loop:
              /* do whatever with the data */
    Conversely:
    Row by row:
         String  Var 1
         int row
         DBGet Loop:
              DBGet
                   Successful:
                        /* do whatever with the data */
                        Increment row
                        Goto DBGet Loop
                   No data:
                        /* no more data (last row) */
                        Goto After DB Get Loop
         After DB Get Loop:
              /* do whatever after your done with the data */

  • Multiple row return in Procedure

    I am trying to convert a SQL Server to Oracle 8i. They have a bunch of procedures that return multiple rows. How can this be handled in Oracle?

    In Oracle this is done by using collections. It is really only viable if you are creating packages out of the procedures since you will need to define the type definitions prior to defining the procedure. Here are some hints and a link:
    TYPE rec IS RECORD OF something ;
    TYPE tab IS TABLE OF rec ;
    PROCEDURE getTable (
    p_table_output OUT tab )
    http://technet.oracle.com/doc/oracle8i_816/appdev.816/a77069/04_colls.htm#1059

  • How to disable resize function for multiple rows of inputText?

    I have a multiple rows inputText component like below:
    <af:inputText label="#{ZccToolbarGenBundle['OLabel.TransferNote']}"
    id="it1" autoSubmit="true" columns="150"
    immediate="true" simple="true" rows="5"
    binding="#{transferBean.transferNoteText}"/>
    How can I turn off the resizing icon on the bottom of right hand side of this input text box?
    Thanks for any help.

    Timo, the bug that I filed has been changed to 'not a bug'. The reason of that is 'That correct as it is not a valid CSS style on all browsers'. I sent email to ADF faces team and got following answers: 1. StyleClass that has agent specific setting for this setting. 2. You put the style class in a skin file and reference it. you can not use the inline style notation. It wants a Style Class.
    My question is what kind of StyleClass or skin file do you use so that you can use contentStyle="resize:none;"? Thanks.

  • How to use simple values services for multiple rows ina table

    Hi Frnds...
    As per my requirment i need to use SVS for multile rows in a table.
    The coding goes like this for getting single attribute which is directly under root context.
    objSimpleValueSetCurr = wdContext.getNodeInfo().getAttribute("ctx_attribute");
    (this is only for context attribute directly placed under root context in the view controller.)
    We need to use value node and a value attribute inside this node. And retrieve the same. so need help regarding the code changes.
    Regards,
    Sudeep

    Hi ,
    I had tried out your suggestion. Its not working.
    The code goes like this, but the data is not getting populated.
    "controller_curr" is the value attribute  under the node "InitTable" in the controller which is further mapped to view controller with the same structure.
    The data is geting printed through the message manager just before the line
    divSMT.put(currency,currency); in this code, at the end.
    But "divSMT.put" is not able to populate the data.
    _________START________
    public void currency( )
        //@@begin currency()
              IWDMessageManager msg = wdComponentAPI.getMessageManager();     
              ISimpleTypeModifiable objSimpleTypeCurr = null;
              IModifiableSimpleValueSet objSimpleValueSetCurr = null;
              String currency=null;
              String bandg = null;
              Z_Bapi_Get_Curr_Rate_Input authCurrDet = null; //for FCURR
        Try
    authCurrDet = new Z_Bapi_Get_Curr_Rate_Input();
                         wdContext.nodeZ_Bapi_Get_Curr_Rate_Input().bind(authCurrDet);
                              wdContext.nodeZ_Bapi_Get_Curr_Rate_Input().currentZ_Bapi_Get_Curr_Rate_InputElement().modelObject().execute();     
    IWDAttributeInfo  objSimpleValueSetCurr1 = wdContext.nodeInitTable().getNodeInfo().getAttribute("controller_curr");
    ISimpleTypeModifiable countryType = objSimpleValueSetCurr1.getModifiableSimpleType();
    IModifiableSimpleValueSet divSMT = countryType.getSVServices().getModifiableSimpleValueSet();
    int sizeofCurrencyFCURR = wdContext.nodeOPCURROutput().nodeIt_Curr_Rate().size();
    msg.reportSuccess("SizeofCurrency FCURR : "+sizeofCurrencyFCURR);
    for(int i=0;i<sizeofCurrencyFCURR;i++)
    currency = wdContext.nodeOPCURROutput().nodeIt_Curr_Rate().getIt_Curr_RateElementAt(i).getFcurr();
    msg.reportSuccess("Currency : "+currency);
    divSMT.put(currency,currency);
         catch(Exception e)
    //@@end
    _________END________
    Please look into the issue.
    Regards.

Maybe you are looking for

  • How can I get PDFs from my iBooks to my computer? They are in iBooks

    Hi, I am a new user. I have a couple of questions: 1) How do I transfer files from my iBooks to my computer. I have articles from web-sites that open up in iBooks and need to know how to transfer them to my computer. I am not very familiar with iTune

  • Cost centre with G/L account

    Hi All, I need some information on how system is picking G/L account automatically when i enter cost centre. Where these settings are made. Your help is highly appreciated

  • Can't Split Edit - What Am I Doing Wrong?

    I have placed a clip on the timeline, with space in front and behind (no potential clip colision). From the timeline I double click to open the clip in the viewer. I roll back (or forwards) a few frames from the in-point to set a split, but all the i

  • Mac Pro graphics board

    I have a late 2008 Mac Pro and the graphics board is starting to fail, what can I purchase as replacement or upgrade? Currently have NVIDIA GeForce 8800 GT 512 MB. Cheers Tim

  • Update Z-Tcode in change documents

    Hi All, We have developed a Dialog program which is used to create/change condition records through XK15 BDC. when we update the condition records with Z-tcode change documents are updated with Transaction code(CDHDR-TCODE) as XK15. But we want this