How to write query for this scenario

Hi - 
I have two table like this: 
Question: 
questionid  questiontext
1 comment
2 score
Answer:
authkey  questionid
questiontext answertext
101 1 comment hi!!
101 2 score 4
102 1 comment excellent
102 2 score 5
103 2 score 6
104 2 score 8
Here there are  two question (score and comment) and answer is stored in answer table. there are case when there is no comment and only answer. but answer would always be there in answer table for each authkey. 
I want to write the query that gives the result that if no comment is given for authkey then return null as answer. something like below: 
Desired Result: 
authkey questionid questiontext
answertext
101 1 comment hi!!
101 2 score 4
102 1 comment excellent
102 2 score 5
103 2 score 6
103 1 comment null
104 2 score 8
104 1 comment null
what query can i write to get the above desired result. 
Thanks in advance

Try below solution, it is NOT best solution but might work:
Declare @Questions TABLE (QuestionID INT, QuestionText Varchar(100))
INSERT INTO @Questions
VALUES (1, 'Comment'), (2, 'Score')
DECLARE @Answers TABLE (authkey INT, QuestionID INT, questiontext VARCHAR(100), answertext VARCHAR(100))
INSERT INTO @Answers
VALUES (101, 1, 'comment', 'hi!!'), (101, 2, 'score', '4'), (102, 1, 'comment', 'excellent'), (102, 2, 'score', '5'), (103, 2, 'score', '6'), (104, 2, 'score', '8')
SELECT
A.AuthKey
,Q.QuestionID
,Q.QuestionText
,A.AnswerText
FROM
@Questions Q
INNER JOIN @Answers A ON Q.QuestionID = A.QuestionID
UNION
SELECT
A.AuthKey
,Q.QuestionID
,Q.QuestionText
,Null
FROM
@Questions Q
CROSS JOIN @Answers A
WHERE
NOT EXISTS (SELECT 1 FROM @Answers SubQry WHERE SubQry.AuthKey = A.AuthKey AND SubQry.QuestionID = Q.QuestionID)
Output
AuthKey | QuestionID
| QuestionText
| AnswerText
101 | 1 | Comment | hi!!
101 | 2 | Score | 4
102 | 1 | Comment | excellent
102 | 2 | Score | 5
103 | 1 | Comment | NULL
103 | 2 | Score | 6
104 | 1 | Comment | NULL
104 | 2 | Score | 8
Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

Similar Messages

  • How to write query for this in TopLink ?

    I am doing a simple search in jsp where the search will the based on the choices chosen by user.
    I had given 3 check boxes for those choices.
    The problem is, query will be based on the choice or choices chosed by the user.
    How to write query for this in TopLink ?
    Thanks in Advance..
    Jayaganesh

    Try below solution, it is NOT best solution but might work:
    Declare @Questions TABLE (QuestionID INT, QuestionText Varchar(100))
    INSERT INTO @Questions
    VALUES (1, 'Comment'), (2, 'Score')
    DECLARE @Answers TABLE (authkey INT, QuestionID INT, questiontext VARCHAR(100), answertext VARCHAR(100))
    INSERT INTO @Answers
    VALUES (101, 1, 'comment', 'hi!!'), (101, 2, 'score', '4'), (102, 1, 'comment', 'excellent'), (102, 2, 'score', '5'), (103, 2, 'score', '6'), (104, 2, 'score', '8')
    SELECT
    A.AuthKey
    ,Q.QuestionID
    ,Q.QuestionText
    ,A.AnswerText
    FROM
    @Questions Q
    INNER JOIN @Answers A ON Q.QuestionID = A.QuestionID
    UNION
    SELECT
    A.AuthKey
    ,Q.QuestionID
    ,Q.QuestionText
    ,Null
    FROM
    @Questions Q
    CROSS JOIN @Answers A
    WHERE
    NOT EXISTS (SELECT 1 FROM @Answers SubQry WHERE SubQry.AuthKey = A.AuthKey AND SubQry.QuestionID = Q.QuestionID)
    Output
    AuthKey | QuestionID
    | QuestionText
    | AnswerText
    101 | 1 | Comment | hi!!
    101 | 2 | Score | 4
    102 | 1 | Comment | excellent
    102 | 2 | Score | 5
    103 | 1 | Comment | NULL
    103 | 2 | Score | 6
    104 | 1 | Comment | NULL
    104 | 2 | Score | 8
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • How to write query for this?

    Hello ppl!
    See, I am making a search application. I have a text field and a button on my screen. Now suppose i want to search for "abc", the search is succesful, but when i search for "a*", no results are shown.
    So what should be query which will satify both the scenarios?

    you asking about wild card search in SELECT statements?
    The following is the help on wild card search in SELECT statements
    ... WHERE CITY LIKE '%town%'.
    This condition is true if the column CITY contains a string containing the pattern ‘town’.
    ... WHERE NAME NOT LIKE '_n%'.
    This condition is true if the column NAME contains a value whose second character is not ‘n’.
    <b>... WHERE FUNCNAME LIKE 'EDIT#_%' ESCAPE '#'.
    This condition is true if the contents of the column FUNCNAME begin with EDIT_.</b>

  • How to write query for this given information???

    I have table (employees) like this
    Hire_date
    Salary
    04-jan-1991
    2000
    05-mar-1991
    1300
    12-sep-1991
    2400
    19-feb-1992
    3000
    17-apr-1992
    1000
    23-nov-1992
    1200
    25-jan-1993
    1000
    06-jun-1993
    1200
    I want  to get output like this
    Hire_date
    Salary
    Years in range
    total
    04-jan-1991
    2000
    05-mar-1991
    1300
    12-sep-1991
    2400
    01-jan-1991 to 31-dec-1991
    5700
    19-feb-1992
    3000
    17-apr-1992
    1000
    23-nov-1992
    1200
    01-jan-1992 to 31-dec-1992
    4200
    25-jan-1993
    1000
    06-jan-1993
    1200
    01-jan-1993 to 31-dec-1993
    2200
    give me some ideas guys

    Without using analytic functions,
    select
         hire_date,salary,
         decode(hire_date,null,extract(year from hire_date)) year_tag,
         decode(hire_date,null,sum(salary)) total_sal
    from
         employees
         group by grouping sets ((hire_date,salary,extract(year from hire_date)),extract(year from hire_date),())
    Output
    HIRE_DATE    SALARY  YEAR_TAG TOTAL_SAL
    04-JAN-91      2000
    05-MAR-91      1300
    12-SEP-91      2400
                             1991      5700
    19-FEB-92      3000
    17-APR-92      1000
    23-NOV-92      1200
                             1992      5200
    25-JAN-93      1000
    06-JUN-93      1200
                             1993      2200
                                      13100

  • How to write query for shuttle box

    hi
    i am creating an shuttle box on my input page and need to write a query to display the selected columns in the shuttle box..
    i have created the shuttle bottle and gave the static values in it , i can view my values but cannot understand how to give the condition which allows me to display the data
    only for selected columns ...
    Please Help

    thank you for reply..
    I am completely new to oracle apex...i think here there is a prcodure to get default values into the right side box, my question is , how do i write a query for all the items in the left side box columns when selected to right side, the data has to be displayed only for those columns...
    i am looking for syntax of the query ...
    For eg there 4 columns on the left hand side of the shuttle box
    job_id
    cluster_id
    cluster_code
    cluster_name
    and i select just job_id and cluster_id to right hand side , i need to display data associated with only these 2 columns...
    Please Help
    Edited by: user12855387 on Apr 20, 2010 11:08 AM

  • How to write code for this logic in a routine, very urgent --help me

    hi all,
    i want to apply this logic into one subroutin ZABC.
    here i m giving my logic ,can any body help me in coding for this, this is very urgent, i hv to submit on wednesday.
    4.1 Read the company code number BSEG-BUKRS from document line item.
    4.2 Fetch PRDHA from MARA into GV_PRDHA where MATNR = BSEG-MATNR.
    4.3 Fetch Business area (GSBER) from ZFIBU into GV_GSBER where (PRDHA = GV_PRDHA and BUKRS = BSEG-BUKRS) OR (PRDHA = GV_PRDHA and BUKRS = SPACE).
    4.4 If business area match is found, go to step 3.9. Else continue.
    4.5 If BKPF-BLART IN set “ZVS_POSDT” OR BKPF-XBLNR starts with “I0*”, execute steps below. Else, go to Step 3.6.
    i. MOVE: BSEG-BKURS TO work area field WA_ZFIBUE-BUKRS,
    BSEG-MATNR TO work area field WA_ZFIBUE-MATNR,
    GV_PRDHA TO work area field WA_ZFIBUE-PRDHA,
    BSEG-HKONT TO work area field WA_ZFIBUE-HKONT,
    BSEG-GSBER TO work area field WA_ZFIBUE-GSBER,
    BSEG-PSWBT TO work area field WA_ZFIBUE-PSWBT,
    BKPF-BUDAT TO work area field WA_ZFIBUE-BUDAT,
    SY-DATUM TO work area field WA_ZFIBUE-CREDATE,
    SY-UZEIT TO work area field WA_ZFIBUE-CRETIME,
    Fetch running serial number (WA_ZFIBUE-SERIALNO) from ZFICO. This number will be stored in ZFICO with PARAMTYPE = "BPM030307", SUBTYPE = "ZFIBUE" and KEY1 = "SERIALNO". The actual serial number will be stored in the field VALUE1.
    i. Insert WA_ZFIBUE INTO ZFIBUE.
    ii. Send email notification to the user (if it is not already sent to user on the same posting date).
    Use function module ‘SO_NEW_DOCUMENT_ATT_SEND_API1’ to send mail.
    Fetch email address and date of last email from ZFICO. These values will be stored in ZFICO with PARAMTYPE = "BPM030307", SUBTYPE = "EMAIL" and KEY1 = "<USERNAME>". The email address will be stored in the field VALUE1 and posting date in VALUE2. Once mail is sent, VALUE2 is updated with latest posting date (BKPF-BUDAT).
    iii. Increment the running serial number and update ZFICO with new serial number.
    a. GV_ SERIALNO = WA_ZFIBUE-SERIALNO + 1
    b. Update ZFICO Set value1 = GV_SERIALNO
    Where PARAMTYPE = "BPM030307" AND
    SUBTYPE = "ZFIBUE" AND
    KEY1 = "SERIALNO".
    iv Move “VDFT” to BSEG-GSBER.
    v. Exit routine.
    4.6 Fetch MTART into GV_MTART from MARA where MATNR = BSEG-MATNR.
    4.7 If SY-BATCH = INITIAL AND GV_MTART <> ‘ROH’, issue the error message - “Maintain the mapping of product hierarchy <PRDHA> from article <MATNR> for <BUKRS>”. Else, go to step 3.8.
    4.8 If SY-BATCH <> INITIAL AND GV_MTART <> ‘ROH’, issue the error message - “Maintain product hierarchy on article master”. Go to step 3.10.
    4.9 Move GV_GSBER TO BSEG-GSBER.
    4.10 Exit Routine
    plz give me reply asap --this is very urgent
    thanks in advance
    swathi

    Hi Swathi,
    If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop.

  • How to write SQL for this query

    Hi, All
    I have table which sample data are shown below
    CLM_NO. CLM_RUN PARTY PAY_CD
    2006213103246      2006085483      PA010193 3CO11
    2006213103246      2006085483 PA010193 3CO17
    2006213103246      0000000000 PA084113 2CO11
    2006213103246      0000000000 PA000001 2RK11
    2006213103246      0000000000 PA082822 3CO11
    2006213103270      0000000000 PA000001 2RK11
    2006213103270      0000000000 PA032456 3CO11
    for each clm_no , if data only have zero the report must show pay_cd minimum value(2RK11) but when clm_run have both zero and nonzero data the report will show minimum pay_cd of record that have clm_run nonzero data(3CO11)
    Thank you
    Mcka

    Hi Mcka
    Based on the example you have provided, we should have only the following two rows in the final result:
    CLM_NO. CLM_RUN PARTY PAY_CD
    2006213103246 2006085483 PA010193 3CO11
    2006213103270 0000000000 PA000001 2RK11
    The first line is displayed because even though there are 6 rows for CLM_NO 2006213103246, with a combination of zero and non-zero CLM_RUNS, we need to display the non-zero row containing the minimum PAY_CD.
    The second line is displayed because both rows have a zero CLM_RUN and we need to display the row which has the lowest PAY_CD.
    If this understanding sounds right to you then you need to create the following condition:
    RANK() OVER(PARTITION BY CLM_NO ORDER BY CLM_RUN DESC, PAY_CD ASC) = 1
    Can you follow what this is doing?
    Basically, for each CLM_NO, identified by the clause PARTITION BY CLM_NO, we are ranking the combination of CLM_RUN and PAY_CD where the CLM_RUN is sorted in high to low order and the PAY_CD is sorted in low to high order. This will cause Discoverer to allocate an ascending range of numbers starting with 1, where 1 corresponds to the row you are looking for. If we create a condition such that this whole expression equals 1 then we must display only the rows that you want, with one row being displayed per CLM_NO.
    Note: This works so long as the same CLM_NO cannot have two or more different CLM_RUN numbers where one of the higher CLM_RUNs has a lower PAY_CD than the other non-zero CLM_RUNs.
    It also makes the assumption that for a given non-zero CLM_RUN there will not be two or more identical PAY_CDs. If this condition can exist then you could exclude duplicate values from the report. If you have never done this there is a checkbox called Hide Duplicate Rows on the Layout tab of the Edit Worksheet Dialog box.
    Best wishes
    Michael

  • How to use REGEXP_REPLACE for this scenario?

    Oracle 10G Enterprise edition
    Hi all,
    Is it possible to use REGEXP_REPLACE for multiple replaces for the give text?
    For eg.
    select replace(replace('My oracle','o','O'),'M','m') from dual
    my Oracle
    Can we do this in a single regular expresion replace or suggest me any ideas?
    Thanks all
    R

    This could be a solution
    Processing ...
    select s as string
    from (
              with reps as (
                   select 'aaa' as src, 'AAA' as dst from dual
                   union all
                   select 'bbb' as src, 'BBB' as dst from dual
              ), strings as (
                   select ' bbb a sample string aaa' as string from dual
              select *
              from reps
                   cross join strings
              model
                   partition by ( string )
                   dimension by (row_number() over(partition by string order by src ) idx)
                   measures (string as s,src,dst)
                   rules (
                        s[any] order by idx desc = replace(presentv(s[cv()+1],s[cv()+1],s[cv()]),src[cv()],dst[cv()])
    where idx = 1
    Query finished, retrieving results...
             STRING         
    BBB a sample string AAA Bye Alessandro

  • How to write code for this logic, plz help me very urgent

    Hi All,
    i am new to sap-abap, i got this work and i m working on this can any body help me in writing code, plz help me, this is very very urgent.
    here  i m giving my logic, can anybody send me the code related to this logic.
    this is very urgent .
    this program o/p should be in ALV format and need to create one commond 'SAVE" on this o/t list  if  user clicks save processedon and processedby fields in ZFIBUE should be updated automatically.
    i am creating one custom table zfibue having fields: (serialno, bukrs, matnr,prdha,hkont,gsber,wrbtr,budat, credate, cretime,processed, processedon, processedby,mapped)
    fields of zfibue:
    serailno = numc
    bukrs = char
    matnr = char
    prdha = char
    hkont = char
    gsber = char
    wrbtr = char
    budat = date
    credate = date
    cretime = time
    processed= char
    processedon = date
    processedby = char
    mapped = char      are   belongs to above type data types
    and seelct-optionfields:  s_bukrs for bseg-bukrs
                                        s_hkont for bseg-hkont,
                                         s_budat for bkpf-budat,
                                         s_processed for zfibue-processed,
                                          s_processedon for zfibue-processedon,
                                          s_mapped. for zfibue-mapped
    parameters: p_chk1 as checkbox,
                      p_chk2 as checkbox.
                      p_filepath type rlgrap-filename.
    1.1 Validate the user inputs (S_BUKRS and S_HKONT) against respective check tables (T001 and SKB1). If the validation fails, provide respective error message. Eg: “Invalid input for Company Code”.
    1.2 Fetch SERIALNO, BUKRS, MATNR, PRDHA, HKONT, GSBER, WRBTR, BUDAT, CREDATE, CRETIME, PROCESSED, PROCESSEDON, PROCESSEDBY, MAPPED from table ZFIBUE into internal table GT_ZFIBUE where BUKRS IN S_BUKRS, HKONT IN S_HKONT, BUDAT IN S_BUDAT, PROCESSED IN S_PROCESSED, PROCESSEDON IN S_PROCESSEDON, and MAPPED IN S_MAPPED.
    1.3 If P_CHK2 = ‘X’, go to step 1.11. Else continue.
    1.4 If P_CHK1 = ‘X’, continue. Else go to step 1.9
    1.5 Fetch MATNR, PRDHA from MARA into GT_MARA for all entries in GT_ZFIBUE where MATNR = GT_ZFIBUE-MATNR.
    1.6 Sort and delete adjacent duplicates from GT_MARA based on MATNR.
    1.7 Loop through GT_ZFIBUE where PRDHA = blank.
              Read Table GT_MARA based on MATNR = GT_ZFIBUE-MATNR.
              IF sy-subrc = 0.
                     Move GT_MARA-PRDHA to GT_ZFIBUE-PRDHA.
                  Modify Table GT_ZFIBUE. “Update Product Hierarchy
                 Endif.
        Fetch PRDHA, GSBER from ZFIBU into GT_ZFIBU for all entries in GT_ZFIBUE where PRDHA = GT_ZFIBUE-PRDHA.
        Read Table GT_ZFIBU based on PRDHA = GT_ZFIBUE-PRDHA.
              IF sy-subrc = 0.
                     Move GT_ZFIBU-GSBER to GT_ZFIBUE-GSBER.
                  Move “X” to GT_ZFIBUE-MAPPED.      
                  Modify Table GT_ZFIBUE.
                 Endif.   
    Endloop.
    1.8 Modify database table ZFIBUE from GT_ZFIBUE.
    1.9 Fill the field catalog table GT_FIELDCAT using the details of output fields listed in section “Inputs/Outputs” (above).
       Eg:                 LWA_ FIELDCAT -SELTEXT_L = 'Serial Number’.
                              LWA_ FIELDCAT -DATATYPE = ‘NUMC’.
                              LWA_ FIELDCAT -OUTPUTLEN = 9.
                              LWA_ FIELDCAT -TABNAME = 'GT_ZFIBUE'.
                              LWA_ FIELDCAT-FIELDNAME = 'SERIALNO'.
              Append LWA_FIELDCAT to GT_FIELDCAT
    Note: a) The output field GT_ZFIBUE-PROCESSED will be editable marking INPUT = “X” in field catalog (GT_FIELDCAT).
             b) The standard ALV functionality will be used to give the user option for selecting all or blocks of entries at a time.
             c) The PF-STATUS STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN will be copied to the program and modified to include a “SAVE” button.
    1.10 Call the function module REUSE_ALV_GRID_DISPLAY passing output table GT_ZFIBUE and field catalog GT_FIELDCAT. Additional parameters like I_CALLBACK_PF_STATUS_SET (= ‘ZFIBUESTAT’) and I_CALLBACK_USER_COMMAND (=’HANDLE_USER_ACTION’) will also be passed to handle user events. Go to 2.14.
    1.11 Download the file to P_FILEPATH using function module GUI_DOWNLOAD passing GT_ZFIBUE.
    1.12 Exit Program.
    Logic to be implemented in  routine “Handle_User_Action”
    This routine will have the following interface:
    FORM Handle_User_Action  USING r_ucomm LIKE sy-ucomm
                                                               rs_selfield TYPE slis_selfield.
    ENDFORM.
    Following logic will be implemented in this routine:
    1.     If r_ucomm = ‘SAVE’, continue. Else exit.
    2.     Loop through GT_ZFIBUE where SEL_ROW = ‘X’. “Row is selected
    a.     IF GT_ZFIBUE-PROCESSED = ‘X’.
    i.     GT_ZFIBUE-PROCESSEDON = SY-DATUM.
    ii.     GT_ZFIBUE-PROCESSEDBY = SY-UNAME.
    iii.     MODIFY ZFIBUE FROM work area GT_ZFIBUE.
    Endif.
    Endloop.

    Hi Swathi,
    If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop.

  • Classical report how to write code for this task

    coding
    Delivery Due List: This Report program generates list with details of quantity available, quantity planned, quantity delivered and quantity still to be delivered for sales orders and stock transport orders based on shipping point

    Hi,
    Try to get TABLE and FIELD names from your senoir or functional consultants.
    or
    search the field names in the following tables...
    VBAP
    LIPS
    VBRP.
    Regards,
    Billa

  • How to use MERGE for this scenario?

    I am using oracle 10G and i need a help on using MERGE statement based on a condition.
    I have no values in table test_tab. So the below MERGE should insert the value, but it is not inserting the record. Please corret me if anything wrong with the below Query.
    MERGE INTO test_tab t
       USING (SELECT NO
                FROM test_tab) s
       ON (s.NO = 1)
       WHEN MATCHED THEN
          UPDATE
             SET t.str = 'EXIST'
       WHEN NOT MATCHED THEN
          INSERT (t.NO, t.str)
          VALUES (1, 'NOT_EXIST');

    MERGE INTO test_tab t
       USING  test_tab s
       on (t.no = 1 )
       WHEN MATCHED THEN
          UPDATE
             SET t.str = 'EXIST'
       WHEN NOT MATCHED THEN
          INSERT (t.NO, t.str)
          VALUES (1, 'NOT_EXIST');

  • How to write query for below requirement

    Hi sir,
    i have a table x have one column y which containing value like below
    Y
    a
    b
    c
    d
    I want out put like below  kindly help me:
    Y
    a
    d
    c
    b

    Hi ,
    Please check:
    select y from (
    select case when y='a' then 1 else 2 end no, y from table_x
    ) order by no asc, y desc
    with table_x as(
    select 'a' y
      from dual
    union  
    select 'b' y
      from dual
    union 
      select 'c' y
      from dual
    union  
      select 'd' y
      from dual
    select y from (
    select case when y='a' then 1 else 2 end no, y from table_x
    ) order by no asc, y desc
    Thank you

  • How  to write select query for this

    Hi,
    I had a html form and in the for i had drop down box and it needs to select multiple values from the drop down box. When i select multiple values then i have to write the SQL select statement  query .
    When i try to write the select statement and trying to run i am getting error.
    select * from Table
    where emo_no = '1,2,3'
    this is how i write query please suggest me how  to write query for selecting multiple values from the drop down box.
    Thanks

    select * from Table
    where emo_no in ( 1,2,3)
    for integer values
    select * from Table
    where emo_no in ('1','2','3')
    for characters
    If we talk about large scale applications that may have millions of records, I would suggest this.
    declare @t table (v int)
    insert into t (v) values (1)
    insert into t (v) valves (2)
    insert into t (v) values (3)
    select *
    from table
         inner join @t t on table.emo_no = t.v
    Using "in" for a where clause is not so bad for filtering on a few values, but if you are filtering a lot of rows and a lot of values (emo_no) the performance degrades quickly for some reasons beyond the scope of this.
    This is just one solution, I'll through this out as well, instead of an in memory (@t) table, doing a disk based temp table (#t) and creating an index on the column "v".
    create table #t (v int)
    insert into #t (v) values (1)
    insert into #t (v) valves (2)
    insert into #t (v) values (3)
    create index ix_t on #t (v)
    select *
    from table
         inner join #t t on table.emo_no = t.v
    drop table #t
    Pardon any syntax errors and careful using a drop statement.
    Sometimes in memory tables work better than disk temp tables, it takes some testing and trial and error depending on your datasets to determine the best solution.
    Probably too much info  ;-)
    Byron Mann
    [email protected]
    [email protected]
    Software Architect
    hosting.com | hostmysite.com
    http://www.hostmysite.com/?utm_source=bb

  • How to form a query for this requirment

    Hi Friends,
    I have a database table in which I store the employee data along with his phone number. Now this row of data can repeat for different phone number depending on if it is office phone or home phone or cell phone.
    But in the output of query, I need name of empoyee and other three columns namely "Home Phone", "Office Phone" and "Cell Phone".
    If employee has three rows for each kind of phone, then in the result of query all three columns for phone numbers should be filled, otherwise as many columns should be filled with data as different phone numbers employee has.
    Can any one please post SQL query for this scenario ?
    Thanks in Adavance

    I cannot imagine, that second and third query are
    under any circumstances faster as first one, but i
    can imagine that they are slower You stated that query without the inline view can only be faster. Did you check on optimizer plans or use tkprof to verify your claim?
    A quick check on those two selects
    SELECT object_id, object_type, object_name
      FROM user_objects;
    SELECT object_id, object_type, object_name
      FROM (SELECT object_id, object_type, object_name
              FROM user_objects)
              ;didn't show any changes in the explain plan unter 10g1.
    C.

  • How to write program for handling  script ?

    In script i have 2 pages.
    In first page i have constant windows and variable windows.
    In second page i have main window.
    How to write program for this?

    Hi
    You need to write a driver program. You need to use open form, then write_form to write data into various windows and then close_form to close.
    As you don't want main window in the first page first try out just by having the window in the second page; i guess system will take care of it. As all other windows filled and if u start writing data in the main it'll go for next page.
    If doesn't work have the window on the first page with the least hight and write a command
    IF &SYST-PAGE& EQ 1
        NEXT-PAGE.
    ENDIF.
    Then in the second page you can have the main window hight as per your requirement.
    Here is an example
    (1) Get customer data
      TABLES: scustom, sbook, spfli.
      DATA: bookings like sbook...
      select * from...
    (2) Open form
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          DEVICE = 'PRINTER'
          FORM = 'S_EXAMPLE_1'
          DIALOG = 'X'
        EXCEPTIONS
          others = 1
    (3) Print table heading
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          ELEMENT = 'HEADING'
          TYPE = 'TOP'
          WINDOW = 'MAIN'
          FUNCTION = 'SET'
    (4) Print customer bookings
      LOOP AT bookings WHERE
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            ELEMENT = 'BOOKING'
            TYPE = 'BODY'
            WINDOW = 'MAIN'
      ENDLOOP
    (5) Close form
      CALL FUNCTION 'CLOSE_FORM'
    Regards
    Surya.

Maybe you are looking for

  • How to open a pdf file in Acrobat Reader from a webdynpro application

    Hi, I need to open a pdf file stored in the server from a web dynpro application. The pdf needs to be opened in the stand alone reader at the client and not in a reader embedded in the browser. Cheers, Krish

  • Spool pdf email

    I converted the spool to pdf mailed the pdf form. i got the mail and when i tried to open the pdf form it is showing a popup ''the file is damaged and could not be repaired".

  • Sim Pin Bug?

    Hi, I'm not sure but I may have found a bug in the new iOS using iPhone 5. I've done a search for the scenario which I'll explain. But I can't seem to see anyone replicating this. I have a pin set for both the unlocking of the phone and for the sim a

  • Upgrading to Skype Premium

    Hi, I just paid for the upgrade to "premium" but am not sure how I go about loading the new software, is there a process that I need to follow?  My order details are as follows: Product name: Skype Premium Order reference: [removed for privacy]

  • Ive problems with quicktime rendering quality

    okay so i just exported my adobe flash cs5.5 cartoon episode "goodbye cruel world part 3/3" and i tried to uncompressed it and do all other sorts of things to stop it from copying the image i exported from quicktime so can anyone help ??? i dont wann