Nesting of two tables

Hey,
Is it possible to nest two tables?

Suhas Saha wrote:
>
> What Yuri is suggesting is the old "Parallel Cursor" technique
>
> Imho nested LOOPs can be handled easily (& elegantly) using SORTED / HASHED tables. Read the SAP documentation on the optimization of the WHERE condition in LOOPs for further details.
>
> BR,
> Suhas
I explicitly did not advise to sort the table with report source code to avoid possible destroy of the coding lines order. Not because I forgot about loops on sorted tables

Similar Messages

  • Join two tables to one recordset with nested table?

    Hello all!
    I want to "de-normalize" two tables into one for presentation reasons. For example:
    CREATE TABLE foo(id number)
    CREATE TABLE bar(foo_id number, value varchar2(4))
    And with some data:
    FOO:
    1
    2
    BAR:
    1, 'gaz'
    1, 'boz'
    2, 'blah'
    Now I want to create a view that holds the value of the BAR table in a nested table, if possible and efficient enough..
    VIEW:
    1, nested_table('gaz,'boz')
    2, nested_table('blah')
    Any clue for creating such a view? I would prefer a view, because this view will be joined with other tables later.
    Thanks in advice!

    Or
    SQL> with foo as
      2  ( select 1 id from dual union all
      3    select 2 id from dual
      4  ),
      5  bar as
      6  (
      7    select 1 foo_id, 'gaz'  value from dual union all
      8    select 1 foo_id, 'boz'  value from dual union all
      9    select 2 foo_id, 'blah' value from dual
    10  )
    11  --
    12  --
    13  select id,
    14         cast(multiset((select value from bar where id=foo_id)) as sys.dbms_debug_vc2coll) value
    15    from foo
    16  /
            ID VALUE
             1 DBMS_DEBUG_VC2COLL('gaz', 'boz')
             2 DBMS_DEBUG_VC2COLL('blah')or from 10g on
    SQL> with foo as
      2  ( select 1 id from dual union all
      3    select 2 id from dual
      4  ),
      5  bar as
      6  (
      7    select 1 foo_id, 'gaz'  value from dual union all
      8    select 1 foo_id, 'boz'  value from dual union all
      9    select 2 foo_id, 'blah' value from dual
    10  )
    11  --
    12  --
    13  select id,
    14         cast(collect(value) as sys.dbms_debug_vc2coll) value
    15    from foo, bar
    16    where id=foo_id
    17    group by id
    18  /
            ID VALUE
             1 DBMS_DEBUG_VC2COLL('gaz', 'boz')
             2 DBMS_DEBUG_VC2COLL('blah')Edited by: michaels2 on Oct 8, 2008 2:27 PM

  • Error in Smartform:  Nested output of tables is not possible....

    Hi ,
      I am getting the below error while executing the smartform.
    Nested output of tables is not possible
    Message ID: SSFCOMPOSER
    Message Numer : 171
    could any one plese help me?
    Thanks & Regards,
    surendra

    Dear
    AS i reply in thread ,
    this error comes  with  some problem in functional Module .
    as we know that two FM use in smartforms -
    SSF_function_mudule
    call   funcion .
    so you check both and  i hope you handle this problem .
    Regards,
    Ravi

  • How to compare substring in two tables fields

    Hi ABAP expert,
    When I want to select database two tables, we just want to compare two table substring. For Example, both fields have yyyymmdd. But I have interested yyyymm. In the Oracle database and SQL server database, I can easily to use substr to achieve those goals. How in the ABAP program to archive those goals.
    Thanks in advance,
    Cliff Fan

    Hi you can access substrings in ABAP the following way:
    data: s type string value 'yyyymmdd'.
    write: / s(6). "yyyymm
    write: / s+4(4). "mmdd
    so the number after '+' determines the position in the string and the number in parenthesis () determines the length of the substring.
    Now you can just loop over both of your tables and perform the necessary comparison in the nested loop.

  • Loading two tables at same time with SQL Loader

    I have two tables I would like to populate from a file C:\my_data_file.txt.
    Many of the columns I am loading into both tables but there are a handful of columns I do not want. The first column I do not want for either table. My problem is how I can direct SQL Loader to go back to the first column and skip over it. I had tried using POSITION(1) and FILLER for the first column while loading the second table but I got THE following error message:
    SQL*Loader-350: Syntax error at line 65
    Expecting "," or ")" found keyword Filler
    col_a Poistion(1) FILLER INTEGER EXTERNALMy control file looks like the following:
    LOAD DATA
    INFILE 'C:\my_data_file.txt'
    BADFILE 'C:\my_data_file.txt'
    DISCARDFILE 'C:\my_data_file.txt'
    TRUNCATE INTO TABLE table_one
    WHEN (specific conditions)
    FIELDS TERMINATED BY ' '
    TRAILING NULLCOLS
    col_a FILLER INTEGER EXTERNAL,
    col_b INTEGER EXTERNAL,
    col_g FILLER CHAR,
    col_h CHAR,
    col_date DATE "yyyy-mm-dd"
    INTO TABLE table_two
    WHEN (specific conditions)
    FIELDS TERMINATED BY ' '
    TRAILING NULLCOLS
    col_a POSITION(1) FILLER INTEGER EXTERNAL,
    col_b INTEGER EXTERNAL,
    col_g FILLER CHAR,
    col_h CHAR,
    col_date DATE "yyyy-mm-dd"
    )

    Try adapting this for your scenario.
    tables for the test
    create table test1 ( fld1 varchar2(20), fld2 integer, fld3 varchar2(20) );
    create table test2 ( fld1 varchar2(20), fld2 integer, fld3 varchar2(20) );
    control file
    LOAD DATA
    INFILE "test.txt"
    INTO TABLE user.test1 TRUNCATE
    WHEN RECID = '1'
    FIELDS TERMINATED BY ' '
    recid filler integer external,
    fld1 char,
    fld2 integer external,
    fld3 char
    INTO TABLE user.test2 TRUNCATE
    WHEN RECID <> '1'
    FIELDS TERMINATED BY ' '
    recid filler position(1) integer external,
    fld1 char,
    fld2 integer external,
    fld3 char
    data for loading [text.txt]
    1 AAAAA 11111 IIIII
    2 BBBBB 22222 JJJJJ
    1 CCCCC 33333 KKKKK
    2 DDDDD 44444 LLLLL
    1 EEEEE 55555 MMMMM
    2 FFFFF 66666 NNNNN
    1 GGGGG 77777 OOOOO
    2 HHHHH 88888 PPPPP
    HTH
    RK

  • Not saving the data in two tables

    Hello,
    its my production problem, i have an update form where you can update the records and these
    records will sit in the temp tables until the final approval from the supervisor.
    In this update form i have two table where i am saving the data one is dup_emp to save the
    officer data and another is the dup_address to save the officer where he worked data.
    in this form address form is pop up screen where you can update and gets back to the original
    form where you can see all the other fields. my problem is if a user hit the cancel button on
    address form example the user doesnt want to update any information on that screen so user
    cancel that screen, and comes to the other screen where the user makes the changes to the
    appropriate fields and hits the SAVE button. in this case its saving only to the dup_emp table
    data not the address data from the address form to dup_address table for the same record.
    if the user cancels in both the screens cancel button it should delete the record from both the
    tables but cancel in form and saves in another form it should save the record in both the
    tables.
    here is my code from both cancel buttons from both the forms.
    this is code is from address form cancel button.
    delete from dup_address
    where address_id=:address_id
    and parent_table_name='emp';
    commit;
    CLEAR_BLOCK;
    go_block('DUP_EMP');
    This code is from dup form of the cancel button
    declare
    temp_address_id varchar2 (12);
    begin
    delete from dup_emp
    where secondemp_id =:dup_emp.secondemp_id;
    delete from dup_address
    where parent_t_id=:global.secondemp
    and parent_table_name='emp';
    commit;
    clear_block;
    go_block('secondaryemp');
    END;

    Hi,
    As Aravind mentioned, it's nothing related to workflow. You have to find a BADI in tcode PA30 that could be used after the infotype is updated. So, you can use FM SAVE_TEXT.
    Regards,

  • Leave a distinct value in a materialized view on two tables

    Hi and thank you for reading,
    I have the following problem. I am creating a materialized view out of two tables, with "where a.id = b.id".
    The resulting materialized view list several values twice. For example, one customer name has several contact details and thus the customer name is listed several times. Now I would like to join each customer name with just ONE contact detail, how can I do that? (Even if I would loose some information while doing this).
    Thanks
    Evgeny

    Hi,
    You can do this
    SELECT   deptno, empno, ename, job, mgr, hiredate, sal, comm
        FROM emp_test
    ORDER BY deptno;
        DEPTNO      EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM
            10       7782 CLARK      MANAGER         7839 1981-06-09       2450          
            10       7839 KING       PRESIDENT            1981-11-17       5000          0
            10       7934 MILLER     CLERK           7782 1982-01-23       1300          
            20       7566 JONES      MANAGER         7839 1981-04-02       2975          
            20       7902 FORD       ANALYST         7566 1981-12-03       3000          
            20       7876 ADAMS      CLERK           7788 1987-05-23       1100          
            20       7369 SMITH      CLERK           7902 1980-12-17        800          
            20       7788 SCOTT      ANALYST         7566 1987-04-19       3000          
            30       7521 WARD       SALESMAN        7698 1981-02-22       1250        500
            30       7844 TURNER     SALESMAN        7698 1981-09-08       1500          
            30       7499 ALLEN      SALESMAN        7698 1981-02-20       1600        300
            30       7900 JAMES      CLERK           7698 1981-12-03        950          
            30       7698 BLAKE      MANAGER         7839 1981-05-01       2850          
            30       7654 MARTIN     SALESMAN        7698 1981-09-28       1250       1400
    14 rows selected.
    SELECT CASE
              WHEN ROW_NUMBER () OVER (PARTITION BY deptno ORDER BY empno) =
                                                                         1
                 THEN deptno
           END deptno,
           empno, ename, job, mgr, hiredate, sal, comm
      FROM emp_test;
        DEPTNO      EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM
            10       7782 CLARK      MANAGER         7839 1981-06-09       2450          
                     7839 KING       PRESIDENT            1981-11-17       5000          0
                     7934 MILLER     CLERK           7782 1982-01-23       1300          
            20       7369 SMITH      CLERK           7902 1980-12-17        800          
                     7566 JONES      MANAGER         7839 1981-04-02       2975          
                     7788 SCOTT      ANALYST         7566 1987-04-19       3000          
                     7876 ADAMS      CLERK           7788 1987-05-23       1100          
                     7902 FORD       ANALYST         7566 1981-12-03       3000          
            30       7499 ALLEN      SALESMAN        7698 1981-02-20       1600        300
                     7521 WARD       SALESMAN        7698 1981-02-22       1250        500
                     7654 MARTIN     SALESMAN        7698 1981-09-28       1250       1400
                     7698 BLAKE      MANAGER         7839 1981-05-01       2850          
                     7844 TURNER     SALESMAN        7698 1981-09-08       1500          
                     7900 JAMES      CLERK           7698 1981-12-03        950          
    14 rows selected.Edited by: Salim Chelabi on 2009-09-14 08:13

  • Need help to join two tables using three joins, one of which is a (between) date range.

    I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
    the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
    ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
    [ABCTABLE]
    ABCORDER
    ABCPART
    ABCSERIAL
    ABCDATE
    [ZYXTABLE]
    XYZORDER
    XYZPART
    XYZSERIAL
    XYZDATE1
    XYZDATE2

    Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
    on this computer. There are no "Null" fields in either of the tables. 
    This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
    [MSORDR]
    MSORDER
    MSPART
    MSSERIAL
    MSOPNDATE
    11111111
    4444444
    55555
    2/4/2015
    22222222
    6666666
    11111
    1/6/2015
    33333333
    6666666
    11111
    3/5/2015
    This table has one order for every part number and every serial number.
    [GLORDR]
    GLORDER
    GLPART
    GLSERIAL
    GLSTARTDATE
    GLENDDATE
    ABC11111
    444444
    55555
    1/2/2015
    4/4/2015
    ABC22222
    666666
    11111
    1/5/2015
    4/10/2015
    AAA11111
    555555
    22222
    3/2/2015
    4/10/2015
    Post Query table
    GLORDER
    MSORDER
    GLSTARTDATE
    GLENDDATE
    MSOPNDATE
    ABC11111
    11111111
    1/2/2015
    4/4/2015
    2/4/2015
    ABC22222
    22222222
    1/5/2015
    4/10/2015
    1/6/2015
    ABC22222
    33333333
    1/5/2015
    4/10/2015
    3/5/2015
    This is the SQL minus the between date join.
    SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
    FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART);

  • Union two tables with diffrent count of fields with null and float value

    Hello,
    i want to union two tables, first one with 3 fields and second one with 4 fields (diffrent count of fields).
    I can add null value at end of first select but it does not work with float values in second table. Value form second table is convert to integer.
    For example:
    select null v1 from sessions
    union
    select 0.05 v1 from sessions
    result is set of null and 0 value.
    As workaround i can type:
    select null+0.0 v1 from sessions
    union
    select 0.05 v1 from sessions
    or simple change select's order.
    Is any better/proper way to do this? Can I somehow set float field type in first select?
    Best regards,
    Lukasz.
    WIN XP, MAXDB 7.6.03

    Hi Lukasz,
    in a UNION statement the first statement defines the structure (number, names and types of fields) of the resultset.
    Therefore you have to define a FLOAT field in the first SELECT statement in order to avoid conversion to VARCHAR.
    Be aware that NULL and 0.0 are not the same thus NULL+0.0 does not equal NULL.
    In fact NULL cannot equal to any number or character value at all.
    BTW: you may want to use UNION ALL to avoid the search and removal of duplicates - looks like your datasets won't contain duplicates anyhow...
    Regards,
    Lars

  • One table in ms access----- data migration ----- oracle two tables

    Hi,
    we are try to migrate from ms access to oracle.
    Ms access has patient table
    PATIENT_FNAME
    PATIENT_LNAME
    PATIENT_MNAME
    PATIENT_ADDRESS1
    PATIENT_ADDRESS2
    PATIENT_ADDRESS3
    PATIENT_SUBURB
    PATIENT_STATE
    PATIENT_POSTCODE
    PATIENT_COUNTRY
    PATIENT_PHONE
    PATIENT_MOBILE
    PATIENT_SEX
    PATIENT_DOB
    DIAGNOSIS_REV
    RECEIVED_THAL
    RECEIVED_STC
    RECEIVED_BORTEZOMIB
    DIAGNOSIS_OTHER
    DIAGNOSIS_THAL
    DIAGNOSIS_THAL_RR_MM
    DIAGNOSIS_THAL_UNTREATED_MM
    DIAGNOSIS_THAL_ENL
    DIAGNOSIS_THAL_NONAPPROVED
    DIAGNOSIS_THAL_OTHER
    PRESCRIBER_ID foreign key
    PRESCRIBER_FNAME
    PRESCRIBER_LNAME
    PRESCRIBER_MNAME
    PRESCRIBER_ADDRESS1
    PRESCRIBER_ADDRESS2
    PRESCRIBER_ADDRESS3
    PRESCRIBER_DEPARTMENT
    PRESCRIBER_ATTENTION
    PRESCRIBER_SUBURB
    PRESCRIBER_STATE
    PRESCRIBER_POSTCODE
    PRESCRIBER_COUNTRY
    PRESCRIBER_PHONE
    PRESCRIBER_FAX
    DATE_PRESCRIBER_SIGNED
    DATE_PATIENT_SIGNED
    DATE_APPROVED
    DATE_RECEIVED
    PROCESSED_BY
    PATIENT_ID primary key
    COMMENTS
    UPIN
    SIGNED_BY
    PATIENT_REP_NAME
    IACCESS_STATUS
    PRESCRIBER_RN
    QUESTION_1
    QUESTION_2
    QUESTION_3
    QUESTION_4
    QUESTION_5
    QUESTION_6
    QUESTION_7
    QUESTION_8
    QUESTION_9
    QUESTION_10
    QUESTION_11
    QUESTION_12
    PRESCRIBER_SIGNED
    NOTIFICATION_UPIN
    WOCBP
    FOLLOWUP_REQUIRED
    FOLLOWUP_NOTES
    FOLLOWUP_STATUS
    REV_THAL
    DATE_DEACTIVATED
    DEACTIVATE_REASON
    VERIFIED
    VERIFIED_BY
    REGISTERED_REVLIMID
    REGISTERED_THALIDOMIDE
    FILE_NAME
    In oracle  they divieded into two tables
    SQL> desc tbl_patient
    Name
    PATIENT_ID primary key
    PATIENT_NAME_FIRST
    PATIENT_NAME_LAST
    PATIENT_MIDDLE_INITIAL
    PATIENT_GENDER
    PATIENT_DOB
    SQL> desc tbl_patient_prescriber
    Name
    PATIENT_ID foreign key
    PRESCRIBER_ID primary key
    PRESCRIBER_NAME_FIRST
    PRESCRIBER_NAME_LAST
    PRESCRIBER_MIDDLE_INITIAL
    First i can load the datas into tbl_patient.
    How to insert the datas to tbl_patient_prescriber If it's null values and repeated values are there in ms access or staging table.

    I am seeing, perhaps three tables here.
    Patient -
    Patient_id (PK)
    first_name,
    last_name,
    Other attributes
    Prescriber -
    Prescriber_id (PK)
    first_name,
    last_name
    Other attributes
    Patient_prescriber -
    Patient_id (FK-PK)
    Prescriber_id (FK-PK)
    meds_order_id (PK)
    Other patient_prescriber attributes.

  • How to join two tables and get the supply delivery date next to order?

    So there are two tables. One has customer's order no, ordered date, order quantity, available quantity and code of article-
    The other table comes form supply side where we have supply order no, article number, ordered qty, and delivery date.
    We keep stock so this can not be MOT (made to order) system.
    What i need is correct date of arrival to appear next to cusotmers spoecirfic order. The older cusotmers order get's the parts first, second oldest order is next in line etc.
    here is any example
    customer's order
    ref order
    art. code
    ordered qty
    available qty
    order date
    1809202491
    700497
    60
    0
    3.7.2014
    1809200528
    700497
    13
    0
    20.6.2014
    1809198640
    700497
    7
    0
    9.6.2014
    supply order
    supply order
    art. code
    qty orderd
    date of arrival
    4501243378
    700497
    50
    4.8.2014
    4501263437
    700497
    20
    6.10.2014
    There is actually a 3rd "table" and that sort of connects the two and that is stock on hand per art. code.
    The main issue is that stock is assigned to purchase orders only when it actually arrives in the warehouse.
    A human can easilly connect the dates of when the stock will arrive and quantities with correct customer's order. In this case the firts order will get 50 pcs in August while 10 pcs will remain on backorders. The missing 10 pcs Will arrive in October. The second order will get 10 pcs in october and 3 will remain on backorders with no delivery date. While the third customer orders does not have a delivery date.
    So how to make the SAP do this calculations and display the arrival date next to date of customer's order?

    I checked the instructions as i do not have access to this part. It seem this is a query. We had issues with queries in the past as not all codes from orders would appear in them. They never found the reason why that is happening.
    However, I think the main issue is that the information here is not connected and is separately provided for supply and for sales. So i doubt it can be connected in this query.
    edit: as you can see the only connection is stock on hand.
    and total number of various items we have is close to 100.000 of various article codes.

  • Unable to generate spool for two tables in report output

    Hi,
    I created report with two custom containers displaying two tables in output. When I execute the report in background spool is created only for one table in top custom container.
    What should be done to generate spool for both the tables in two different custom containers.
    Thanks,
    Abhiram.

    Hi,
    Check the bellow link for your requirement.
    <<link removed>>
    Regards,
    Goutam Kolluru.
    Edited by: kishan P on Feb 2, 2012 1:50 PM

  • Data from two tables in the same row in XML transformation

    Hi,
        I am using XML transformation for generating excel file which is to besent as email attachment.
        Here  I want to display the data from two internal tables in the same row in the excel. .I am using   <tt:loop ref=".<table name>"> ...  </tt:loop> for looping through the table. Can I loop two table simultaneously ? In that case how will I specify the fields in each table . Some of the fields in two tables are of same name and type.
    Please help...
    Thanks,
    Jissa

    Hello Brian,
    Thank you for your answer. It is approach I will use, I think. However let me ask: Would it be possible to have a Version in this layout, too? I mean to see, which value comes from Version A and which comes from Version B? Something like this:
    Calendar Month Version Sales Amount
    2011.01  B  200
    2011.02  B  300
    2011.03  A  260
    2011.04  A  230
    2011.05  A  200
    A

  • How to compare two tables data...need sql report or utility to find differe

    Hi,
    We have a requirement where we are asked to find data differences between two tables and one of the tables reside on remote database. The database version is same ( 10g ) and datatypes for the tables are similar.
    The client is looking for a sql report or kind of utility to display the data differences for each column ( if possible count differences ) with some meaningful error messages.
    Could anyone let me know the best possible way of doing it..?
    Thanks
    Hitarth

    Hi,
    I found something for tables comparison but getting one error...can you check this please and let me know what is wrong
    Here is the function:
    CREATE OR REPLACE FUNCTION compare_query_results (
    p_query1 IN VARCHAR2
    , p_query2 IN VARCHAR2
    , p_raise_error_if_not_equal IN BOOLEAN DEFAULT FALSE
    , p_raise_error_if_no_rows IN BOOLEAN DEFAULT FALSE
    RETURN NUMBER
    IS
    -- Constants
    c_query_results_equal CONSTANT PLS_INTEGER := 0;
    c_query_results_not_equal CONSTANT PLS_INTEGER := 1;
    oracr CONSTANT VARCHAR2 (1) := CHR (10);
    -- Variable Declaration
    v_sql_stmt VARCHAR2 (32767);
    v_record_count PLS_INTEGER;
    v_return_code PLS_INTEGER;
    v_record DUAL.dummy%TYPE;
    v_result_set_has_rows BOOLEAN;
    -- Ref Cursors
    v_cursor sys_refcursor;
    -- Custom Defined-Exceptions
    result_sets_do_not_match EXCEPTION;
    query_returns_no_rows EXCEPTION;
    BEGIN
    -- Get the count of differing records between p_query1 and p_query2
    dbms_output.put_line('Start-1');
    v_sql_stmt :=
    ' (SELECT /*+ materialize */'
    || SUBSTR (p_query1, INSTR (UPPER (p_query1)
    , 'SELECT'
    , 1
    , 1
    ) + 6)
    || ')
    , (SELECT /*+ materialize */'
    || SUBSTR (p_query2, INSTR (UPPER (p_query2)
    , 'SELECT'
    , 1
    , 1
    ) + 6)
    || ')
    SELECT ''X''
    FROM (
    (SELECT * FROM test1 MINUS SELECT * FROM test2)
    UNION ALL
    (SELECT * FROM test2 MINUS SELECT * FROM test1)
    dbms_output.put_line('Start-2');
    OPEN v_cursor
    FOR v_sql_stmt;
    dbms_output.put_line('Start-3');
    FETCH v_cursor
    INTO v_record;
    dbms_output.put_line('Start-4');
    v_result_set_has_rows := v_cursor%FOUND;
    dbms_output.put_line('Start-5');
    CLOSE v_cursor;
    dbms_output.put_line('Start-6');
    -- If there are rows - the result sets do NOT match...
    IF v_result_set_has_rows
    THEN
    v_return_code := c_query_results_not_equal;
    IF p_raise_error_if_not_equal
    THEN
    RAISE result_sets_do_not_match;
    END IF;
    -- If there are no rows - the result sets do match...
    ELSIF NOT v_result_set_has_rows
    THEN
    IF p_raise_error_if_no_rows
    THEN
    -- Check to make sure that the queries contain rows if desired...
    v_sql_stmt := 'SELECT ''X''
    FROM (' || oracr || p_query1 || oracr || ')';
    OPEN v_cursor
    FOR v_sql_stmt;
    FETCH v_cursor
    INTO v_record;
    IF v_cursor%NOTFOUND
    THEN
    CLOSE v_cursor;
    RAISE query_returns_no_rows;
    END IF;
    CLOSE v_cursor;
    END IF;
    v_return_code := c_query_results_equal;
    END IF;
    RETURN v_return_code;
    EXCEPTION
    WHEN result_sets_do_not_match
    THEN
    raise_application_error (-20101, 'The Queries'' result sets do NOT match. Error returned
    as requested.');
    WHEN query_returns_no_rows
    THEN
    raise_application_error (-20102, 'The Queries'' result sets match, however they contain no
    rows. Error returned as requested.');
    WHEN OTHERS
    THEN
    -- Raise the error
    raise_application_error (-20103
    , 'There is a syntax or semantical error in one or both queries
    preventing comparison.'
    || oracr
    || 'Error Stack :'
    || oracr
    || DBMS_UTILITY.format_error_stack ()
    || oracr
    || 'Error_Backtrace:'
    || oracr
    || DBMS_UTILITY.format_error_backtrace ());
    END compare_query_results;
    I have created two tables ( test1 and test2 ) with few columns and with the same datatypes and executed the above function...I am getting error as folliowing:
    DECLARE
    ERROR at line 1:
    ORA-20103: There is a syntax or semantical error in one or both queries
    preventing comparison.
    Error Stack :
    ORA-00900: invalid SQL statement
    Error_Backtrace:
    ORA-06512: at "ORAOWNER.COMPARE_QUERY_RESULTS", line 53
    ORA-06512: at "ORAOWNER.COMPARE_QUERY_RESULTS", line 121
    ORA-06512: at line 12
    Could someone please help me fixing this error..It would be really appreciated
    Thanks
    Hitarth

  • Creating a relationship between two tables  through configuration manager

    I've just created two tables in the underlying db, each with a primary key and established a primary key - foreign key relationship. I've also created a relationship through stellent and it shows up under the 'Relations' Tab.
    However, when I go to Information Fields > Field Info > Click on my Field > 'Edit' > Enable Option List and Configure > Use the view of one of the tables and click on Dependant Field , I don't see any Relationships defined. What could I have done wrong here?
    Thanks.

    ok...solved...followed metalink note 445363.1 for clarification on the right approach to creating Dependant Choice Lists (DCL).

Maybe you are looking for

  • Upgrading from Premium to Standard and Visa Versa

    Hi all Our upgrading issues rumble on here at my workplace! We currently have 2 machines which are installed with CS2. We have (due to ordering issues - mistakes!) 1 x CS2 - CS5 STANDARD upgrade and 1 x CS5 to CS5.5 PREMIUM upgrade. My question is, i

  • Find my ipod

    so i can't find it. and when i go to mobileme it says i have to set up iCloud.  I don't want to use iCloud. I set it up when I got it to use find my iphone app. Why the heck can't I use mobileme to find it like i used to?

  • Home alarm

    hello, this is my first post here. i am a student and new to labview. last few days i went through lots of basic tutorial. my plane is to make a full home automation system (not for my college project) with heating control and lights and buglar alarm

  • Worst service I've ever dealt with

    I ordered a msi gs70 stealth pro on July 1st eta was July 10th. I happen to receive a text saying my order was canceled on the 6th so I called customer service. I spoke to a lady who kept attempting to convince me that I canceled my order. Refusing t

  • Disk utility intermittently reports corrupt disk

    As a matter of routine maintenance I like to "Verify Disk" in disk utility from time to time. The issue I am having is that disc utility intermittently identifies that the Server drive is corrupt and needs to be repaired. Here is a typical sequence: