Select Query--General Question

Hello All,
With out using WHERE CLAUSE Can we select first 10 rows from a table in Oracle..??
This is an interview question I faced recently!!
Thank you
Kiran

How about this...
SQL> create table xtmp (n number);
Table created.
SQL> insert into xtmp select rownum from all_objects where rownum < 11;
10 rows created.
SQL> select b.* from xtmp a left join (select rownum rn, c.* from emp c) b on a.n=b.rn;
        RN      EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
         1       7369 SMITH      CLERK           7902 17-DEC-80        800                    20
         2       7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
         3       7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
         4       7566 JONES      MANAGER         7839 02-APR-81       2975                    20
         5       7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
         6       7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
         7       7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
         8       7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
         9       7839 KING       PRESIDENT            17-NOV-81       5000                    10
        10       7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
10 rows selected.you can use pl/sql table instead of above temp table.
Thanks..

Similar Messages

  • Slow running query --General question

    This is just a scenario that you may have come across too. For example there is a query (tables and views) that returned data very quickly until yesterday but slowed down today and takes forever. What do you make out of it and why did it run fine until yesterday?
    What would you first look at to resolve this?
    This only a general scenario. I understand there could be a lot of factors like data loads but i want to know the best approach. Thanks in advance for your answer. 
    svk

    First thing I would see is the amount of data. How much of data was I querying yesterday, how much of data am I querying today? Is it a possible situation to have a slow query(just by some minutes but not hours and so on)..
    Then, I will look at the query execution plan and try to avoid any table scan's or seeks by creating any possible valid indexes over the tables being joined.
    Use necessary tables only in the query, remove any unnecessary LEFT join's and use them only if needed..
    Remove ORDER BY in the queries. Not using NOT IN or UNION or DISTINCT such kind of operations if permitted.
    Avoid any sort of Bookmark lookups..
    These are the primary things I would consider to look at when any query is slow, at first...
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • Select query performance improvement - Index on EDIDC table

    Hi Experts,
    I have a scenario where in I have to select data from the table EDIDC. The select query being used is given below.
      SELECT  docnum
              direct
              mestyp
              mescod
              rcvprn
              sndprn
              upddat
              updtim
      INTO CORRESPONDING FIELDS OF TABLE t_edidc
      FROM edidc
      FOR ALL ENTRIES IN t_error_idoc
      WHERE
      upddat GE gv_date1 AND
      upddat LE gv_date2 AND
      updtim GE p_time AND
      status EQ t_error_idoc-status.
    As the volume of the data is very high, our client requested to put up some index or use an existing one to improve the performance of the data selection query.
    Question:
    4.    How do we identify the index to be used.
    5.    On which fields should the indexing be done to improve the performance (if available indexes donu2019t cater to our case).
    6.    What will be the impact on the table performance if we create a new index.
    Regards ,
    Raghav

    Question:
    1.    How do we identify the index to be used.
    Generally the index is automatically selected by SAP (DB Optimizer )  ( You can still mention the index name in your select query by changing the syntax)
      For your select Query the second Index will be called automatically by the Optimizer, ( Because  the select query has u2018Updatu2019 , u2018uptimu2019 in the sequence before the u2018statusu2019 ) .
    2.    On which fields should the indexing be done to improve the performance (if available indexes donu2019t cater to our case).
    (Create a new Index with MANDT and the 4 fields which are in the where clause in sequence  )
    3.    What will be the impact on the table performance if we create a new index.
    ( Since the index which will be newly created is only the 4th index for the table, there shouldnu2019t be any side affects)
    After creation of index , Check the change in performance of the current program and also some other programs which are having the select queries on EDIDC ( Various types of where clauses preferably ) to verify that the newly created index is not having the negative impact on the performance. Additionally, if possible , check if you can avoid  into corresponding fields .
    Regards ,
    Seth

  • Question on Select query

    Hi,
    I need to prepare a select query which can fetch the below mentioned scenario:
    Ztable has fields zident, date, time, status. (zident, date, time are key fields)
    zident      date        time               status      
    10001    02/09/09    111111                s
    10001    02/08/09    222222                p
    10001    02/07/09     333333               s        from this set only one ident should come which              
    10001    02/01/09     333333               s        has latest status
    10001    02/02/09     333333               s
    10001    02/03/09     333333               s
    10002    02/09/09    111111                s
    10002    02/08/09    222222                p
    10002    02/07/09     333333               s      from this set only one ident should come which              
    10002    02/01/09     333333               s      has latest status
    10002    02/02/09     333333               s
    10002    02/03/09     333333               s
                  and so on.............
    from one set of ident one record should come in this way so many set of idents will be there.
    My question is how to form the select query

    Hello Chandra,
    Your solution lies in the concept of Control-Break Statements.
    AT NEW..
    AT END OF
    AT LAST, etc.
    DATA:
      BEGIN OF fs_table,
        zident TYPE char20,
        date   TYPE sy-datum,
        time  TYPE sy-uzeit,
        status TYPE C,
      END OF fs_table.
    DATA:
            t_table LIKE
    STANDARD TABLE
                  of   fs_table.
    " Populate the data in Internal Table.
    " While displaying data.
    LOOP AT t_table INTO fs_table.
      AT NEW status.
         WRITE:/ fs_table-status.
      ENDAT.
         WRITE:/ fs_table-zident,
                      fs_table-date,
                      fs_table-time.
      ENDLOOP.
    You can also use ON CHANGE OF fs_table-status, instead of AT NEW, if you get ***//* for date and time.
    With this, status will be displayed once and remaining will following under it.
    If you want everything to be displayed on change of each new field, apply that to every field,
    eg:
    AT NEW zident.
       WRITE:/ fs_table-zident.
      ENDAT.
    AT NEW date.
       WRITE: fs_table-date.
    ENDAT.
    .. so on and so forth.
    This is just a test-case, try using the control break statements.
    Hope it helps you.
    Thanks: Zahack

  • Questions on the most efficient select query..

    What is the difference between the two select query & please explain y is the 2nd select query more efficient??
    DATA: MAX_MSGNR type t100-msgnr.
    MAX_MSGNR = '000'.
    SELECT * FROM T100 INTO T100_WA
      WHERE SPRSL = 'D' AND
            ARBGB = '00'.
      CHECK: T100_WA-MSGNR > MAX_MSGNR.
      MAX_MSGNR = T100_WA-MSGNR.
    ENDSELECT.
    DATA: MAX_MSGNR type t100-msgnr.
    SELECT MAX( MSGNR ) FROM T100 INTO max_msgnr
      WHERE SPRSL = 'D' AND
            ARBGB = '00'.

    Hi,
    First never use Check statement in the Select.
    Next thing Select ... end select.
    Coming to ur question In case of first select it will fetch each record from the data base and compares that record value with the variable(MAX_MSGNR) and assigns the value to the variable. And this process will continue till the select reads all the records of the data base. Also these operations happens on the data base server. SO this query not only affect ur program but also others who is accessing the same data base.
    Second query is most efficient because of the aggregate function MAX. Here it will fetch all the records in single go and checks the max value for that column using
    optimising algorithm. So number of checks, assignments(single assignment) and fetches will be less compared to first select. This is the main reason. Hope this clarified ur doubt.
    Another thing is in first query we are selecting all the fields where as in second we are selecting only one field(required)
    Thanks,
    Vinod.
    Edited by: Vinod Kumar Vemuru on Mar 13, 2008 4:55 PM

  • Dynamic Select query question

    I have a select query which uses a session variable in the
    where clause like so:
    select employee_lastname
    from employee
    where employee_id IN (#session.ids#)
    This runs fine if I have only 1 employee id in session.ids,
    but if I have multiple (i.e. 22,26,49) it crashes. Do I need to do
    some sort of list or string conversion on my session variable?
    Thanks in advance!
    Dave

    I re-read my reply and it came off as if i didn't read your
    (op) last post, sorry about that. I attempted to recreate your
    effect (see code below) I did a 'quick' session on the output page;
    <cfquery datasource="#DSN#" name="test">
    select busName, ID
    from Hernandomembers
    </cfquery>
    <body>
    <form id="form1" name="form1" method="post"
    action="delme.cfm">
    <label>
    <select name="list" id="select" multiple="multiple">
    <cfoutput query="test">
    <option value="#ID#">#busName#</option>
    </cfoutput>
    </select>
    </label>
    <label>
    <input type="submit" name="button" id="button"
    value="Submit" />
    </label>
    </form>
    Collects the selections of members from my DB and sends it to
    a page with ....
    <cfset SESSION.employee_ids=StructNew()>
    <cfset SESSION.employee_ids="#form.list#">
    <cfoutput>#SESSION.employee_ids#<br />
    </cfoutput>
    <cfquery datasource="#DSN#" name="test">
    select busName,ID
    from Hernandomembers
    where ID IN(#SESSION.employee_ids#)
    </cfquery>
    <cfoutput query="test">
    #ID# - #busName#<br />
    </cfoutput>
    And it works just as yours should.. So i guess I'd still like
    to see how your getting the selections into the session, if not the
    same way as me.

  • Select query differences between oracle 9 and oracle 8.

    Hi,
    I have a problem using the select query between oracle 7 and oracle 9i I don't have the same result :
    ex:
    With oracle7
    SQL> select 'champ1','champ2' from DUAL;
    'CHAMP 'CHAMP
    champ1 champ2
    With Oracle 9
    SQL> select 'champ1','champ2' from DUAL;
    'CHAMP1' 'CHAMP2'
    champ1 champ2
    So Can someone tell me how to solve this problem ? Is there a parameter in oracle 9 to set?
    Thanx.

    Whenever you are posting anything over internet forums like this - you should be very careful about not just posting the details which requires to solve the problem - also should be sensible about your question.
    This is not at all desired when you are posting such question. It may be because - you may not well aware of the fact.
    My suggestion is -> First Go through the basics Of SQL in general.
    Then go for any specific product like Oracle/ SQL Server/ Sybase etc.
    And, finally learn the advanced commands of that DB.
    You asked it - may be you thought the difference in output in terms of lines. But, that is not your actual output. That is the graphical display part only.
    Anyway,
    You can get the quite familier output by first type the following command ->
    set lin 310Regards.
    Satyaki De.

  • Report Builder Question - OA AR Aging - and a general question

    I'm sure this is the wrong forum for this question, but I thought there might be someone here who might be using Oracle Applications and Report Builder who'd be kind enough to help me out.
    We've recently implemented Oracle Applications 11.5.10 and I have to use report builder to change the Accounts Receiveable Aging (7 bucket) to a 5 bucket report. I've already made some changes to the seeded "ARXAGMW.rdf" report, but I'm not a big Oracle Reports guy. I've stumbled through making some changes in various other reports. But this one is just plain nasty! :)
    I was thinking that I could simply add buckets 6 & 7 to bucket 5, then just hide or delete the 6 & 7 buckets. But I'm not sure where to even start. Any help with this would GUARANTEE a Christmas or other holiday card this year! :)
    I really want to keep this simple as possible, so any help would be very....helpful. :)
    Oh, my general question is: Are there any resouces/books for Oracle Reports (Report Builder)? I feel so lost trying to modify existing reports, let alone creating new ones.
    Thanks again!
    Steve

    Hi Steve,
    I am working on the 7-bucket aging report and i want to add a new field in data model.
    As the query is build dynamically, i have modified the function BUILD_CUSTOMER_SELECT to meet my requirements.
    But the problem is that in the data model, the field is not present in my Grouping. and if I try to add the field in the Data Model query (Q_ Customer) section,
    i get the following error: ORA-01789: query block has incorrect number of result columns.
    The query is as shown below:
    select rpad('a',50,'-') short_cust_name,
    0 cust_id,
    rpad('a',30,'-') cust_no,
    rpad('a',500,'-') sort_field1,
    rpad('a',40,'-') sort_field2,
    0 payment_sched_id,
    rpad('a',32,'-') class,
    sysdate due_date,
    0 amt_due_remaining,
    0 days_past_due ,
    0 amount_adjusted,
    0 amount_applied,
    0 amount_credited,
    sysdate gl_date,
    'x' data_converted,
    0 ps_exchange_rate,
    0 b0,
    0 b1,
    0 b2,
    0 b3,
    0 b4,
    0 b5,
    0 b6,
    rpad('a',25,'-') bal_segment_value,
    rpad('a',500,'-') inv_tid,
    rpad('a',32,'-') invoice_type
    , 'y' parent_cust --I WANT A NEW FIELD HERE TO BE VIEWED ON THE REPORT LAYOUT LATER
    from dual
    where 1=2
    UNION ALL
    &common_query_cus
    Did i missed somthing 4 me to be able to add the field here?

  • Regarding SELECT query

    Dear experts,
    Is there a way for the following SELECT query to be improved?
    The problem that I'm seeing here is that the same table (l_item_tab) is being queried twice in the SELECT query (due to the "table joins", a and b). How can I improve the data retrieval here? And I also can't change the SELECT query to be out of the loop - ledger is a select-option and multiple values are possible.
    * Get Ledger
      SELECT * FROM t881 INTO TABLE lt_t881
        WHERE rldnr IN s_rldnr.
      LOOP AT lt_t881.
    *   Get FI-SL user-defined item table based on ledger
        PERFORM get_sl_item_tab USING lt_t881-rldnr CHANGING l_item_tab.
      " L_ITEM_TAB is populated here
    *   Get SL line items
        SELECT * APPENDING CORRESPONDING FIELDS OF TABLE gt_glu1
        FROM (l_item_tab) AS a
        WHERE
            rldnr         IN s_rldnr             " Ledger
        AND rbukrs        IN s_bukrs             " Company code
        AND ryyrkeg_wwsub IN s_wwsub             " Subsystem
        AND racct         IN s_racct             " Account no
        AND ryymac        IN s_yymac             " Management area
        AND rtcur         IN s_rtcur             " Trx currency
        AND docnr         IN s_docnr             " Doc. number
        AND docty         IN s_docty             " Doc. type
        AND docct         EQ c_docct_l           " Doc. category (L = Local)
        AND ryear         IN s_ryear             " Fiscal year
        AND budat         IN s_budat             " Posting date
        AND yystodt       IN s_stodt             " Reversal date
        AND yystgrd       IN s_stgrd             " Reversal reason
        AND yyintref      IN s_intref            " Interface ID
        AND NOT exists
          ( SELECT * FROM (l_item_tab) AS b
             WHERE
                 b~rldnr    = a~rldnr     AND
                 b~docnr    = a~docnr     AND
                 b~rbukrs   = a~rbukrs    AND
           ( ( ( b~docct    = c_docct_y
              OR b~docct    = c_docct_x ) AND
                 b~refryear = a~ryear )   OR
             ( ( b~docct    = c_docct_u
              OR b~docct    = c_docct_t ) AND
                 b~ryear    = a~ryear ) )
      ENDLOOP.
    Edited by: Rob Burbank on Jun 23, 2010 12:33 PM

    >
    Siegfried Boes wrote:
    > > Will certainly try this out too..
    > maybe you should think twice .... The usage of a subselect is that the result set is not transferred to the application server it is only needed
    > during the selection.
    >
    > You should anser the following questions:
    > + who wrote the code? you or? I get the impression that you don't know what is intended.
    > + SQL Trace, what are the numbers for repeated executions, (go to summary by SQL statement), duration, execution, records
    > + how many different tables are accessed, l_item_tab is dynamic
    > + what knid of tables are accessed?
    >
    > Siegfried
    Hi Siegfried,
    - The codes are currently existing ones and they were not written by me too. I just do know that the first / main SELECT statement in the query is for retrieving FI special ledger line item data records, while the second / sub SELECT statement is to ensure that the line item data records are not already reversed, and not a reversal.
    - In the summarized SQL trace of a sample test run: executions = 1, identical executions = 0, duration = 700247324 (almost 100% of the total processing durations), records = 0 (there should be more records returned in an actual production run)
    - Only one table, ZZGLV4A (custom) is accessed based on the selection screen variant. ZZGLV4A is an FI special ledger line item table and its data volume: 455 mil. data records. Note: The codes are written for a report that runs in the background, and the selection screen variant is used for the executions too. The table accessed (l_item_tab is ZZGLV4A in this case) depends on the ledger inputted here - only one ledger is specified for the current selection screen variant.
    - Table accessed - FI special ledger line item data.
    I tried tuning the query a little further by just properly specifying the WHERE fields - only a minimal improvement is observed, an average of about 6% of runtime improvement only (tested via SE30 in the development box for ZZGLV4A but its table volume is 4 mil. data records here only). This obviously works only for the table ZZGLV4A for now, I'm afraid.
    Any other ideas on how such subqueries can be improved generally (maybe secondary indexes)? The subquery is certainly re-hitting the same table at least twice.
    Thanks for the inputs once again!

  • Select query to take time

    Hi to all.
    in table am using xmltype column.
    table Test designed as
    empid int
    type int
    doc xmltype
    Test table contains 2 laks records.
    select query is
    Select empid,type, doc from Test Where empid=2;
    while this qry execute more time. without doc select performance is fast. am find out doc selection only take more time
    any other alternate way to reduce time..

    Note the name of this forum is SQL Developer *(Not for general SQL/PLSQL questions)* (so for issues with the SQL Developer tool). Please post these questions under the dedicated SQL And PL/SQL forum (you've posted there before).
    Regards,
    K.

  • General Question Index

    Hi,
    I've a question on index.
    Say in a big sql query, which has join of two tables.
    SELECT A.COL1,A.COL2,B.COL4
    FROM A INNER JOIN B
    ON A.COL1 = B.COL1
    AAND A.COL2 = B.COL2
    General question , if I want to tune this do I need to create index on B.COL4?
    what I am trying to understand is, for tuning index is needed on columns in the WHERE condition or Columns from the select list or both.
    I understand it is all relative, we need to see the plan etc.. but my question is in general.
    Thanks
    Neil

    Neil
    Does not the query have a WHERE clause? If it does, look at the columns that participate in WHERE clause + COVER (include clause all column you have in SELECT).. Also col1+col2 should have indexes. 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Oracle 11g :SELECT query blocked..??

    Hi Experts,
    could you please explain why the below SQL query is blocked?
    SELECT 1 FROM DUAL is blocking the SQL statement on GTTAPPUSR@gttccuatcriba04 ( SID=469 ) blocked SQL -> DELETE FROM GTTDB.PURCHASE_ENTRY_ID=:1
    SELECT 1 FROM DUAL is blocking the SQL statement on GTTAPPUSR@gttccuatcriba04 ( SID=367 ) blocked SQL -> DELETE FROM GTTDB.PURCHASE_ENTRY_ID=:1
    I am scratching my head without any solution when I had a look at the db today. Thanks in advance for your help.
    Regards,
    Boris
    Edited by: user12075620 on Dec 4, 2012 8:58 AM

    The SELECT statement is not blocking the UPDATE. As I said in the previous reply, the string that this query produces does not match the logic.
    This query is (at least on the surface) correctly identifying that session 1 is blocking session 2. Session 1 holds some lock that session 2 is waiting on. So far, so good. Since session 2 is waiting on the lock, we can easily enough see what session 2 is running (the UPDATE statement). But since session 1 is not blocked, it is potentially off running a ton of other SQL statements (or no SQL statement at all). The query is looking to see what session 1 is running currently. It has no way of determining what session 1 ran at some point in the past to acquire the lock in the first place.
    Going back to my KING example,
    At noon, session 1 runs
    UPDATE emp
       SET sal = sal * 2
    WHERE ename = 'KING'Session 1 now has a lock on the KING row in the EMP table. But session 1 neither commits nor rolls back, it is still in a transaction. Session 1 might not have any more activity for a long time-- the user might go off to lunch, for example (obviously, applications should not be designed to allow users to maintain open transactions indefinitely, but not all applications are designed correctly). Or it might start running other queries. Let's say that session 1 now runs a query that is going to go for an hour
    SELECT *
      FROM giant_view_with_lots_of_computationsNow, at 12:45, session 2 comes in and runs
    UPDATE emp
       SET bonus = 100
    WHERE ename = 'KING'Session 2 is blocked. Session 2 is running the UPDATE statement. Session 1 still holds the lock but it is running some completely unrelated SQL statement.
    If we run the query you posted, the query will correctly report that session 1 is running the query against the GIANT_VIEW_WITH_LOTS_OF_COMPUTATIONS but incorrectly imply that this SELECT query is the source of the lock. It is not. It simply happens to be the query that the session that does hold the lock happens to be executing at the current moment (why the application seems to be running a lot of queries that select a constant from dual is a separate question).
    Justin

  • Select query is working on oracle 10.1.0 but its not working in 10.2.0

    select query is working and retrieving some data from oracle database server 10.1.0.2.0, but same query is not working in 10.2.0.1.0 database server, its throws(ORA-00942: table or view does not exist)
    But schema related tables and relevant details are same in 10.2.0.1.0 database server, so don't think that table is missing on that schema.
    Note: Query length is upto 480 line
    I have validate all the things, everything is fine, i don't why that query is not executing in different version.
    I am in helpless in this situation?, anybody faced this issue?
    Thanks in advance

    Validated means all the tables and and columns are verified, i just running in sqlprompt,
    Say for example:
    sql> select * from table1;
    One thing i observed while executing the query its showed error in one location of select sql. i mean particular word in select sql.
    After that i combined some three lines of huge select sql into single then i am getting error in different location i mean different word...
    My question is how same query executing in Oracle 10g Release 1, same dump (its exported from Release1) imported into oracle 10g release 2 is not executing. its shows Table or view doesn't exit.

  • Using case when statement in the select query to create physical table

    Hello,
    I have a requirement where in I have to execute a case when statement with a session variable while creating a physical table using a select query. let me explain with an example.
    I have a physical table based on a select table with one column.
    SELECT 'VALUEOF(NQ_SESSION.NAME_PARAMETER)' AS NAME_PARAMETER FROM DUAL. Let me call this table as the NAME_PARAMETER table.
    I also have a customer table.
    In my dashboard that has two pages, Page 1 contains a table with the customer table with column navigation to my second dashboard page.
    In my second dashboard page I created a dashboard report based on NAME_PARAMETER table and a prompt based on customer table that sets the NAME_ PARAMETER request variable.
    EXECUTION
    When i click on a particular customer, the prompt sets the variable NAME_PARAMETER and the NAME_PARAMETER table shows the appropriate customer.
    everything works as expected. YE!!
    Now i created another table called NAME_PARAMETER1 with a little modification to the earlier table. the query is as follows.
    SELECT CASE WHEN 'VALUEOF(NQ_SESSION.NAME_PARAMETER)'='Customer 1' THEN 'TEST_MART1' ELSE TEST_MART2' END AS NAME_PARAMETER
    FROM DUAL
    Now I pull in this table into the second dashboard page along with the NAME_PARAMETER table report.
    surprisingly, NAME_PARAMETER table report executes as is, but the other report based on the NAME_PARAMETER1 table fails with the following error.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: S1000 code: 1756 message: [Oracle][ODBC][Ora]ORA-01756: quoted string not properly terminated. [nQSError: 16014] SQL statement preparation failed. (HY000)
    SQL Issued: SET VARIABLE NAME_PARAMETER='Novartis';SELECT NAME_PARAMETER.NAME_PARAMETER saw_0 FROM POC_ONE_DOT_TWO ORDER BY saw_0
    If anyone has any explanation to this error and how we can achieve the same, please help.
    Thanks.

    Hello,
    Updates :) sorry.. the error was a stupid one.. I resolved and I got stuck at my next step.
    I am creating a physical table using a select query. But I am trying to obtain the name of the table dynamically.
    Here is what I am trying to do. the select query of the physical table is as follows.
    SELECT CUSTOMER_ID AS CUSTOMER_ID, CUSTOMER_NAME AS CUSTOMER_NAME FROM 'VALUEOF(NQ_SESSION.SCHEMA_NAME)'.CUSTOMER.
    The idea behind this is to obtain the data from the same table from different schemas dynamically based on what a session variable. Please let me know if there is a way to achieve this, if not please let me know if this can be achieved in any other method in OBIEE.
    Thanks.

  • Select query taking too much time to fetch data from pool table a005

    Dear all,
    I am using 2 pool table a005 and a006 in my program. I am using select query to fetch data from these table. i.e. example is mentioned below.
    select * from a005 into table t_a005 for all entries in it_itab
                       where vkorg in s_vkorg
                       and     matnr in  s_matnr
                       and     aplp   in  s_aplp
                       and     kmunh = it_itab-kmunh.
    here i can't create index also as tables are pool table...If there is any solutions , than please help me for same..
    Thanks ,

    it would be helpful to know what other fields are in the internal table you are using for the FOR ALL ENTRIES.
    In general, you should code the order of your fields in the select in the same order as they appear in the database.  If you do not have the top key field, then the entire database is read. If it's large then it's going to take a lot of time.  The more key fields from the beginning of the structure that you can supply at faster the retrieval.
    Regards,
    Brent

Maybe you are looking for

  • How do you update software when there are multiple users with different (unknown) apple ID's?

    We are a college with different users borrowing 'loaner' Macbooks. several users with different ID's have installed software that is now tied to that Machines serial number, and cannot be updated or removed apparently. We are trying to update iPhoto

  • How to automate the creation of Function Module & Class Object (SE24)

    Experts, I have the requirement to automate the creation of any type of programs: ie function module (like how we normally create in SE37 together with the parameters), class object (like how we normally create in SE24 together with attribute & metho

  • HT204053 how can i find my icloud password?

    i can't remembe my icloud password.  where can i find it or reset it.  i am only directed to reset the password that goes with my apple id.  help?

  • File upload with ODBC

    Hi, I want to upload a file using only the ODBC functions available in PHP to a oracle DB (i'm using a blob column, if this is not correct, please tell me). I tried uploading it as a "normal" query but it doesn't work, oracle gives error... So i'm as

  • Warehouse Details (Nos.) at Ship to Party Field in TPO.

    Dear Friends, In a SO where we select Ship to Party for Each line item. I want Warehouse Nos. should also be listed under ship to party. So that i can select delivery address as Company Warehouse.( DC) This requirement is For TPO (Third Party orders)