Select query or RH_READ_INFTY?

Hello experts,
I have a report where I am fetching the Work schedule(IT 0007) for all employees for all the period. I have written a select query for the same. I am planning to replace it with FM RH_READ_INFTY. Since I am not using LDB, I cannot use Macros to read data.
I ran a trace using both to find performances of both, but couldnt actually figure out as it doesnt show the time taken by FM. Instead it shows select queries fired on PA0007 table(which I am doing in first place).
So please guide me as to which approach I should follow in this or any general case when it comes to reading IT data without using LDB.
Thanx!,
HOward.

Hello Marcin,
Thankyou for your valuable response.
I guess you would be calling this fm for each EE separately
Yes. I am looping on all PERNRs and have to fetch data for around 4-6 infotypes for each employee.
So I guess I will have to use this FM 4-6 times for each employee. Even with the FM, it must opening a database connection.
I feel, it would be as bad as firing select queries inside a loop.
The custom select can be optimzed to establish the communication
with DB only once for whole population (which of course means more complicated
query to analyze by DB Optimizer but the data would be transported in one run).
As you said,
What I have done is, fired queries on all PA tables for respective infotypes and fetched the all the data in one shot.
Later I have used READ statement to get the data I want.
It really depends on your requirement. If you go for custom select query,
you just extract specific information from the system skipping all the authorization checks,
That might be a crucial issue. What  are the authorization checks here we are talking about?
Does the FM read data from any
other tables than we do in select queries?
Thnx!
Howard

Similar Messages

  • Select Query Problem

    Hi Experts,
    I am having a select query in which I am using a variable in the where condition but it is giving error. Please suggest how to use variable in the select query.
    The query I am using is a s below.
    select * from zexc_rec into table it_ZEXC_REC
          where
           LIFNR in S_LIFNR and
          DOCNO in S_DOCNO and
          DOCTYP in doc_typ and
          DATE1 in S_DATE1 and
          MATNR in S_MATNR.
    Here doc_typ is a variable.
    Thanks.

    Rahul,
    use RANGES type variable instead of variable . It acts as a select-options variable. Thn use this variable in SELECT query with IN.
    Eg :
    RANGES r_t510 FOR t510-lgart.
        r_t510-low = '1600'. 
        APPEND r_t510.
        r_t510-low = '3190'. 
        APPEND r_t510.
    Note  : can be use SIGN, OPTIONS properties too in RANGES type.
    More deatils go through on HELP of RANGES
    Rgds,
    Ranjith

  • 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

  • Oracle SQL Select query takes long time than expected.

    Hi,
    I am facing a problem in SQL select query statement. There is a long time taken in select query from the Database.
    The query is as follows.
    select /*+rule */ f1.id,f1.fdn,p1.attr_name,p1.attr_value from fdnmappingtable f1,parametertable p1 where p1.id = f1.id and ((f1.object_type ='ne_sub_type.780' )) and ( (f1.id in(select id from fdnmappingtable where fdn like '0=#1#/14=#S0058-3#/17=#S0058-3#/18=#1#/780=#5#%')))order by f1.id asc
    This query is taking more than 4 seconds to get the results in a system where the DB is running for more than 1 month.
    The same query is taking very few milliseconds (50-100ms) in a system where the DB is freshly installed and the data in the tables are same in both the systems.
    Kindly advice what is going wrong??
    Regards,
    Purushotham

    SQL> @/alcatel/omc1/data/query.sql
    2 ;
    9 rows selected.
    Execution Plan
    Plan hash value: 3745571015
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    | 1 | SORT ORDER BY | |
    | 2 | NESTED LOOPS | |
    | 3 | NESTED LOOPS | |
    | 4 | TABLE ACCESS FULL | PARAMETERTABLE |
    |* 5 | TABLE ACCESS BY INDEX ROWID| FDNMAPPINGTABLE |
    |* 6 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
    |* 7 | TABLE ACCESS BY INDEX ROWID | FDNMAPPINGTABLE |
    |* 8 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
    Predicate Information (identified by operation id):
    5 - filter("F1"."OBJECT_TYPE"='ne_sub_type.780')
    6 - access("P1"."ID"="F1"."ID")
    7 - filter("FDN" LIKE '0=#1#/14=#S0058-3#/17=#S0058-3#/18=#1#/780=#5#
    8 - access("F1"."ID"="ID")
    Note
    - rule based optimizer used (consider using cbo)
    Statistics
    0 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    0 bytes sent via SQL*Net to client
    0 bytes received via SQL*Net from client
    0 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    9 rows processed
    SQL>

  • 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.

  • Select Query resulting in Scientific Notation

    Hello all,
    I am running a Select query through a batch file that extracts data from an Oracle database. Several of the fields that I am extracting from contain numbers that are up to 38 digits long. When I extract the data, it converts the numbers into scientific notation and it is important for me to have the entire field. Is there something I can change to my query that will pull the data in its entire form? This is what I'm running now:
    select * FROM ML.APPT where APPTDATE >= to_date('01/1/2010','mm/dd/yyyy'
    I apologize in advance if this has been answered already.
    Thanks!

    >
    When the extractor finishes, it returns the data into a flat file.
    don't quite understand the TO_CHAR function. Does this function mean I need to say something like this: select "TO_CHAR('column name', 99999999999999999999999999999999999999" FROM ML.APPT where APPTDATE >= to_date('01/1/2010','mm/dd/yyyy')
    >
    Yes- if the tool you use to extract the data (your 'extractor') is converting the numeric data to a string then it is responsible for creating the string in the proper format. If the number is an integer that can have as many digits as you have '9's in your sample format string then that is what you need to do.
    Here is how sql*plus (Oracle's tool) will display the data using default settings
    SQL> select 12345678901234567890123456789012345678 no_format,
      2  to_char(12345678901234567890123456789012345678, '99999999999999999999999999
    999999999999') with_format
      3   from dual;
    NO_FORMAT WITH_FORMAT
    1.2346E+37  12345678901234567890123456789012345678
    SQL>
    ----- TOAD will display something similiar but the default uses more decimal digits in the scientific notation data
    NO_FORMAT,WITH_FORMAT
    1.23456789012346E37, 12345678901234567890123456789012345678You can either format the numeric data in the query using TO_CHAR or the 'extractor' can do it when it converts the data to a string.

  • Select-options in SELECT query - syntax error

    Hi all,
      I get the error below when I try to use the select options in a SELECT query . Please help me.
    "The IN operator with "SO_AWART" is followed neither by an internal
    table nor by a value list."
    The code i have used(Logical database  PNP is used):
    TABLES: pernr,
            catsdb.
    INCLUDE ztime_cwtr_top.    " global Data
    INCLUDE ztime_cwtr_f01.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.
    PARAMETERS P_THRES TYPE I.
    SELECTION-SCREEN END OF BLOCK B1.
    Get data from CATSDB table. Workdates within the date interval are considered.
      SELECT pernr workdate awart catsquantity beguz enduz status
      FROM catsdb
      INTO TABLE it_catsdb
      WHERE pernr  = pernr-pernr    AND
           workdate GE pn-begda     AND
           workdate LE pn-endda     AND
           status   IN ('20', '30') AND
           awart    IN  so_awart .
          awart    IN ('1100', '1137', '1138', '1139', '1140',
                      '1147', '1148', '1149', '1157', '2003' ).
    when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.
    I have tried different options like using only the select-options in the where condition.
    Thanks in advance.....
    Madhu

    Solved.
    Code with syntax error:
    include z...top .
    include z...fo1.
    select-options: xxxxxxx
    Code  with no syntax error:
    select-options: xxxxxxx
    include z...top .
    include z...fo1.
    Thanks for all your help,
    Madhu

  • Query in Select query operation

    Please excuse me for posting this again.
    I'm stuck up with this for 3 days. Lenghty post pls do read and help me.
    How is the select query going to be changed in the SAP so that the original database behind it understands it. I want to know the operation of IN operation in where clause where in we can use ranges.
    I'm asking this because I'm facing a problem using Native SQL.
    Query is like this:
    EXEC SQl.
    OPEN C1 for
    SELECT field1 from table@domain where field2 IN :ABAP_VAR.
    ENDEXEC.
    EXEC SQL.
    FETCH C1 NEXT INTO :VAR1 , :VAR2
    ENDEXEC.
    Oracle usually recognises this statement IN ( '2222' , '3658' , '6895' )
    But here this field that is build dynamically like this is not recognising them as seperate fileds but instead it is taking them as a single string and not selecting anything.
    But if a single value is passed it is fetching the data into the cursor. And the code is working fine.
    Any help in this is highly appreciable.

    "if a in r_range" is is effectively: does the value held in 'a' comply with the values held in range 'r_range'. Ranges can hold NE, patterns etc so this can get quite complex.
    You can see that it is very different from the SQL type IN.
    If your range hold several values you could unstrip it into a string varaible so that it ended up having a value something like: ( '2222' , '3658' , '6895' ). Not sure if you need the '(' but it would be something like this:
    eg,
    assuming your range is simple and only holds 'I' and 'EQ' values:
    data v_string type string.
    loop at r_range.
    concatenate v_string '@''' r_range-low  '''@' into v_string.
    endloop.
    REPLACE
      ALL OCCURRENCES OF '@'
      IN v_string
      WITH ' '.
    Then you can use:
    SELECT field1 from table@domain where field2 IN :v_string.

  • SELECt query in UNiX environment

    Iam using hp unix with oracle 11g
    when i try to spool 26 lack records it is giving me error
    " There is not enough memory available now.
    O/S Message: Broken pipe"
    is there is any other way SQL commands, we can limit the SELECT query to spool specific number of times other than using
    FOR LOOP.. with LIMIT cluase

    logdata=`${SQLPLUS} -S username/password<< EOF
                        SET ECHO OFF
                        SET LINESIZE 2000
                        SET NEWPAGE 0
                        SET SPACE 0
                        SET PAGESIZE 0
                        SET FEEDBACK OFF
                        SET HEADING OFF
                        SET TRIMSPOOL ON
                        SET TAB OFF
                        set autoprint on               
                        set serveroutput on
                        set spool on
                        spool ${SPOOL_FILE}     
                        set termout off
                   WHENEVER SQLERROR EXIT SQL.SQLCODE
                   whenever oserror exit 1;
                        $GetQuery ==> there come's the SELECT statement which spool's 25 lakh records.
                        spool off
                   EXIT
                        END`
    While spooling records it throws the error
    There is not enough memory available now.
    O/S Message: Broken pipe
    i want u use spooling instead of using util_file to write each and every rows in a file
    Edited by: user9080289 on Apr 29, 2010 5:04 AM

  • Select query in materialized view with two dblinks

    Hi All,
    We have oracle 10g On windows.
    We are trying to create materialized view. Scenario is we have base table on other database and we are creating mview on different database.
    Basa database have two schema's and i am selecting records from that two schema's using two private db links.
    But when i am tryin gto create mview its not getting created. After 15 hrs. its still showing creation command and not finished.
    Query is :-
    Is it good practice to have two db links in select query of materialized view.

    Billy  Verreynne  wrote:
    Chanchal Wankhade wrote:
    Is it good practice to have two db links in select query of materialized view.Same db link being used twice, or two different db links?
    If the former, you ideally want the local Oracle db to send the join to the remote database, and for the remote database to drive the join between those 2 tables. There is a hint (<i>driving_site</i>) that can be used - or the join query can be defined on the remote database as a view, and the local materialised view can then use that remote view.
    If you have 2 different db links and joining across these - usually a bad idea to perform distributed database joins. There are lots of limitations as to how the tables can be joined. Worse case, full table scans of both remote tables, pulling all the rows from the 2 remote database tables to the local database, and joining these on the local database.
    I have seen some severe performance issues in the past as a result of distributed joins. I'll rather use 2 materialised views for pulling both distributed tables's data locally, and then do the join on local data (using indexes, partition pruning, etc)Hi Billy,
    My scenario is i have two database database A and database B. Database A is having two schema's SCOTT AND HR. SCOTT schema have select privileges on HR schema.
    DB LINK is between Database B to Database A. name is db.link.B.A.oracle.com.
    What if i priovide while creating materialized view, the schema name before the table name in database B for this particuler table so it will pick up the table from that schema using same DB LINK(db.link.B.A.oracle.com.) that i am using to fetch records from SCOTT schema.
    Above schnario is like two base schema's and one db link using two schema.

  • Select query in MB51 failing only for posting date(BUDAT)02/02/2010

    Hello Experts,
    I am having below select query.
    It is running perfectly fine for all the dates except 02/02/2010.On all other dates it is getting executed with in second.
    For 02/02/2010 it keeps on running for more than 10 minutes and then fails with timeout error.
    Please let me know if anyone know any solution for this.
    select (g_t_fields)
        into corresponding fields of table itab
        from mkpf inner join mseg
        on    mkpfmandt = msegmandt
          and mkpfmblnr = msegmblnr
          and mkpfmjahr = msegmjahr
           WHERE MKPF~BUDAT in BUDAT
             and MSEG~BWART in BWART
             and MSEG~CHARG in CHARG
             and MKPF~FRBNR in FRBNR
             and MSEG~KUNNR in KUNNR
             and MSEG~LGORT in LGORT
             and MSEG~LIFNR in LIFNR
             and MSEG~MATNR in MATNR
             and MSEG~SOBKZ in SOBKZ
             and MKPF~USNAM in USNAM
             and MKPF~VGART in VGART
             and MSEG~WERKS in WERKS
             and MKPF~XBLNR in XBLNR
    %_HINTS
    ORACLE '&SUBSTITUTE VALUES&'
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting and please use code tags when posting code - post locked
    Edited by: Rob Burbank on Feb 4, 2010 9:02 AM

    Hi Sameer,
    Please check on which date the production order has status as "completed".
    It could be on 01.02.2015.
    Thanks,
    Vimal

  • Select query in a report

    Hi!
    Is it possible to modify a select query for a report in the following way:
    I have created two fields where users input values and operators.
    Operators selection is a static list consisting of: =, like , in
    Value field is a text field.
    The current query is:
    SELECT
    A,
    B,
    C
    from TABLE
    I would like to add:
    WHERE
    A : P1_OPERATOR : P1_VALUE
    but it doesn't work; I get a notification that the operator is incorrect.
    It has a defaulft value = and when I set let's say 5 in the value field the whole query should be:
    SELECT
    A,
    B,
    C
    from TABLE
    WHERE
    A = 5
    Regards!

    Hmm, I get the following error:
    Updatable report parse error:
    ORA-20001: Query must begin with SELECT or WITH
    The only difference I see is that your type is SQL Query (PL/SQL function body returning SQL query) while I have SQL Query (updateable report) hardcoded.
    I have APEX 4.2.2, I'm not quite sure how to change this...
    This is my code:
    begin
    :P7_QUERY := 'select ROWID,BNK_ID,MSR_PRD_ID,SRC_STM_ID,ID,ID_RETKA,RSP,OZNAKA_RETKA,DATUM_STANJA,OZNAKA_IZVJESCA,OZNAKA_KOMITENTA,MBR_KOMITENTA,KOMITENT_NEREZ,ZUPANIJA,DRZAVA,SEKTOR_NEREZIDENTA,VRSTA_POVEZANOSTI,INSTRUMENT,ISIN,VALUTA,OTKAZNI_ROK,IZVORNO_DOSPIJECE,VRSTA_INDEKSACIJE,VALUTA_INDEKSACIJE,PORTFELJ,UTRZIVOST_KREDITA,ZNACAJKE_KAPITALA,RIZICNA_SKUPINA,UGRADJENI_DERIVAT,ODNOSNA_VARIJABLA,PREDZNAK,IZNOS,IZNOS_ACTUAL,VRSTA_IZNOSA,KOMITENT_PBR,UDJELI_POVEZ_C,AR_ID,AU_ID,ACT_AR_BAL_KN,ACT_AR_BAL,AR_BUSS_ID,MTI_CCY_TP_ID,REG_NO,REG_SFX,JMBG_ID_NO,IP_ID,NO_DYS_OO,TAX_ID_NO,INSTRUMENT_OLD,PREDZNAK_OLD,IZNOS_ACTUAL_OLD,ACT_AR_BAL_KN_OLD,ACT_AR_BAL_OLD,NAPOMENA,NOVI_POSAO_F,LISTA_SUMARNA,LISTA_REKAP,POSTOTAK1,POSTOTAK2,POSTOTAK3,DZS_IDY_CL_ID,HNB_IP_CL_ID,EXG_RT_CRD_RSK_F from DWP.IZV_SLOG_DET
    where ' || :P7_X_FC1 || :P7_X_O1 || :P7_X_O1;
    return :P7_QUERY;
    end;
    I have also set Use Generic Column Names (parse query at runtime only) nad P7_QUERY as page item to submit.
    Regards,
    Ivan

  • 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.

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

  • Verifying and parsing "query" in cm:select query="..." ...

    I'm writting a session EJB that's passed a param (String query) which is supposed
    to be any valid "query" string passed to the cm:select tag (see "http://edocs.bea.com/wlcs/docs31/p13ndev/jsptags.htm#1057716"
    for more info on this tag and the query param).
    My problem is this: I don't think I should write ALL the stuff to validate and
    parse this string because bea has already done it in: com.beasys.commerce.foundation.expression.*;
    but the only source of documentation available on those classes is the Javadoc(which
    isn't that complete). Has anyone used these classes before(Search, Expression,
    Criteria, Logical)? Does anyone know of some documents on how to use them?
    Please help if you can. I'd really appreciate it. Thanks.

    rajan please just google or search SDN. there are large number of post for this..
    to give you a head start: for using a particular index in the select query a %_HINTS ORACLE 'INDEX clause is added

Maybe you are looking for

  • Function FUNCTION FILE_GET_NAME and table FILENAMECI

    I have an ABAP program that calls FUNCTION 'FILE_GET_NAME' with only the logical_filename and operating_system parameters.  ex: CALL FUNCTION 'FILE_GET_NAME'     EXPORTING       logical_filename = 'Z_SAP_TO_GAINS'       operating_system = 'NT'     IM

  • How can a question marked as "solved" be restored to unsolved status?

    How do you remove the "This solved my question" status icon if the answer turns out to be wrong? Variations of this question can be found in a few discussion threads in the Apple Support Community. I found one very similar question marked as "This so

  • I can't update my iPad to iOS 5.1 through iTunes. Any clues?

    Every time I try to upgrade to iOS5.1when I backup and upgrade through iTunes, it seems to time out and not complete the task. Can anyone help me with what to do?

  • ADCS Enable User is not getiing Initiated

    Hi All, ADCS Enable user is not getting initiated, when ever OIm user gets enabled. I am assuming, If we enable OIm user, then Oim will enable all resource accounts of that particular users by default. Am I correct? In that case, OIm is not initiatin

  • IPad fourth generation won't charge during use.

    Hi, I recently noticed that my new iPad fourth generation won't charge while I'm using it. The lightning cord is plugged in and connected but the iPad keeps loosing battery while I use it when it signals 20% left! Why does it do this? Is Apple going