Sql query required

Hi All,
I've two tables Institute and Employee .
Institute
intId name
1 XYZ
2 ABC
Employee
empId emplyName intId deptId          desc
1     X          1 1          xx
2     Y          1 1          xx
3     A          2 2          YY
4     B          2 2          YY
5      C          2 2          YY
How to get the below mentioned result from Institute,Employe tables.
Note : desc is common for each intId
Result
intId Count(deptId) desc
1     2      xx
2 3      yy
Please provide solution for this.
Thanks

UserK wrote:
Ya its giving result, but when add
where intId = 1 condition its giving count 1Somehow, I think you haven't given us all the details we need.
SQL> ed
Wrote file afiedt.buf
  1  with /*Institute as (select 1 as intid, 'XYZ' as name from dual union all
  2                       select 2, 'ABC' from dual),*/
  3       Employee as (select 1 as empid, 'X' as emplyname, 1 as intid, 1 as deptid, 'xx' as dsc from dual union all
  4                    select 2, 'Y', 1, 1, 'xx' from dual union all
  5                    select 3, 'A', 2, 2, 'yy' from dual union all
  6                    select 4, 'B', 2, 2, 'yy' from dual union all
  7                    select 5, 'C', 2, 2, 'yy' from dual)
  8  select intid, count(deptid), dsc
  9  from employee
10  where intid = 1
11* group by intid, dsc
SQL> /
     INTID COUNT(DEPTID) DS
         1             2 xx
SQL>

Similar Messages

  • Sql query required to fetch data in desired format.

    Hi All,
    Greetings,
    I have 1 table called sessioninfo. below are the table structure and table data,
    CREATE TABLE HR.SESSIONINFO
    REPORT_DATE DATE,
    REPORT_TIME VARCHAR2(100 BYTE),
    SESSION1 NUMBER,
    SESSION2 NUMBER,
    SESSION3 NUMBER,
    SESSION4 NUMBER,
    SESSION5 NUMBER,
    SESSION6 NUMBER,
    SESSION7 NUMBER,
    SESSION8 NUMBER,
    SESSION9 NUMBER,
    SESSION10 NUMBER,
    SESSION11 NUMBER,
    SESSION12 NUMBER,
    SESSION13 NUMBER,
    SESSION14 NUMBER,
    SESSION15 NUMBER,
    SESSION16 NUMBER,
    SESSION17 NUMBER,
    SESSION18 NUMBER,
    SESSION19 NUMBER,
    SESSION20 NUMBER,
    SESSION21 NUMBER,
    SESSION22 NUMBER,
    SESSION23 NUMBER,
    SESSION24 NUMBER,
    SESSION25 NUMBER,
    SESSION26 NUMBER,
    SESSION27 NUMBER,
    SESSION28 NUMBER,
    SESSION29 NUMBER,
    SESSION30 NUMBER,
    SESSION31 NUMBER,
    SESSION32 NUMBER,
    SESSION33 NUMBER,
    SESSION34 NUMBER,
    SESSION35 NUMBER,
    SESSION36 NUMBER,
    SESSION37 NUMBER,
    SESSION38 NUMBER,
    SESSION39 NUMBER,
    SESSION40 NUMBER,
    SESSION41 NUMBER,
    SESSION42 NUMBER,
    SESSION43 NUMBER
    REPORT_DATE     REPORT_TIME     SESSION1     SESSION2     SESSION4     SESSION5     SESSION6     SESSION7     SESSION8     SESSION9     SESSION10     SESSION11     SESSION14     SESSION15     SESSION16     SESSION17     SESSION18     SESSION19     SESSION20     SESSION21     SESSION22     SESSION23     SESSION24     SESSION25     SESSION26     SESSION27     SESSION30     SESSION31     SESSION32     SESSION35     SESSION36     SESSION37     SESSION38     SESSION40     SESSION41     SESSION42     SESSION43
    8/22/2011     7:01:00     2     1     2               2               1          2     1     2     1     1     1     1     1     2     1     1     0     1     2     2     0     1     1     2     2     2     2     1     1     2
    8/22/2011     7:15:41     1     2     2               2               2          3     1     2     2     1     1     1     1     2     3     1     3     2     2     5     1     1     2     1     2     1     2     1     1     1
    8/22/2011     7:30:45     1     1     4               3               2          3     2     2     3     2     1     2     2     1     2     1     2     2     2     2     2     3     2     1     2     2     2     2     1     2
    8/22/2011     7:46:10     1     2     1               2               2          2     3     3     3     1     1     3     4     3     1     5     3     3     2     2     3     3     2     3     3     2     3     2     2     2
    8/22/2011     8:01:05     5     5     7               4               2          3     3     5     2     6     2     3     2     3     4     4     3     3     4     4     2     4     3     4     2     3     4     3     3     4
    8/22/2011     8:15:48     2     4     4               4               5          3     3     3     3     4     3     4     4     4     3     3     5     4     4     4     7     3     3     4     3     3     3     5     4     5
    8/22/2011     8:30:50     4     5     3               5               4          3     5     5     5     4     5     5     6     5     4     6     7     3     3     5     7     5     4     4     4     4     5     8     3     4
    8/22/2011     8:45:42     4     7     5               5               6          5     4     5     4     4     6     4     6     4     7     5     4     4     7     5     7     5     5     5     6     3     7     6     5     5
    8/22/2011     9:01:24          5     6               6               5          3     6     8     6     7     6     4     5     4     7     7     5     6     4     7     5     4     5     4     4     5     6     11     4     6
    8/22/2011     9:15:56     5     6     4               4               4          6     6     4     13     5     8     5     4     6     3     5     4     6     8     5     5     6     7     5     5     7     5     7     6     8
    8/22/2011     9:30:45     7     7     5               5               12          7     4     5     5     6     15     8     6     7     9     9     5     6     5     5     6     5     5     8     9     9     7     5     7     8
    8/22/2011     9:45:41     5     10     7               8               7          6     7     5     6     8     8     7     7     9     5     6     7     9     7     8     6     11     6     10     8     10     6     12     9     12
    8/22/2011     10:01:00     8     5     5               9               6          7     6     7     5     7     7     7     9     6     6     7     7     7     11     8     7     8     10     8     6     5     7     6     9     6
    8/22/2011     10:16:16     6     8     6               14               9          7     7     10     8     8     23     11     16     6     6     4     8     10     9     7     7     10     7     14     12     7     5     10     11     6
    8/22/2011     10:31:09     7     9     8               9               8          7     8     8     9     7     20     11     6     8     9     9     11     8     14     11     12     7     8     7     12     10     12     8     7     11
    8/22/2011     10:46:11     7     8     10               8               12          7     7     9     8     9     8     11     10     12     9     8     9     7     8     6     8     9     10     10     9     8     9     18     7     9
    8/22/2011     11:01:10     8     7     6               9               13          8     10     9     11     9     10     8     7     8     11     14     6     9     12     8     8     7     17     13     12     7     16     19     14     9
    8/22/2011     11:15:40     11     12     9               10               10          11     8     10     9     10     10     8     7     9     8     10     6     10     11     10     8     13     14     8     10     13     9     10     12     10
    8/22/2011     11:31:45     8     7     10               11               10          12     11     11     8     13     30     11     8     8     8     7     8     12     7     10     9     10     12     15     11     11     10     9     9     11
    8/22/2011     11:46:05     9     7     8               7               12          6     11     8     6     9     8     10     7     8     14     9     8     13     8     23     13     7     12     8     12     8     12     10     9     9
    8/22/2011     12:01:22     9     10     10               11               11          10     13     7     9     13     11     11     10     10     8     10     13     12     12     11     10     8     7     8     10     9     20     23     10     9
    8/22/2011     12:16:02     8     9     11               10               9          11     12     9     22     9     7     7     6     9     10     11     9     8     9     8     25     6     9     10     12     18     16     10     7     7
    8/22/2011     12:31:11     18     11     8               14               9          11     5     8     9     7     8     7     8     7     21     10     13     7     6     10     8     7     10     8     7     10     7     10     10     10
    8/22/2011     12:46:15     10     7     11               12               8          13     16     14     23     10     8     10     11     33     9     15     13     16     14     9     10     25     11     7     11     11     9     9     11     8
    8/22/2011     13:00:57     13     16     8               10               16          12     6     9     10     7     22     11     11     8     7     15     8     11     10     14     8     15     9     10     10     10     10     8     8     9
    8/22/2011     13:15:57     6     21     14               26               7          10     9     13     10     12     13     7     8     18     11     10     10     9     25     17     8     21     7     11     7     18     17     9     17     6
    8/22/2011     13:30:53     9     12     6               5               9          14     6     9     7     15     10     6     8     12     8     9     7     9     10     12     7     8     13     11     13     7     8     10     7     10
    8/22/2011     13:46:05     6     13     8               9               10          10     8     22     8     11     8     10     10     11     8     10     6     9     9     8     8     7     11     7     9     8     8     7     10     8
    8/22/2011     14:00:46     13     8     8               11               9          12     8          9     14     9     9     11     14     10     9     11     14     8     16     23     9     6     12     8     8     9     9     9     18
    8/22/2011     14:15:46     8     13     9               7               9          29     7     9     18     10     10     7     9     9     17     10     10     10     12     10     13     12     15     7     12     8     13     9     8     9
    8/22/2011     14:31:13     9     11     11               20               10          9     8     9     9     9     8     25     9     7     11     8     9     10     12     7     10     23     11     9     10     9     10     9     9     9
    8/22/2011     14:45:52     9     12     12               13               25          11     17     8     12     9     11     10     11     10     11     8     21     11     8     7     9     25     11     10     11     10     13     11     8     8
    8/22/2011     15:00:52     7     33     11               9               7          12     9     11     12     10     34     10     11     9     7     9     11     10     9     29     11     10     13     8     10     13     17     15     14     12
    8/22/2011     15:16:16     8     10     6               25               13          10     9     9     13     13     15     10     10     17     8     12     10     11     61     9     9     9     26     10     10     12     10     11     13     9
    8/22/2011     15:31:07     9     10     9               11               11          9     14     14     12     12     19     12     8     11     11     9     9     12     0     11     10     7     24     11     11     9     19     22     10     9
    8/22/2011     15:45:44     7     10     9               25               14          11     23     10     34     11     7     8     7     7     15     16     8     5     9     9     10     10     7     9     7     7     10     10     21     13
    8/22/2011     16:00:59     27     9     12               10               11          9     16     16     16     19     10     10     11     9     7     17     10     10     6     27     11     12     9     20     9     10     18     12     12     9
    8/22/2011     16:15:42     12     9     8               8               9          18     10     9     25     11     8     8     16     10     13     11     23     33     12     8     11     20     9     8     9     22     10     8     11     10
    8/22/2011     16:31:03     10     10     9               14               9          14     10     15     9     14     9     10     11     22     8     9     10     13     8     10     10     8     11     13     10     9     11     10     11     9
    8/22/2011     16:45:44     10     9     10               11               13          10     10     12     8     9     10     9     16     7     8     9     8     14     7     10     11     5     7     11     8     9     10     11     20     11
    8/22/2011     17:00:46     9     12     10               9               11          7     12     10     9     7     11     8     9     7     8     12     10     10     8     15     12     12     8     6     6     10     9     10     9     9
    8/22/2011     17:16:04     7     7     7               20               9          9     9     8     9     8     10     20     8     17     31     10     10     9     8     17     9     8     8     16     8     6     14     10     9     9
    8/22/2011     17:31:22     6     7     9               9               8          6     8     7     8     9     5     18     8     7     8     7     7     12     13     11     16     8     7     25     9     8     22     12     14     10
    8/22/2011     17:45:56     12     6     11               8               8          8     7     6     7     7     7     15     9     8     10     10     13     14     5     9     9     19     9     6     5     14     17     9     14     6
    8/22/2011     18:00:53     8     8     6               8               7          8     5     8     6     7     6     8     16     5     7     7     9     15     8     8     6     8     6     8     9     7     10     7     6     10
    8/22/2011     18:16:04     6     7     6               19               12          12     9     9     8     6     6     7     12     8     7     7     5     6     7     7     7     10     6     7     8     6     6     6     6     9
    8/22/2011     18:31:00     7     6     9               6               11          6     6     6     6     9     6     5     7     7     12     9     18     8     5     5     5     7     5     6     10     6     10     10     15     8
    8/22/2011     18:45:43     17     13     22               11               5          6     6     6     12     4     5     5     5     4     5     5     9     8     4     6     7     5     6     6     7     5     6     7     6     5
    8/22/2011     19:00:57     7     7     4               7               15          17     6     7     10     8     4     6     6     4     5     6     5     13     7     5     6     3     5     5     6     6     16     7     6     4
    8/22/2011     19:15:47     5     4     6               5               4          4     4     4     6     3     5     5     6     4     3     10     6     6     4     7     5     6     6     6     7     5     4     4     8     5
    8/22/2011     19:30:39     5     5     7               4               8          12     3     5     3     5     6     6     4     5     4     4     5     6     4     6     5     4     4     6     7     4     4     6     4     3
    8/22/2011     19:45:39     5     5     15               5               6          6     6     4     5     8     6     6     6     4     6     5     7     4     3     5     3     3     3     4     6     7     6     4     5     5
    8/22/2011     20:01:02     3     4     4               5               3          6     4     5     5     4     2     3     4     4     5     6     4     4     5     4     5     5     4     5     3     5     5     3     4     5
    8/22/2011     20:15:38     6     4     3               4               5          5     4     2     5     3     4     6     4     4     4     5     2     2     4     4     5     4     3     2     4     3     5     4     3     4in short table contains the information about some sessions.
    now i want the output like below, (highest session for the report_date and report_time with the name of session)
    REPORT_DATE     REPORT_Hour     SESSION_CODE     SESSION_VALUE
    8/22/2011     7     Session30     5
    8/22/2011     7     Session24     5
    8/22/2011     8     Session41     8
    8/22/2011     9     Session19     15
    8/22/2011     10          
    8/22/2011     11          
    8/22/2011     12          
    8/22/2011     13          
    8/22/2011     14          
    8/22/2011     15          
    8/22/2011     16          
    8/22/2011     17          
    8/22/2011     18          
    8/22/2011     19          
    8/22/2011     20          How can i get using sql query.
    Any help appriciated.

    In version 11 you can use UNPIVOT.
    A sample with just three columns:
    SQL> with sessioninfo as (
      2     select date '2011-08-29' report_date, '7:12:34' report_time,
      3            1 session1, cast(null as number) session2, 11 session3 from dual union all
      4     select date '2011-08-29' report_date, '7:56:00' report_time,
      5            4 session1, 2 session2, cast(null as number) session3 from dual union all
      6     select date '2011-08-29' report_date, '14:44:44' report_time,
      7            cast(null as number) session1, cast(null as number) session2, 2 session3 from dual
      8  )
      9  select
    10  report_date,
    11  substr(lpad(report_time,8),1,2) report_hour,
    12  max(session_code) keep (dense_rank last order by session_value) session_code,
    13  max(session_value) session_value
    14  from sessioninfo
    15  unpivot(
    16     session_value for session_code in (
    17        session1 as 'Session1',
    18        session2 as 'Session2',
    19        session3 as 'Session3'
    20     )
    21  )
    22  group by
    23  report_date,
    24  substr(lpad(report_time,8),1,2)
    25  order by
    26  report_date,
    27  substr(lpad(report_time,8),1,2)
    28  ;
    REPORT_D RE SESSION_ SESSION_VALUE
    11-08-29  7 Session3            11
    11-08-29 14 Session3             2For your 43 columns you just need to expand the list in lines 17,18,19 - the rest will work fine.
    (Your best way would actually be to change your datamodel to be more useful in a relational database - having columns session1, session2,...,session43 is not a very useful datamodel. Storing a timestamp in a VARCHAR2 is also not very good for the database.)

  • Simple SQL Query required....

    Hi All,
    I have 2 tables like the below.
    Table "T1". This has c1,c2,c3 columns
    Table "T2". This has c1,c2,c3 columns as T1 with same datatypes.
    now i want a query which fetch the data like t1.c1,t1.c2,t1.c3,t2.c1,t2.c2,t2.c3
    Eg:
    T1 has the below data:
    c1 c2 c3
    1 200 300
    2 200 300
    1 100 300
    2 400 400
    T2 has the below data:
    c1 c2 c3
    1 200 300
    2 200 300
    2 400 400
    now i want the output like the below
    c1 c2 c3 c1 c2 c3
    1 200 300 1 200 300
    2 200 300 2 200 300
    1 100 300
    2 400 400 2 400 400
    Regards
    Bond..

    Hi
    you can use this
    Select t1.c1,t1.c2,t1.c3,t2.c1,t2.c2,t2.c3
    from table1 t1,table2 t2
    where t1.c1 = t2.c1(+)
    AND t1.c2 = t2.c2(+)
    AND t1.c3 = t2.c3(+)
    order by t1.c1,t2.c1
    Regards
    Ankur
    Edited by: Garg on Dec 4, 2008 2:16 PM
    Edited by: Garg on Dec 4, 2008 2:20 PM

  • How do i get the approximate size of back up file required to save on disk using sql query because i want to show the required sapce for backup on my application

    hi i am face with problem that is i want to show the how much approximate space required for backup or .bak file to get backup using sql query because i want to show the required memory for backup file on my java application  

    Hi FIROZ
    TENNALI
    Is this still an issue, or can we close the thread?
    * closing a thread by marking the answer/s (there is a link beneath each response) and you can vote for useful responses as well (there is a link to vote on the left of each response)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Please provide the sql query on mentioned requirement in attached image.

    Please provide query for this requirement
    1.This is my main table  data.
    FACTID DATE_DMN_KEY
    WQTY ROWID
    AVG_7_AMT
    1 100   
    1000 1
    NULL
    1 200 2000
    2 NULL
    1 300 3000
    3 NULL
    1 400 4000
    4 NULL
    1 500 5000
    5 NULL
    1 600 6000
    6 NULL
    1 700 7000
    7 NULL
    1 800 8000
    8 NULL
    1 900 9000
    9 NULL
    1 1000
    10000 10
    NULL
    2.  column rowid =10 is the latest record and COLUMN AVG_7_AMT value should be update as below
        Sum (WQTY=10000+9000+8000+7000+6000+5000+4000)/7
    3.FOR  column rowid =9 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=9000+8000+7000+6000+5000+4000+3000)/7
    4. FOR  column rowid =8 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=8000+7000+6000+5000+4000+3000+2000)/7
    5. . FOR  column rowid =7 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=7000+6000+5000+4000+3000+2000+1000)/7
    6.  FOR  column rowid =6 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=6000+5000+4000+3000+2000+1000)/6
    7. FOR  column rowid =5 record and COLUMN AVG_7_AMT value should be update as below
       Sum (WQTY=5000+4000+3000+2000+1000)/5
    How we can write sql  query for this type of requirement.

    Query is working but partially..
    if you insert  below records in same fact table then it wont work because factId=1 and factid 2 are different transaction .. how 
    Insert into fact Values
    (2, 100, 1000,   NULL),
    (2, 200, 2000,  NULL),
    (2, 300, 3000,  NULL),
    (2 ,400, 4000,  NULL),
    (2, 500 ,5000,  NULL),
    (2, 600, 6000,  NULL),
    (2, 700, 7000 , NULL),
    (2, 800, 8000,  NULL),
    (2, 900, 9000,  NULL),
    (2, 1000,  10000,   NULL )
    then result should like below.
    FACTID
    DATE_DMN_KEY
    WQTY
    ROWID
    AVG_7_AMT
    1
    100
    1000
    1
    1000
    1
    200
    2000
    2
    3000
    1
    300
    3000
    3
    6000
    1
    400
    4000
    4
    10000
    1
    500
    5000
    5
    15000
    1
    600
    6000
    6
    21000
    1
    700
    7000
    7
    28000
    1
    800
    8000
    8
    35000
    1
    900
    9000
    9
    42000
    1
    1000
    10000
    10
    49000
    2
    100
    1000
    1
    1000
    2
    200
    2000
    2
    3000
    2
    300
    3000
    3
    6000
    2
    400
    4000
    4
    10000
    2
    500
    5000
    5
    15000
    2
    600
    6000
    6
    21000
    2
    700
    7000
    7
    28000
    2
    800
    8000
    8
    35000
    2
    900
    9000
    9
    42000
    2
    1000
    10000
    10
    49000

  • SQL Query Assistance Required for Full Outer Join

    Hi,
    Lets say I have two tables, i.e:
    TAB_A (colA1, colA2, colA3, colA4)
    TAB_B (colB1, colB2, colB3, colB4) where colB2 is a FK to colA1
    I am after an SQL query that will cater for both the following two scenarios.
    Scenario 1:
    TAB_A has two rows of data, i.e
    (1, ABC100, 1, WG_A)
    (2, ABC100, 2, WG_B)
    TAB_B has one row of data, i.e
    (1, 1, EMP_222, 4)
    I use the following SQL:
    select a.*, b.*
    from tab_a a FULL OUTER JOIN tab_b b ON (a.colA1 = b.colB2)
    where a.colA2 = 'ABC100'
    This returns two rows:
    1, ABC100, 1, WG_A, 1, 1, EMP_222, 4
    2, ABC100, 2, WG_B
    Now, what I actually would like my query to do is actually only return the row where a tab_b record exists, i.e, should only return one record:
    1, ABC100, 1, WG_A, 1, 1, EMP_222, 4
    This I can achieve by using a RIGHT OUTER JOIN instead above, but this causes issue with my scenario 2, which is the following set-up
    Scenario 2:
    TAB_A has only one row of data this time, i.e
    (2, ABC100, 2, WG_B)
    TAB_B has no data at all this time
    This returns no rows but I actually now want this single record from tab_a returned.
    I basically require an SQL query that will cater for both the top 2 scenarios, i.e, if a tab_b record exists from the outer join then only return this record along with tab_a data. If a tab_b record doesn't exist, then only return the tab_a record.
    Hope the above makes sense.
    Thanks.

    Is it what you need (not very elegant) ?
    SQL> select * from t_outer;
            ID CODE
             1 100
             2 100
    SQL> select * from t_inner;
    no rows selected
    SQL> with tab1 as (
      2  select a.id a_id, a.code, b.id b_id from t_outer a join t_inner b on
      3  (a.id = b.id and a.code = '100'))
      4  select * from tab1
      5  union all
      6  select a.*, null from t_outer a where not exists (
      7  select 1 from tab1)
      8  and a.code = '100'
      9  /
          A_ID CODE             B_ID
             1 100
             2 100
    SQL> insert into t_inner values(2);
    1 row created.
    SQL> with tab1 as (
      2  select a.id a_id, a.code, b.id b_id from t_outer a join t_inner b on
      3  (a.id = b.id and a.code = '100'))
      4  select * from tab1
      5  union all
      6  select a.*, null from t_outer a where not exists (
      7  select 1 from tab1)
      8  and a.code = '100'
      9  /
          A_ID CODE             B_ID
             2 100                 2
    Rgds.

  • Require Code which export SQL Query resuluts to excel using checkbox option

    Hi All,
    I need a sample code which can export the SQL Query results directly to an excel file using checkbox option. for example
    if I select checkbox1 and press a save button, then on backend SQL Query will execute and save the results in a excel file and so on.
    Thanks in advance..
    Regards,
    Chetan

    Thanks for the Code.
    Actually I need a code which is based on combo base values and when I click on Button, the SQL Query will execute using SQL Connection string and the results from that query will save into a excel file. Below is the screenshot of the form. Hope this will
    clear the requirements.
    Hello,
    To be honest, this forum is not for coding for anybody.
    You could refer to the suggestions shared above, and if you get any issue when using that code, you could share the code and error with us, we will focus on your code to help you.
    You could separate them into multiple steps, like the following.
    1. Getting the value of any control, like the textbox and combobox or even checkbox.
    2. Execute method inside button click event handler.
    3. Using ado.net to execuate sql query.
    4. Saving data to Excel.
    Then you could have a try step by step, if you get any issue, then post it in another thread with the code and error message.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What can be the SQL Query for this requirement ?

    Hi,
    I have a table with fields like this:
    ID DESC PARENT
    01 ABC 02
    02 ABC1 01
    03 ABC2 01
    04 ABC4 02
    In the above table PARENT column refers to ID column , but actually in SQL query i want to have ID, DESC , and PARENTDESC (i.e., desc value of the corresponding ID)
    Actual output that i need is
    select ID , DESC , ?? from table where ID=someValue . Now if i provide ID=01 then output should be like this:
    ID DESC PARDESC
    01 ABC ABC1
    Can anyone help what can be the required sql query ?
    Edited by: bootstrap on Apr 29, 2011 6:15 AM

    SELECT T1.ID, T1.DESC, T2.DESC
    FROM TABLEA T1, TABLEA T2
    WHERE T1.ID='01'
    AND T2.ID = T1.PARENT;

  • URGENT HELP Required: Solution to avoid Full table scan for a PL/SQL query

    Hi Everyone,
    When I checked the EXPLAIN PLAN for the below SQL query, I saw that Full table scans is going on both the tables TABLE_A and TABLE_B
    UPDATE TABLE_A a
    SET a.current_commit_date =
    (SELECT MAX (b.loading_date)
    FROM TABLE_B b
    WHERE a.sales_order_id = b.sales_order_id
    AND a.sales_order_line_id = b.sales_order_line_id
    AND b.confirmed_qty > 0
    AND b.data_flag IS NULL
    OR b.schedule_line_delivery_date >= '23 NOV 2008')
    Though the TABLE_A is a small table having nearly 1 lakh records, the TABLE_B is a huge table, having nearly 2 and a half crore records.
    I created an Index on the TABLE_B having all its fields used in the WHERE clause. But, still the explain plan is showing FULL TABLE SCAN only.
    When I run the query, it is taking long long time to execute (more than 1 day) and each time I have to kill the session.
    Please please help me in optimizing this.
    Thanks,
    Sudhindra

    Check the instruction again, you're leaving out information we need in order to help you, like optimizer information.
    - Post your exact database version, that is: the result of select * from v$version;
    - Don't use TOAD's execution plan, but use
    SQL> explain plan for <your_query>;
    SQL> select * from table(dbms_xplan.display);(You can execute that in TOAD as well).
    Don't forget you need to use the {noformat}{noformat} tag in order to post formatted code/output/execution plans etc.
    It's also explained in the instruction.
    When was the last time statistics were gathered for table_a and table_b?
    You can find out by issuing the following query:select table_name
    , last_analyzed
    , num_rows
    from user_tables
    where table_name in ('TABLE_A', 'TABLE_B');
    Can you also post the results of these counts;select count(*)
    from table_b
    where confirmed_qty > 0;
    select count(*)
    from table_b
    where data_flag is null;
    select count(*)
    from table_b
    where schedule_line_delivery_date >= /* assuming you're using a date, and not a string*/ to_date('23 NOV 2008', 'dd mon yyyy');

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

  • Sql query tuning required

    Dear Experts,
    I have a sql query which taking more than 2 hour of time ot execute.
    the explain plan is :
    PLAN_TABLE_OUTPUT
    Plan hash value: 2694368390
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 379 | 44561 (1)| 00:08:55 |
    | 1 | INLIST ITERATOR | | | | | |
    | 2 | TABLE ACCESS BY INDEX ROWID | OPS_CITY_MAST | 2 | 30 | 5 (0)| 00:00:01 |
    |* 3 | INDEX UNIQUE SCAN | OPS_CITY_MAST_IDX_01 | 2 | | 3 (0)| 00:00:01 |
    | 4 | TABLE ACCESS BY INDEX ROWID | OPS_BR_MAST | 1 | 16 | 2 (0)| 00:00:01 |
    |* 5 | INDEX UNIQUE SCAN | OPS_BR_MAST_IDX_01 | 1 | | 1 (0)| 00:00:01 |
    | 6 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 7 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 8 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 9 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 10 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 11 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 12 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 13 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 14 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 15 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 16 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
    |* 17 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
    | 18 | SORT GROUP BY NOSORT | | 1 | 31 | 10 (0)| 00:00:01 |
    | 19 | NESTED LOOPS | | | | | |
    | 20 | NESTED LOOPS | | 2 | 62 | 10 (0)| 00:00:01 |
    | 21 | TABLE ACCESS BY INDEX ROWID | OPS_UULT_WB_DTLS | 2 | 24 | 6 (0)| 00:00:01 |
    |* 22 | INDEX RANGE SCAN | OPS_UULT_WB_DTLS_IDX_03 | 2 | | 3 (0)| 00:00:01 |
    |* 23 | INDEX UNIQUE SCAN | OPS_UPD_ULT_IDX_01 | 1 | | 1 (0)| 00:00:01 |
    |* 24 | TABLE ACCESS BY INDEX ROWID | OPS_UPD_ULT | 1 | 19 | 2 (0)| 00:00:01 |
    | 25 | NESTED LOOPS | | | | | |
    | 26 | NESTED LOOPS | | 1 | 379 | 44561 (1)| 00:08:55 |
    | 27 | NESTED LOOPS | | 1 | 360 | 44559 (1)| 00:08:55 |
    | 28 | NESTED LOOPS | | 1 | 333 | 44558 (1)| 00:08:55 |
    | 29 | NESTED LOOPS | | 1 | 312 | 44557 (1)| 00:08:55 |
    | 30 | NESTED LOOPS | | 1 | 302 | 44555 (1)| 00:08:55 |
    | 31 | NESTED LOOPS | | 1 | 281 | 44553 (1)| 00:08:55 |
    |* 32 | HASH JOIN | | 4383 | 1112K| 35779 (2)| 00:07:10 |
    |* 33 | HASH JOIN RIGHT OUTER | | 4383 | 1070K| 34631 (2)| 00:06:56 |
    | 34 | TABLE ACCESS FULL | OPS_CUST_CNTR | 7270 | 94510 | 68 (0)| 00:00:01 |
    |* 35 | HASH JOIN | | 4383 | 1014K| 34562 (2)| 00:06:55 |
    | 36 | NESTED LOOPS OUTER | | 4414 | 875K| 33135 (2)| 00:06:38 |
    |* 37 | HASH JOIN | | 4414 | 827K| 32963 (2)| 00:06:36 |
    | 38 | TABLE ACCESS FULL | OPS_ST_UN_MAST | 36 | 504 | 3 (0)| 00:00:01 |
    |* 39 | HASH JOIN | | 4414 | 767K| 32959 (2)| 00:06:36 |
    |* 40 | HASH JOIN | | 4414 | 543K| 28417 (2)| 00:05:41 |
    | 41 | NESTED LOOPS | | | | | |
    | 42 | NESTED LOOPS | | 4414 | 495K| 26483 (2)| 00:05:18 |
    |* 43 | HASH JOIN | | 4949 | 483K| 16641 (2)| 00:03:20 |
    |* 44 | TABLE ACCESS BY INDEX ROWID| OPS_WAYBL | 4423 | 367K| 2292 (1)| 00:00:28 |
    |* 45 | INDEX RANGE SCAN | OPS_WAYBL_IDX_11 | 5050 | | 16 (0)| 00:00:01 |
    | 46 | TABLE ACCESS FULL | OPS_PULTD_WB_DTLS | 4474K| 64M| 14298 (2)| 00:02:52 |
    |* 47 | INDEX UNIQUE SCAN | OPS_TS_RECONSILE_IDX_02 | 1 | | 1 (0)| 00:00:01 |
    |* 48 | TABLE ACCESS BY INDEX ROWID | OPS_TS_RECONSILE | 1 | 15 | 2 (0)| 00:00:01 |
    | 49 | TABLE ACCESS FULL | OPS_CC_CORCEE_ADDR | 998K| 10M| 1922 (2)| 00:00:24 |
    | 50 | TABLE ACCESS FULL | OPS_ADDR_MAST | 1006K| 49M| 4531 (1)| 00:00:55 |
    | 51 | TABLE ACCESS BY INDEX ROWID | OPS_WB_DOD_DTLS | 1 | 11 | 1 (0)| 00:00:01 |
    |* 52 | INDEX UNIQUE SCAN | OPS_WB_DOD_DTLS_IDX_02 | 1 | | 0 (0)| 00:00:01 |
    | 53 | TABLE ACCESS FULL | OPS_TRIP_SHT | 423K| 13M| 1422 (2)| 00:00:18 |
    | 54 | TABLE ACCESS FULL | OPS_PROV_LT_DLVRY | 446K| 4361K| 1142 (2)| 00:00:14 |
    | 55 | TABLE ACCESS BY INDEX ROWID | OPS_PLTD_WB_DTLS | 1 | 21 | 2 (0)| 00:00:01 |
    |* 56 | INDEX UNIQUE SCAN | OPS_PLTD_WB_DTLS_IDX_04 | 1 | | 1 (0)| 00:00:01 |
    | 57 | TABLE ACCESS BY INDEX ROWID | OPS_ULTD_WB_DTLS | 1 | 21 | 2 (0)| 00:00:01 |
    |* 58 | INDEX UNIQUE SCAN | OPS_ULTD_WB_DTLS_IDX_02 | 1 | | 1 (0)| 00:00:01 |
    |* 59 | TABLE ACCESS BY INDEX ROWID | OPS_UPD_LT_DLVRY | 1 | 10 | 2 (0)| 00:00:01 |
    |* 60 | INDEX UNIQUE SCAN | OPS_UPD_LT_DLVRY_IDX_01 | 1 | | 1 (0)| 00:00:01 |
    | 61 | TABLE ACCESS BY INDEX ROWID | OPS_TRPT_VHLS | 1 | 21 | 1 (0)| 00:00:01 |
    |* 62 | INDEX UNIQUE SCAN | OPS_TRPT_VHLS_IDX_01 | 1 | | 0 (0)| 00:00:01 |
    | 63 | TABLE ACCESS BY INDEX ROWID | PO_VENDORS | 1 | 27 | 1 (0)| 00:00:01 |
    |* 64 | INDEX UNIQUE SCAN | VENDOR_UNIQUE | 1 | | 0 (0)| 00:00:01 |
    |* 65 | INDEX UNIQUE SCAN | OPS_GATE_PASS_IDX_01 | 1 | | 1 (0)| 00:00:01 |
    |* 66 | TABLE ACCESS BY INDEX ROWID | OPS_GATE_PASS | 1 | 19 | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    3 - access("OCM"."ID"=:B1 OR "OCM"."ID"=:B2)
    5 - access("OBM"."ID"=:B1)
    7 - access("CGA"."DOC_TYPE"='WB' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=6)
    9 - access("CGA"."DOC_TYPE"='WB' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=7)
    11 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=15)
    13 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=16)
    15 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=17)
    17 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=23)
    22 - access("DT"."WAYBL_ID"=:B1)
    23 - access("ULT"."ID"="DT"."UPD_ULT_ID")
    24 - filter("ULT"."FROM_BR_MAST_ID"=:B1)
    32 - access("OPL"."ID"="TS"."PROV_LT_DLVRY_ID")
    33 - access("CNTR"."ID"(+)="SYS_ALIAS_10"."CUST_CNTR_ID")
    35 - access("TSREC"."TRIP_SHT_ID"="TS"."ID")
    37 - access("ST"."ID"="AD"."ST_UN_MAST_ID")
    39 - access("AD"."ID"="CCADD"."ADDR_MAST_ID")
    40 - access("CCADD"."ID"="SYS_ALIAS_10"."CC_CEE_ADDR_ID")
    43 - access("SYS_ALIAS_10"."ID"="DTL"."WAYBL_ID")
    44 - filter("SYS_ALIAS_10"."GL_TRFD" IS NULL OR "SYS_ALIAS_10"."GL_TRFD"='Y')
    45 - access(TRUNC(INTERNAL_FUNCTION("FIRST_DLVRY_DT"))=TO_DATE(' 2011-08-15 00:00:00', 'syyyy-mm-dd
    hh24:mi:ss'))
    47 - access("DTL"."ID"="TSREC"."PULTD_WB_DTLS_ID")
    48 - filter("TSREC"."STATUS_LID"=157)
    52 - access("SYS_ALIAS_10"."ID"="OWD"."WAYBL_ID"(+))
    56 - access("LTDTL"."PROV_LT_DLVRY_ID"="OPL"."ID" AND "LTDTL"."WAYBL_ID"="DTL"."WAYBL_ID")
    58 - access("ULTDTL"."PLTD_WB_DTLS_ID"="LTDTL"."ID")
    59 - filter("UPLT"."PROV_LT_DLVRY_ID"="OPL"."ID")
    60 - access("ULTDTL"."UPD_LT_DLVRY_ID"="UPLT"."ID")
    62 - access("OTV"."ID"="OPL"."TRPT_VHLS_ID")
    64 - access("PO"."VENDOR_ID"="OTV"."VENDOR_ID")
    65 - access("SYS_ALIAS_9"."ID"="ULTDTL"."GATE_PASS_ID")
    66 - filter("SYS_ALIAS_9"."GL_TRFD" IS NULL OR "SYS_ALIAS_9"."GL_TRFD"='Y')
    so, please help me.
    Regards,
    Viveka Nand
    Edited by: 891502 on Oct 14, 2011 4:39 AM

    891502 wrote:
    now am putted in the correct format,In the link it tells you to provide the query. Which you have not done.
    It tells you how to format the plan. Which you have not done.
    It tells you to provide database version and optimizer parameters. Which you have not done.
    It tells you to provide autotrace statistics and trace output. Which you have not done.
    So in what way is this format correct ?
    so, please give me the way to resolved it.With the information you have provided we can say with certainty that if you write your query this way it will be fast.
    select null from dual;

  • Mysql equivalent oracle sql query is required

    Hi all,
    please help me convert mysql quyery into sql query.
    select u.username, t.name as fullname, p.id as project_id, p.name as project,
                             (select count(a.resource_id) from pd_resource_task_alloc as a left OUTER JOIN pd_resource_task as b on a.task_id=b.task_id where a.task_id=t.id )  as allocatedTask,
                             (select count(a.resource_id) from pd_resource_task_alloc as a left OUTER JOIN pd_resource_task as b on a.task_id=b.task_id where a.task_id=t.id and b.task_status_id='2') as completedTask,
                             (select count(a.resource_id) from pd_resource_task_alloc as a left OUTER JOIN pd_resource_task as b on a.task_id=b.task_id where a.task_id=t.id and b.task_status_id!='2') as pendingTask,
                             c.name as category, sub.task_id, t.name, sub.bucket_date, sum(sub.alloc_time) as s
                             from (select rt.task_id, rt.resource_id, rt.project_id, rta.sequence, rta.alloc_time,DATE(th.creation_date) as creation_date,rt.start_date,th.task_status_id,rt.start_date as bucket_date from resource_task rt, resource_task_alloc rta ,task_history th
                             where rt.task_id = rta.task_id and rt.task_id = th.task_id and th.task_status_id >=2
                             and rt.resource_id = rta.resource_id and rt.project_id = rta.project_id
                             and rta.alloc_time > 0 and rt.start_date is not null ) as sub,
                             pd_tool_user u, pd_task t, pd_project p, pd_category c where sub.resource_id = u.id
                             and sub.start_date >='2011-11-01' and sub.creation_date <= '2011-11-31'
                             and sub.task_id = t.id and sub.project_id = p.id and
                             t.category_id = c.id
                             and sub.project_id='355'
                             group by p.project, u.username, p.id , u.name, sub.task_id, t.name, c.name,
                             sub.bucket_date order by u.username, sub.bucket_date, p.name, c.nameThanks,
    P Prakash

    Not sure as we don't have any tables and data to work with, but firstly...
    a) format your code to make it easier to see what's going on
    b) don't mix ansi joins with regular joins
    c) treat DATEs as DATEs
    d) Table alias names don't use the "AS" keyword
    First guess (obviously unteseted)...
    select u.username
          ,t.name as fullname
          ,p.id as project_id
          ,p.name as project
          ,(select count(a.resource_id)
            from   pd_resource_task_alloc a
                   left OUTER JOIN pd_resource_task b on (a.task_id=b.task_id)
            where  a.task_id=t.id
           ) as allocatedTask
          ,(select count(a.resource_id)
            from   pd_resource_task_alloc a
                   left OUTER JOIN pd_resource_task b on (a.task_id=b.task_id)
            where  a.task_id=t.id
            and    b.task_status_id='2'
           ) as completedTask
          ,(select count(a.resource_id)
            from   pd_resource_task_alloc a
                   left OUTER JOIN pd_resource_task b on (a.task_id=b.task_id)
            where  a.task_id=t.id
            and    b.task_status_id!='2'
           ) as pendingTask
          ,c.name as category
          ,sub.task_id
          ,t.name
          ,sub.bucket_date
          ,sum(sub.alloc_time) as s
    from   (select rt.task_id
                  ,rt.resource_id
                  ,rt.project_id
                  ,rta.sequence
                  ,rta.alloc_time
                  ,th.creation_date -- assuming creation_date is a DATE datatype?
                  ,rt.start_date
                  ,th.task_status_id
                  ,rt.start_date as bucket_date
            from   resource_task rt
                   join resource_task_alloc rta on (rt.task_id = rta.task_id
                                                and rt.resource_id = rta.resource_id
                                                and rt.project_id = rta.project_id)
                   join task_history th on (rt.task_id = th.task_id)
            where  th.task_status_id >=2
            and    rta.alloc_time > 0
            and    rt.start_date is not null
           ) sub
           join pd_tool_user u on (sub.resource_id = u.id)
           join pd_task t on (sub.task_id = t.id)
           join pd_project p on (sub.project_id = p.id)
           join pd_category c on (t.category_id = c.id)
    where  sub.start_date >= to_date('2011-11-01','YYYY-MM-DD') -- assuming start_date is a DATE datatype
    and    sub.creation_date <= to_date('2011-11-31','YYYY-MM-DD') -- assuming creation_date is a DATE datatype
    and    sub.project_id='355'
    group by p.project
            ,u.username
            ,p.id
            ,u.name
            ,sub.task_id
            ,t.name
            ,c.name
            ,sub.bucket_date
    order by u.username
            ,sub.bucket_date
            ,p.name
            ,c.name

  • How to view the sql query?

    hi,
      how to view the sql query formed from the xml structure in the receiver jdbc?

    You can view SAP Note at
    http://service.sap.com/notes
    But you require SMP login ID for this which you should get from your company. The content of the notes are as follows:
    Reason and Prerequisites
    You are looking for additional parameter settings. There are two possible reasons why a feature is available via the "additional parameters" table in the "advanced mode" section of the configuration, but not as documented parameter in the configuration UI itself:
    Category 1: The parameter has been introduced for a patch or a SP upgrade where no UI upgrade and/or documentation upgrade was possible. In this case, the parameter will be moved to the UI and the documentation as soon as possible. The parameter in the "additional parameters" table will be deprecated after this move, but still be working. The parameter belongs to the supported adapter functionality and can be used in all, also productive, scenarios.
    Category 2. The parameter has been introduced for testing purposes, proof-of-concept scenarios, as workaround or as pre-released functionality. In this case, the parameter may or may not be moved to the UI and documentation, and the functionality may be changed, replaced or removed. For this parameter category there is no guaranteed support and usage in productive scenarios is not supported.
    When you want to use a parameter documented here, please be aware to which category it belongs!
    Solution
    The following list shows all available parameters of category 1 or 2. Please note:
    Parameter names are always case-sensitive! Parameter values may be case-sensitive, this is documented for each parameter.
    Parameter names and values as documented below must be used always without quotaton marks ("), if not explicitly stated otherwise.
    The default value of a parameter is always chosen that it does not change the standard functionality
    JDBC Receiver Adapter Parameters
    1. Parameter name: "logSQLStatement"
                  Parameter type: boolean
                  Parameter value: true for any string value, false only for empty string
                  Parameter value default: false (empty String)
                  Available with: SP9
                  Category: 2
                  Description:
                  When implementing a scenario with the JDBC receiver adapter, it may be helpful to see which SQL statement is generated by the JDBC adapter from the XI message content for error analysis. Before SP9, this can only be found in the trace of the JDBC adapter if trace level DEBUG is activated. With SP9, the generated SQL statement will be shown in the details page (audit protocol) of the message monitor for each message directly.
                  This should be used only during the test phase and not in productive scenarios.
    Regards,
    Prateek

  • How to construct a sql query when field having single quote

    Hi all,
    I have been working on web application , here is my requirement:
    I'm constructing sql statement dynamically from dynamic user input (form data). In one of the field having single quote.
    while executing the query it is getting problem because of single quote .. so how do i resolve my problem.
    single quote should be there. (I'm using Ms-Access as my database).
    Thanks in advance
    abel

    Use PreparedStatement. Always. It not only eases setting Java objects in a SQL query, but also protects you against SQL injections.
    Prepare yourself: [http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html].

  • How to run a sql query from a button in apex 3.0

    Hi,
    I am brand new and went through/installed the obe project tracker. I have need to create a simple application that displays a result (2 fields, name and license number) based on two parameters (dob and login id) which all are stored in 1 table in the database. I could this very simply in VB or VB.net but have no idea how to do it in apex.
    Please provide guidance,
    Thank you,
    Tom

    Hi Tom,
    Sounds like a report region will satisfy your requirements.
    Create a new report region on one of your pages.
    Choose SQL Report and give the region a title.
    When you get to the "Enter SQL Query or PL/SQL function returning a SQL Query:" step, type:
    SELECT name, license_number
    FROM   <insert_your_table_name_here>
    WHERE  dob = :P<n>_dob
    AND    login_id = :P<n>loginid(replace <n> with the page number that the region is on and use your own table name).
    Don't try to run the page yet - it will give 'No data found'
    Now, go back to the Page Definition screen and add two items in the region you just created - call them P<n>dob and P<n>login_id
    Then, create a button in the same region (to be displayed amongst the region's items) - call it P<n>_GO and click 'Create' (take all the other defaults).
    Now you can run the page, put some values into the fields and click go.
    If you want to get fancier, you can change the text items to select lists etc. - let us know if you need help with that.
    Hope this helps,
    Bryan.

Maybe you are looking for

  • How to set F4 help for an inputfiled of BSP page?

    hi friends, I have to set F4 help for a Field in my BSP page. for this i am doing like this. Oninitialization Event.... tables : t001p ,pa0001 ,t554t. data : begin of it,         awart like t554t-awart,         atext like t554t-atext,        end of i

  • Transferring iTunes between user accounts

    I have just moved my iTunes library from my PC to my MacBook pro via Migration Assistant, however, I did this after my initial set up. So it has created a new user profile, profile B, which my iTunes library is now in. Question: how do I now move/mer

  • "Error attempting to read file" at Webservice call from Adobe Form.

    Hi Experts, We have designed a Webservice form a Function Module in ECC 6.0, In the soamanager transaction the webservice works fine. But at the time of call from the Adobe form, it gives an error stating that "Error attempting to read from file" and

  • Pls help Session manipulation in Jsp

    Hi, In JSP, I wanna check whether user has logged in, but it doesn't work, could you pls help? I guess the reason is I didn't initiate session attribute of userid. If it is true, could u pls tell me how to do that? or, how to know the attribute not s

  • Target Yield in Material Master

    Is it possible to enter target yield in material master so that we are able to get variance between target yield and actual yield. Pl. help me if any such filed is available in FERT master or any other way. Regards, Ganesh