Select the progress of an another sql statement

What I want to do is to monitor the progress of a sql statement which takes a long time. How many percent of the statement is already done.
I know there is the possibility to do this with a query.
But I can' t remember how to do this exactly.
Can somebody help me?
Thanks a lot!

Here is a SELECT that I usually run:
COLUMN MODULE FOR A20
COLUMN OPNAME FOR A20
COLUMN SOFAR FOR 999999999999
COLUMN TOTALWORK FOR 999999999999
COLUMN UNITS FOR A20
COLUMN REMAINING FOR 999999999
COLUMN ELAPSED FOR 999999999
SELECT
           S.SID
          ,S.AUDSID
          ,S.OSUSER
          ,S.MODULE
          ,L.OPNAME
          -- ,TARGET                
          -- ,TARGET_DESC           
          -- ,CONTEXT               
          ,L.SOFAR
          ,L.TOTALWORK
          ,L.UNITS
          ,L.START_TIME            
          ,L.LAST_UPDATE_TIME
          ,L.TIME_REMAINING REMAINING
          ,L.ELAPSED_SECONDS ELAPSED
          -- ,MESSAGE               
          -- ,USERNAME              
          ,L.SQL_ADDRESS
          -- ,SQL_HASH_VALUE        
          -- ,QCSID       
          -- ,A.SQL_TEXT
     FROM V$SESSION_LONGOPS L
          ,V$SESSION S
          -- , V$SQLAREA A
     WHERE L.TIME_REMAINING <> 0
          AND L.SID = S.SID
          AND L.SERIAL# = S.SERIAL#
;Note that V$SESSION_LONGOPS as a rule does not show long operations which take a lot of index range scans - this is not a "long operation"

Similar Messages

  • How to get the process id of a sql statement or a session  ....

    How to get the process id of a sql statement or a session . ..?
    Thanks

    What about this?
    SELECT pid
      FROM v$session s, v$process p
    WHERE p.addr = s.paddr
       AND s.sid = :sid;   -- replace :sid with your session idRegards.
    Al

  • The maximum size of an SQL statement has been exceeded.

    In ST22, abap dump shows that one of the possible reason was "The maximum size of an SQL statement has been exceeded."
    How can I know what's the maximum size and how to compute that size had been reached?
    Is this shown anywhere in the log?

    1. decalre temp_key as a table.
    2. use this package size option ....this gets the data in bite-sized chunks
    SELECT MATKL MATNR MEINS
    INTO corresponding fields of table TEMP_KEY package size 1000
    FROM MARA
    WHERE MATNR IN SO_MATNR.
    loop at temp_key.
    MOVE-CORRESPONDING TEMP_KEY TO ITAB_KEY1.
    IF WS_PCHR SPACE.
    CLEAR ITAB_CHAR.
    CLEAR ITAB_KEY1-CHARACTER. REFRESH ITAB_KEY1-CHARACTER.
    PERFORM GET_CHAR TABLES ITAB_CHAR ITAB_KEY1-CHARACTER
    USING ITAB_KEY1-MATNR.
    ENDIF.
    APPEND ITAB_KEY1. CLEAR ITAB_KEY1.
    endloop.
    ENDSELECT.

  • DBIF_RSQL_INVALID_RSQL The maximum size of an SQL statement was exceeded

    Dear,
    I would appreciate a helping hand
    I have a problem with a dump I could not find any note that I can help solve the problem.
    A dump is appearing at various consultants which indicates the following.
    >>> SELECT * FROM KNA1                     "client specified
    559                  APPENDING TABLE IKNA1
    560                  UP TO RSEUMOD-TBMAXSEL ROWS BYPASSING BUFFER
    ST22
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "/1BCDWB/DBKNA1" had to be terminated because it has
        come across a statement that unfortunately cannot be executed.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
         and
        therefore caused a runtime error.
        The reason for the exception is:
        The SQL statement generated from the SAP Open SQL statement violates a
        restriction imposed by the underlying database system of the ABAP
        system.
        Possible error causes:
         o The maximum size of an SQL statement was exceeded.
         o The statement contains too many input variables.
         o The input data requires more space than is available.
         o ...
        You can generally find details in the system log (SM21) and in the
        developer trace of the relevant work process (ST11).
        In the case of an error, current restrictions are frequently displayed
        in the developer trace.
    SQL sentence
    550     if not %_l_lines is initial.
    551       %_TAB2[] = %_tab2_field[].
    552     endif.
    553   endif.
    554 ENDIF.
    555 CASE ACTION.
    556   WHEN 'ANZE'.
    557 try.
    >>> SELECT * FROM KNA1                     "client specified
    559                  APPENDING TABLE IKNA1
    560                  UP TO RSEUMOD-TBMAXSEL ROWS BYPASSING BUFFER
    561    WHERE KUNNR IN I1
    562    AND   NAME1 IN I2
    563    AND   ANRED IN I3
    564    AND   ERDAT IN I4
    565    AND   ERNAM IN I5
    566    AND   KTOKD IN I6
    567    AND   STCD1 IN I7
    568    AND   VBUND IN I8
    569    AND   J_3GETYP IN I9
    570    AND   J_3GAGDUMI IN I10
    571    AND   KOKRS IN I11.
    572
    573   CATCH CX_SY_DYNAMIC_OSQL_SEMANTICS INTO xref.
    574     IF xref->kernel_errid = 'SAPSQL_ESCAPE_WITH_POOLTABLE'.
    575       message i412(mo).
    576       exit.
    577     ELSE.
    wp trace:
    D  *** ERROR => dySaveDataBindingValue: Abap-Field= >TEXT-SYS< not found [dypbdatab.c  510]
    D  *** ERROR => dySaveDataBindingEntry: dySaveDataBindingValue() Rc=-1 Reference= >TEXT-SYS< [dypbdatab.c  430]
    D  *** ERROR => dySaveDataBinding: dySaveDataBindingEntry() Rc= -1 Reference=>TEXT-SYS< [dypbdatab.c  137]
    Y  *** ERROR => dyPbSaveDataBindingForField: dySaveDataBinding() Rc= 1 [dypropbag.c  641]
    Y  *** ERROR => ... Dynpro-Field= >DISPLAY_SY_SUBRC_TEXT< [dypropbag.c  642]
    Y  *** ERROR => ... Dynpro= >SAPLSTPDA_CARRIER< >0700< [dypropbag.c  643]
    D  *** ERROR => dySaveDataBindingValue: Abap-Field= >TEXT-SYS< not found [dypbdatab.c  510]
    D  *** ERROR => dySaveDataBindingEntry: dySaveDataBindingValue() Rc=-1 Reference= >TEXT-SYS< [dypbdatab.c  430]
    D  *** ERROR => dySaveDataBinding: dySaveDataBindingEntry() Rc= -1 Reference=>TEXT-SYS< [dypbdatab.c  137]
    Y  *** ERROR => dyPbSaveDataBindingForField: dySaveDataBinding() Rc= 1 [dypropbag.c  641]
    Y  *** ERROR => ... Dynpro-Field= >DISPLAY_FREE_VAR_TEXT< [dypropbag.c  642]
    Y  *** ERROR => ... Dynpro= >SAPLSTPDA_CARRIER< >0700< [dypropbag.c  643]
    I thank you in advance
    If you require other information please request

    Hi,
    Under certain conditions, an Open SQL statement with range tables can be reformulated into a FOR ALL ENTRIES statement:
        DESCRIBE TABLE range_tab LINES lines.
        IF lines EQ 0.
          [SELECT for blank range_tab]
        ELSE.
          SELECT .. FOR ALL ENTRIES IN range_tab ..
          WHERE .. f EQ range_tab-LOW ...
          ENDSELECT.
        ENDF.
    Since FOR ALL ENTRIES statements are automatically converted in accordance with the database restrictions, this solution is always met by means of a choice if the following requirements are fulfilled:
    1. The statement operates on transparent tables, on database views or on a projection view on a transparent table.
    2. The requirement on the range table is not negated. Moreover, the range table only contains entries with range_tab-SIGN = 'I'
    and only one value ever occurs in the field range_tab OPTION.
    This value is then used as an operator with operand range_tab-LOW or range_tab-HIGH.In the above example, case 'EQ range_tab-LOW' was the typical case.
    3. Duplicates are removed from the result by FOR ALL ENTRIES.This must not falsify the desired result, that is, the previous Open SQL statement can be written as SELECT DISTINCT.
    For the reformulation, if the range table is empty it must be handled in a different way:with FOR ALL ENTRIES, all the records would be selected here while this applies for the original query only if the WHERE clause consisted of the 'f IN range_tab' condition.
    FOR ALL ENTRIES should also be used if the Open SQL statement contains several range tables.Then (probably) the most extensive of the range tables which fill the second condition is chosen as a FOR ALL ENTRIES table.
    OR
    What you could do in your code is,
    prior to querying;
    since your select options parameter is ultimately an internal range table,
    1. split the select-option values into a group of say 3000 based on your limit,
    2. run your query against each chunck of 3000 parameters,
    3. then put together the results of each chunk.
    For further reading, you might want to have a look at the Note# 13607 as the first suggestion is what I read from the note.

  • Using a Bind Variable in the FROM part of a SQL Statement?

    Hello Everyone,
    I have a problem, I am trying to run an SQL statement. However I need the FROM part of the SQL statement to be a bind variable. This is because the end user will need to select between 2 database views.
    I have tried this:
    select CON_ID from :P23_DB_NAME where CON_LEGACY_ID=:P23_CONLEG_NO
    I had no luck. The error i got was,
    "+Query cannot be parsed within the Builder. If you believe your query is
    syntactically correct, check the ''generic columns'' checkbox below the
    region source to proceed without parsing.
    ORA-00903: invalid table name+"
    Which makes sence, but now I am a bit stuck.
    Does anyone have any ideas as to get around this problem?
    Thanks in Advance.
    -N.S.N.O.

    The example I gave you is quite simple. You need to take some time to study it to see where you need be carefull what you put where. Now, your example of course doesn't work becaues you have several errors. This will work for you:
    DECLARE
       x   VARCHAR2 (4000);
    BEGIN
       x := x || 'SELECT CON_ID FROM ';
       x := x || :p23_db_name;
       x := x || ' WHERE CON_LEGACY_ID = ' || :p23_conleg_no;
       RETURN (x);
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Query cannot be parsed within the Builder ORA-00900: invalid SQL statement

    Why am I getting the error message "Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00900: invalid SQL statement"
    If I run the query in sqlplus it comes back with "no rows selected" which is what I want.
    The function is valid and the user has privileges to run it.
    Is there something I can do about it?
    If I only have any field instead of the function the error goes away.
    Can someone explain what is happening? I'm using 2.0.
    select
    F_TOTAL_AMOUNT_PAID('fees',a.acct_fee_id,0) "Fee Paid"
    from fee_component a, fee b, license c
    where a.acctfee_id = b.acctfee_id
    and b.license_id = c.license_id
    and b.fee_status = 'U'
    and c.client_id = :P301_CLIENT_ID
    Thanks I really appreciate any help I can get.

    Does your parsing schema have direct granted privileges to execute the function or privileges via a role? If it is through a role, you need to directly grant execute on the function to your parsing schema.
    Mike

  • Please tell me the  Three table INNER JOIN Sql statement

    Hi experts,
      I got requirement like by using INNER JOIN i have to write the code in MY program i.e using 3 tables VBAK VBAP and VBUK.And the common field is VBELN .SO please give the  INNER JOIN SQL statement for above three tables...
    vbak-vbeln,erdat
    vbap-vbeln,posnr
    vbuk-vbeln,RFSTK
    Thanks in Advance

    hi guglani  please see my total code b.caus DATA is not extracting...once see the code  correct error.
    DATA:V_VBELN TYPE VBAK-VBELN.      "VBAK,VBAP AND VBUK
    SELECT-OPTIONS SORDER FOR V_VBELN.
    TYPES:BEGIN OF T_VBAK,
         VBELN TYPE VBELN_VA,
         ERDAT TYPE ERDAT,
      END OF T_VBAK.
    TYPES:BEGIN OF T_VBAP,
           VBELN TYPE VBELN_VA,
            POSNR TYPE POSNR_VA,
      END OF T_VBAP.
    TYPES:BEGIN OF T_VBUK,
        VBELN TYPE VBELN,
      RFSTK TYPE RFSTK,
      END OF T_VBUK.
    TYPES:BEGIN OF FS,
       VBELN TYPE VBELN_VA,
         ERDAT TYPE ERDAT,
    POSNR TYPE POSNR_VA,
      RFSTK TYPE RFSTK,
      END OF FS.
    DATA:WA1 TYPE T_VBAK,
         WA2 TYPE T_VBAP,
         WA3 TYPE T_VBUK,
         WA TYPE FS.
    DATA:ITAB1 TYPE TABLE OF T_VBAK,
          ITAB2 TYPE TABLE OF T_VBAP,
          ITAB3 TYPE TABLE OF T_VBUK,
          ITAB TYPE TABLE OF FS.
    select a~vbeln a~erdat b~posnr c~rfstk
           from vbak as a inner join vbAP as b on a~vbeln = b~vbeln
                          inner join vbuk as c on a~vbeln = c~vbeln
    into table itab
    where A~vbeln eq SORDER.
    IF NOT ITAB IS INITIAL.
      SORT ITAB BY VBELN.
    ENDIF.
    LOOP AT ITAB INTO WA.
       WRITE:/ WA-VBELN,WA-ERDAT,WA-rfstk.
       ENDLOOP.
       CLEAR WA.
       REFRESH ITAB.

  • How to get the time for executing an SQL statement?

    hi all...
    How can I get the total execution time for a given SQL statement to a ViewObject which is created dynamically for this SQL so that the end user knows it before hand and try to stop it or go further..?
    Please post any ideas if you have got..!!!
    thanx in advance..
    grüss
    K°vi

    This is not really a question for the JDeveloper forum, but rather for the DB forum.
    Since Oracle9i there is a way to estimate how long a query will take, before executing it.
    Check it out in the Oracle DB documentation or ask on the DB forum.
    There is no built-in functionality for this in JDeveloper, but you should be able to call out to the DB from your Java code to get the estimate.

  • Java Code  that can find all the specified functions in a sql statement

    If i pass a string like
    SELECT CONCAT(region_name,store_name) , length( region_name) , region_name || store_name, region_name, store_name FROM Geography
    WHERE store_name = 'Boston';
    Then my code should return
    CONCAT(region_name,store_name)
    length( region_name)
    region_name || store_name
    i.e all function related stuff. Is there any parser in java that can parse all the functions a sql or ny code that can d that. Any help is highly appreciated

    I suspect a regular expression may be able to handle this, or 'grep'. Why do you need to do it in Java?

  • Question regarding the execution of cursors and SQL statements

    Hi,
    I have cursor which fetches results from a table A.
    Now, simultaneously, in other session, I ran an update on the table A and commited it.
    1) My question is will the cursor keep fetching the old results or the cursor start fetching the new values when the data is committed?
    2) I have a similar question in SQL too. We generally write SQL queries which take considerable amount of time- around half an hour. During this time, I ran an update on the table and committed it. Will the result set contain the old values ?
    As per my knowledge, both should fetch the old values.
    But, I would like to get my beliefs reinforced.
    Thanks for your help.
    Don

    donisback wrote:
    Thanks John..
    Your post drives me to ask another question. We've been getting the error "Snapshot Too Old" quite frequently.
    So, we minimized the SQL and used cursor committing every 10000 records. This prevented the above error.
    Is there any other possible reason why we get the error "Snapshot too Old"?
    Thanks,
    DonDon:
    Typically, commiting more frequently increases the likelyhood of 1555, not decreases it. The 1555 error comes when the undo (or rollback in old terms) records that need to be read to support read consistency are no longer available. Simplistically, once a change has been committed, the undo records are marked as available for re-use and could be re-used thereby destroying the information that you need.
    Even though ithe initial question is really old, read the Ask Tom thread posted by RPuttagunta. Tom explains it far better than I could, and the basic concepts have not changed.
    John
    John

  • The import collides with another import statement

    What is this? Why this happens? I've just imported a class name to the JSP that has much more level imports. This JSP isn't even validated. I don't wanna rename my class has the same name as in one of the jar files on the class path.

    nromanc wrote:
    Skipping imports is not possible."skipping" as in not having any. Not possible? Why?
    More naturally fully qualified names could be used in the rarely used practices.
    much more typing and increase in the file size happens.The size of your source file might increase, yes.
    Wild-cards also lead to not optimized imports hence bad performance.Imports are a compile-time only construct. Any performance impact import wildcards might have are limited to compile-time.
    I didn't find correct answer in an old thread.
    I've posted correct answer but a moderator is blocked it.The reason for blocking it is given as "your post as it doesn't make much sense, and detracts from the good advice already given and well received."
    I do not know what you wrote. I cannot see blocked posts. I have no reason to doubt the reason given.

  • Execute the sql statement stored in table

    friends i m in complication that, how can i execute sql statement which is stored in database table.
    how can i fetch that particular statement from table and make it execute!!!
    Thanks in advance

    I think we should stop at this point and have a little think.
    My understanding is that your plan is to do the following
    -Execute a Dynamic SQL statement which is constructed from values in several columns in a table (Bad idea to begin with)
    -The result of the execution is then loaded into PL/SQL.....not sure how you are handling different column lists but I'll assume you are not having to convert every column value to a VARCHAR2
    -The values returned are then used in an INSERT statement
    So basically your goal here is to take some data from one table and insert it into another table by moving data from SQL to PL/SQL then back to SQL in an elaborate, dynamic way. This is a costly waste of resources and will not scale (this is before we get to the problem of having to read the SQL statement from a table in the first place)
    I would recommend looking the INSERT SELECT statement here: http://psoug.org/reference/insert.html
    This will get the job done in one go. If you really do need it to be dynamic (which you don't, trust me) then you can still store this statement in your "dynamic SQL" table and execute it using EXECUTE IMMEDIATE although I can say for sure that you're going to run into more problems down the line with this architecture, it won't scale very well, and you'll probably waste at least *1* day of your time every week trying to fix a bug caused by the removal of a table, change to a column name etc.......
    However if you believe that storing SQL in a table is the best solution to your problem then go ahead.....at least when you find out that it isn't you'll have learned a valuable lesson.

  • FDM Integration script - Selecting the Period from SQL based on FDM PoV

    Hi,
    I want query SQL Period Column for the month based on the FDM PoV, can or has anyone a sample script of how this is can be achieved?
    My script when run comes back with "No records to load" - msg in my script. Let me know if you can spot anything obvious that's causing this in my script.
    SQL table
    EVENT    YEAR     Period      Entity       Ccy         Acc          ICP         Value     Product
    Actual
    FY14
    May
    HME_AT
    EUR
    ws_inp
    NULL
    39
    HRX537C2VKEA
    Actual
    FY14
    May
    HME_AT
    EUR
    ws_inp
    NULL
    3
    HS2411Z1E
    Dim objSS   'ADODB.Connection
    Dim strSQL    'SQL string
    Dim strSelectPer 'FDM Period
    Dim strCurFDMYear'FDM Year
    Dim rs        'SQL Recordset
    Dim rsAppend   'FDM tTB table append rs object
    Dim recordCount
    Dim sWhere
    Dim sSelect
    'Initialize objects
    Set cnSS = CreateObject("ADODB.Connection")
    Set rs = CreateObject("ADODB.Recordset")
    Set rsAppend = DW.DataAccess.farsTable(strWorkTableName)
    'Get Current POV Period And Year And determine HFM Select Year
    strSelectPer = Left((RES.PstrPer), 3)
    strCurFDMYear = Right(RES.PstrPer, 4)
    Select Case UCase(strSelectPer)
    Case "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"
      strSelectYear = strCurFDMYear + 1
    Case "JAN", "FEB", "MAR"
         strSelectYear = strCurFDMYear
    End Select
    'Watch with this as it can cause looping
    On Error Resume Next
    Err.clear
    'Connect to SQL database
    'cnSS.Open "Driver=SQL Server;Server=EHEINTRADCG\EHEINTRADCG;Database=dw_foundation;UID=hypdb"
    cnSS.Open "Driver=SQL Server;Server=EHEINTRADCG\EHEINTRADCG;Database=ODI_WORK_MARS;UID=hypdb"
    'Connect to SQL Server database
    cnSS.CommandTimeout = 1200
    'Keep the error message handling in for testing but will probably need  to write
    'to a log if running in an overnight batch
    'Error Handling
    If  Err.Number <> 0  Then  
    '  An exception occurred
    RES.PlngActionType = 2
    RES.PstrActionValue =  Err.Description & Chr(10) & "Unable to connect to SQL Data Source"
    Err.clear
    Set cnSS = Nothing
    FinAllLocs_Conv = False
    Exit Function
    End If
    'Create query String
    strSQL = strSQL & "From ODI_WORK_MARS.dbo.TMP_HFM_DATA_EXTRACT_TIN1 "
    strSQL = sWhere & " And YearID =  '" & strSelectYear & "'  And PeriodID = '" & strSelectPer & "'"
    'Get data
    rs.Open strSQL, cnSS
    '    Check For data
    If rs.bof And rs.eof Then
      RES.PlngActionType = 2
             RES.PstrActionValue = "No Records to load!"
      Exit Function
    End If
    '   RecordCount = 0
        'Loop through records and append to FDM tTB table in location's DB
    If Not rs.bof And Not rs.eof Then
      Do While Not rs.eof
    'Create the record 
      rsAppend.AddNew
       rsAppend.Fields("PartitionKey") = RES.PlngLocKey         ' Location ID
       rsAppend.Fields("CatKey") = RES.PlngCatKey          'Current Category ID
       rsAppend.Fields("PeriodKey") = RES.PdtePerKey         'Current Period ID
          rsAppend.Fields("DataView") = "YTD"            'Data View ID
       rsAppend.Fields("CalcAcctType") = 9            'Input data indicator
       rsAppend.Fields("Entity") = rs.fields("Entity").Value        ' Entity/Genpo ID
       rsAppend.Fields("Account")= rs.fields("Account").Value        'Account ID
          rsAppend.Fields("ICP") = rs.fields("Inter_Company_Entity_HFM").Value   ' Inter-Co/Destination
       rsAppend.Fields("Amount") = rs.fields("Value").Value        ' Data Value ID
      rsAppend.Update
      RecordCount = Recordcount + 1
      rs.movenext
      Loop
    End If
    'Records loaded
    RES.PlngActionType = 2
        RES.PstrActionValue = "SQL Import successful!   "  & RecordCount
    'Assign Return value
    SAP_HFM = True
    End Function

    Hi,
    the easiest way to check it is to redirect your SQL query to text file and then execute in a SQL tool.
    You should write the value of strSQL (which actually seems to have missing the SELECT clause)
    In any case, your SQL statement seems to be incomplete:
    strSQL = strSQL & "From ODI_WORK_MARS.dbo.TMP_HFM_DATA_EXTRACT_TIN1 "
    strSQL = sWhere & " And YearID =  '" & strSelectYear & "'  And PeriodID = '" & strSelectPer & "'"
    - You have not initialized strSQL with SELECT clause (maybe sSelect?)
    - You have not initialized sWhere with WHERE clause
    In addition to this, your source year is in FYYY format while you are taking year from POV as YYYY.
    (...And YearID = 2014 while in your table you have FY14)
    After you check this, get the SQL statement, review it, and try to launch against your source DB in a SQL tool.
    Regards

  • Single select query or any sql statement with o/p

    Hi,
    I have one table test_tab with column names empno,empname.The test_tab values is as follows,
    empno empname
    01 siva
    02 ram
    03 kamal
    04 sathish
    i will give the empname values like 'siva,kamal,roshan,sathish' and empno >03,but in the table roshan name is not there.I need the below mentioned o/p
    example qry: select empno,empname from test_tab where empname in('siva','kamal','roshan','sathish') and empno>03;
    my o/p should be like this,
    empname empno
    sathish 04
    roshan ''
    But the empname 'roshan' is not there in table.I need the empname as 'roshan' and empno is null value in a single select query or subquery or any sql statements.
    Please help me the resolve this issue.
    Thanks
    Sivaraman

    Hi,
    Do you want this?
    with data as
    (select 1 EMPNO, 'siva' as empname from  DUAL union all
    select 2 EMPNO, 'ram' from  DUAL union all
    select 3 EMPNO, 'kamal' from  DUAL union all
    select 4 EMPNO, 'sathish' from  DUAL union all
    select null EMPNO, 'roshan' from  DUAL )
    select *  from data
    where EMPNAME in ('siva','kamal','roshan','sathish')
       and nvl2(empno,empno,4) > 3 

  • Can the format of a SQL Statement modify the execution time of an SQL ....

    Can the format of a SQL Statement modify the execution time of an SQL statement?
    Thanks in advance

    It depends on:
    1) What oracle version are you using
    2) What do you mean for "format"
    For example: if you're on Oracle9i and changing format means changing the order of the tables in the FROM clause and you're using Rule Based Optimizer then the execution plan and the execution time can be very different...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

Maybe you are looking for

  • The broken link error

    Hi, Please help me with this broken link error in Office Excel 2010. Thank you. The problem is: a broken link cannot be removed from the file. The link was used in data validation, which refers to a list of values. After the path was corrected, it st

  • Fast forward goes past chapter points

    Hi, I am also experiencing the same problem. After burning the project into a disc we tested it on a DVD player. In normal play, the videos would stop at the end of a chapter however when we press fast forward it would bypass chapters. Instead of sto

  • Brief about Console, data manager and Import manager

    Hi, Iam new to MDM we just started installing our MDM components and iam a MM functional guy Can you any one tell me about console, data manager and import manger i need to know the following, 1. what is it 2. How the 3 is interlinked 3. can the data

  • InDesign Help/Question

    I have recently purchased InDesign for my journalism class. My students have been learning the program and building our school newspaper for several weeks now with no major issues. Yesterday however, when they tried to open the file they had been usi

  • I have 2 Office Jet Pro 8500 printers. One at work and one at home. I also have a lap top that I ca

    I have 2 Office Jet Pro 8500 printers.  One at work and one at home. I also have a lap top that I can get to print to the first printer I installed but it will not print to the printer I installed second. I even changed web address on laptop to the o