Select with where condition comparing different domains

SELECT *
           FROM table
           FOR ALL ENTRIES IN it_temp
           WHERE col1 =  it_temp-col_id.
col1 is of type char20
it_temp-col_id is of type char10.
"col1" and "it_temp-col_id" must have the same type and the same length.
do someone know a workaround?
thanks!!

types : begin of ity_temp_1,
               col_temp type table-col1, " this is type 20.
            endof ity_temp_1.
data: lt_temp_1 type standard table of ity_temp_1,
         ls_temp_1 type ity_temp_1.
loop at it_temp into is_temp.
    clear ls_temp_1.
    ls_temp_1-col_temp =    is_temp-col1. " passing col1(type 10 to col_temp of type 20.)
    append ls_temp_1 into lt_temp_1.
    clear : is_temp.
endloop.
"now lt_temp_1 holds matching domain.
SELECT *
FROM table
FOR ALL ENTRIES IN lt_temp_1 " comparing with passed values with same domain
WHERE col1 = lt_temp_1-col_temp.

Similar Messages

  • What is the sql command for SELECT with OR condition

    Hi
    What is the correct sql command for doing select with or condition??
    SELECT * from TempData
    WHERE port = '123'
    OR serialnumber = '555'
    So if there is a port = 123 or if there is a serialnumber = 555, I will get a successful select.
    Thanks for helping a newbie!!

    Hi
    What is the correct sql command for doing select with
    or condition??
    SELECT * from TempData
    WHERE port = '123'
    OR serialnumber = '555'
    So if there is a port = 123 or if there is a
    serialnumber = 555, I will get a successful select.
    Thanks for helping a newbie!!Make sure you bracket your OR conditions
    eg
    SELECT * from TempData
    WHERE column = 'VALUE'
    and port = '123'
    OR serialnumber = '555'
    is read as
    SELECT * from TempData
    WHERE (column = 'VALUE'
    and port = '123' )
    OR serialnumber = '555'
    which is not the same as
    SELECT * from TempData
    WHERE column = 'VALUE'
    and ( port = '123'
    OR serialnumber = '555' )

  • Export/Import with where condition

    DearAll,
    I am facing a problem in the delete of a huge table that take 3 hours
    DELETE FROM HST HST
    WHERE JV_TYPE <> 999
    and ( HST.VALUE_DATE <= TO_DATE ('31/12/2010','DD/MM/YYYY')
    AND HST.TRANS_DATE <= TO_DATE ('31/12/2010','DD/MM/YYYY'))
    what i am trying to do is to export the HST table and import it into another table
    but what i need to do is to have a dump with where condition including only the needed records in the table not deleted in the DML above as well as the indexes, triggers.
    Thanks

    If I try the following:
    CONN / AS SYSDBA
    CREATE OR REPLACE DIRECTORY dpump_dir1 AS '/folder/';
    GRANT READ, WRITE ON DIRECTORY dpump_dir1 TO bokprod;
    expdp bokprod/bokprod@uat TABLES=HST PARFILE=hst_query.par
    In the parfile:
    QUERY=hst:"WHERE JV_TYPE <>999 and ( HST.VALUE_DATE > TO_DATE ('31/12/2010','DD/MM/YYYY') AND HST.TRANS_DATE > TO_DATE ('31/12/2010','DD/MM/YYYY'))"
    DUMPFILE=exp.dmp
    DIRECTORY=dpump_dir1
    LOGFILE=exp.log
    impdp bokprod/bokprod@uat DIRECTORY=dpump_dir1 DUMPFILE=exp.dmp
    TABLES=bokprod.hst REMAP_TABLE=bokprod.hst:hst_imported
    My question is:
    1- the parameter file, if i put it in the dpump_dir1 directory, is it read by the expdp command?
    2- the hst_imported table created by the remap_table command , is it created with the indexes and triggers already existant on hst table?
    Appreciate yoyr help Dears

  • Select-options with where condition

    Hello ABAPers,
    I want to create a select-options like s_operid for vbpa-kunnr but with a condition specified is VBPA-KUNNR where VBPA-PARVW = 'WE'.
    Thanks in advance. Pls reply asap. Points will definitely be rewarded.
    Ritu

    hi,
    use this
    PARAMETERS : TAB_ID TYPE ZALOAD_PROD_COMB-TAB_ID OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR TAB_ID.
    DATA : BEGIN OF INT_TAB_ID OCCURS 0,
                TAB_ID TYPE ZALOAD_PROD_COMB-TAB_ID,
             END OF INT_TAB_ID.
      DATA : LOC_MAX TYPE ZALOAD_PROD_COMB-TAB_ID.
      CLEAR INT_TAB_ID.
      REFRESH INT_TAB_ID.
      SELECT MAX( TAB_ID) INTO (LOC_MAX) FROM ZALOAD_PROD_COMB.
      COUNT = LOC_MAX + 1.
      DO 10 TIMES.
        MOVE COUNT TO INT_TAB_ID-TAB_ID.
        APPEND INT_TAB_ID.
        COUNT = COUNT + 1.
      ENDDO.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
         RETFIELD            = 'TAB_ID'                        u201C Internal table field name
         DYNPPROG         = 'PROG_NAME                  u201C Program name
         DYNPNR              = SY-DYNNR
         DYNPROFIELD   =  'TAB_ID'                        u201C Field where u need F4 help
         VALUE_ORG       = 'S'
       WINDOW_TITLE  = u2018Any descriptionu2019
        TABLES
          VALUE_TAB      = INT_TAB_ID.                   u201C Internal table name
    Mark the post answered once ur problem is solved ....

  • Outbound merge not working with where conditions in 10g

    Hi,
    These are my database details both remote and local database
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for HPUX: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - ProductionI am doing a merge into a remote database from a local table using below query...
    MERGE into sap_mmd_po_all@cosmic_dev.somedomainname trg using (select * from sap_mmd_cmas_po where upload_flag in ('I','U')) src
      on (trg.PO_NO=src.PO_NO and trg.LINE_DISTRIB_SEQ=src.LINE_DISTRIB_SEQ)
      WHEN MATCHED THEN
        update set
          trg.PO_STATUS_FLG=src.PO_STATUS_FLG,
          trg.SHIP_TO_FACILITY_CD=src.SHIP_TO_FACILITY_CD,
          trg.DELV_TO_PHONE_NO=src.DELV_TO_PHONE_NO,
          trg.DELV_TO_NM=src.DELV_TO_NM,
          trg.DELV_TO_ADDRESS_1=src.DELV_TO_ADDRESS_1,
          trg.PO_ITEM_NO=src.PO_ITEM_NO,
          trg.ITEM_DESCRP=src.ITEM_DESCRP,
          trg.PARTY_NM=src.PARTY_NM,
          trg.VENDOR_ITEM_ID=src.VENDOR_ITEM_ID,
          trg.PO_LN_CRTE_DT=src.PO_LN_CRTE_DT,
          trg.BILL_UOM_CD=src.BILL_UOM_CD,
          trg.COMMODITY_CD=src.COMMODITY_CD,
          trg.COMMODITY_NM=src.COMMODITY_NM,
          trg.BSNSS_UNIT_NO=src.BSNSS_UNIT_NO,
          trg.PO_LN_ORD_QTY=src.PO_LN_ORD_QTY,
          trg.DISTRIB_AMT=src.DISTRIB_AMT,
          trg.PO_LN_DEL_IND=src.PO_LN_DEL_IND,
          trg.PO_DEL_IND=src.PO_DEL_IND,
          trg.PO_TYPE=src.PO_TYPE,
          trg.DOC_DATE=src.DOC_DATE,
          trg.CRTE_DT_TM=src.CRTE_DT_TM,
          trg.UPD_DT_TM=systimestamp,
          trg.SOURCE_SYSTEM=src.SOURCE_SYSTEM,
          trg.PO_LN_LST_CHNGE_DT=src.PO_LN_LST_CHNGE_DT,
          trg.TXJCD=src.TXJCD,
          trg.PLANT=src.PLANT
          where (src.upload_flag='U')--if i remove this then it is working
      WHEN NOT MATCHED THEN
        insert( trg.PO_NO,
                trg.LINE_DISTRIB_SEQ,
                trg.PO_STATUS_FLG,
                trg.SHIP_TO_FACILITY_CD,
                trg.DELV_TO_PHONE_NO,
                trg.DELV_TO_NM,
                trg.DELV_TO_ADDRESS_1,
                trg.PO_ITEM_NO,
                trg.ITEM_DESCRP,
                trg.PARTY_NM,
                trg.VENDOR_ITEM_ID,
                trg.PO_LN_CRTE_DT,
                trg.BILL_UOM_CD,
                trg.COMMODITY_CD,
                trg.COMMODITY_NM,
                trg.BSNSS_UNIT_NO,
                trg.PO_LN_ORD_QTY,
                trg.DISTRIB_AMT,
                trg.PO_LN_DEL_IND,
                trg.PO_DEL_IND,
                trg.PO_TYPE,
                trg.DOC_DATE,
                trg.CRTE_DT_TM,
                trg.UPD_DT_TM,
                trg.SOURCE_SYSTEM,
                trg.PO_LN_LST_CHNGE_DT,
                trg.TXJCD,
                trg.PLANT)
        values( src.PO_NO,
                src.LINE_DISTRIB_SEQ,
                src.PO_STATUS_FLG,
                src.SHIP_TO_FACILITY_CD,
                src.DELV_TO_PHONE_NO,
                src.DELV_TO_NM,
                src.DELV_TO_ADDRESS_1,
                src.PO_ITEM_NO,
                src.ITEM_DESCRP,
                src.PARTY_NM,
                src.VENDOR_ITEM_ID,
                src.PO_LN_CRTE_DT,
                src.BILL_UOM_CD,
                src.COMMODITY_CD,
                src.COMMODITY_NM,
                src.BSNSS_UNIT_NO,
                src.PO_LN_ORD_QTY,
                src.DISTRIB_AMT,
                src.PO_LN_DEL_IND,
                src.PO_DEL_IND,
                src.PO_TYPE,
                src.DOC_DATE,
                systimestamp,
                src.UPD_DT_TM,
                src.SOURCE_SYSTEM,
                src.PO_LN_LST_CHNGE_DT,
                src.TXJCD,
                src.PLANT)
                where src.upload_flag='I'--if i remove this then it is working
                ;And it is throwing an error like...
    SQL Error: ORA-00904: "A3"."UPLOAD_FLAG": invalid identifierBut when I replace the remote table name with local table name then query is functioning fine...
    table structure in local database..
    CREATE TABLE SAP_MMD_CMAS_PO
       (     "PO_NO" VARCHAR2(10 BYTE) NOT NULL ENABLE,
         "LINE_DISTRIB_SEQ" NUMBER NOT NULL ENABLE,
         "PO_STATUS_FLG" VARCHAR2(40 BYTE),
         "SHIP_TO_FACILITY_CD" VARCHAR2(100 BYTE),
         "DELV_TO_PHONE_NO" VARCHAR2(50 BYTE),
         "DELV_TO_NM" VARCHAR2(100 BYTE),
         "DELV_TO_ADDRESS_1" VARCHAR2(1000 BYTE),
         "PO_ITEM_NO" VARCHAR2(100 BYTE),
         "ITEM_DESCRP" VARCHAR2(200 BYTE),
         "PARTY_NM" VARCHAR2(1000 BYTE),
         "VENDOR_ITEM_ID" VARCHAR2(100 BYTE),
         "PO_LN_CRTE_DT" TIMESTAMP (6),
         "BILL_UOM_CD" VARCHAR2(50 BYTE),
         "COMMODITY_CD" VARCHAR2(50 BYTE),
         "COMMODITY_NM" VARCHAR2(50 BYTE),
         "BSNSS_UNIT_NO" VARCHAR2(50 BYTE),
         "PO_LN_ORD_QTY" NUMBER,
         "DISTRIB_AMT" NUMBER,
         "PO_LN_DEL_IND" VARCHAR2(10 BYTE),
         "PO_DEL_IND" VARCHAR2(10 BYTE),
         "PO_TYPE" VARCHAR2(10 BYTE),
         "DOC_DATE" TIMESTAMP (6),
         "CRTE_DT_TM" TIMESTAMP (6),
         "UPD_DT_TM" TIMESTAMP (6),
         "SOURCE_SYSTEM" VARCHAR2(100 BYTE),
         "PO_LN_LST_CHNGE_DT" TIMESTAMP (6),
         "TXJCD" VARCHAR2(50 BYTE),
         "PLANT" VARCHAR2(10 BYTE),
         "UPLOAD_FLAG" VARCHAR2(1 BYTE),
          PRIMARY KEY ("PO_NO", "LINE_DISTRIB_SEQ")
    --table structure in remote database table
    CREATE TABLE SAP_MMD_PO_ALL
       (     "PO_NO" VARCHAR2(10 BYTE) NOT NULL ENABLE,
         "LINE_DISTRIB_SEQ" NUMBER NOT NULL ENABLE,
         "PO_STATUS_FLG" VARCHAR2(40 BYTE),
         "SHIP_TO_FACILITY_CD" VARCHAR2(100 BYTE),
         "DELV_TO_PHONE_NO" VARCHAR2(50 BYTE),
         "DELV_TO_NM" VARCHAR2(100 BYTE),
         "DELV_TO_ADDRESS_1" VARCHAR2(1000 BYTE),
         "PO_ITEM_NO" VARCHAR2(100 BYTE),
         "ITEM_DESCRP" VARCHAR2(200 BYTE),
         "PARTY_NM" VARCHAR2(1000 BYTE),
         "VENDOR_ITEM_ID" VARCHAR2(100 BYTE),
         "PO_LN_CRTE_DT" TIMESTAMP (6),
         "BILL_UOM_CD" VARCHAR2(50 BYTE),
         "COMMODITY_CD" VARCHAR2(50 BYTE),
         "COMMODITY_NM" VARCHAR2(50 BYTE),
         "BSNSS_UNIT_NO" VARCHAR2(50 BYTE),
         "PO_LN_ORD_QTY" NUMBER,
         "DISTRIB_AMT" NUMBER,
         "PO_LN_DEL_IND" VARCHAR2(10 BYTE),
         "PO_DEL_IND" VARCHAR2(10 BYTE),
         "PO_TYPE" VARCHAR2(10 BYTE),
         "DOC_DATE" TIMESTAMP (6),
         "CRTE_DT_TM" TIMESTAMP (6),
         "UPD_DT_TM" TIMESTAMP (6),
         "SOURCE_SYSTEM" VARCHAR2(100 BYTE),
         "PO_LN_LST_CHNGE_DT" TIMESTAMP (6),
         "TXJCD" VARCHAR2(50 BYTE),
         "PLANT" VARCHAR2(10 BYTE),
         "DELETE_FLAG" VARCHAR2(1 BYTE) DEFAULT 'N',
          PRIMARY KEY ("PO_NO", "LINE_DISTRIB_SEQ")
      )It seems to me like a bug, but not quite sure...
    your suggestions are appreciated.
    Thanks,
    Ravi Kumar
    Edited by: ravikumar.sv on Dec 14, 2009 1:31 PM
    Commented the where conditions in merge query

    Hi,
    Yes, i hit the same error....
    SQL> ed
    Wrote file afiedt.buf
      1  merge into hr.test1@test_dblink using test2 on (test1.id = test2.id)
      2  when matched then update set test1.col1=test2.col2 where test2.id=2
      3* when not matched then insert (id, col1) values(test2.id,test2.col2)
    SQL> /
    merge into hr.test1@test_dblink using test2 on (test1.id = test2.id)
    ERROR at line 1:
    ORA-00904: "A3"."ID": invalid identifier
    ORA-02063: preceding line from TEST_DBLINKBUT here is a work around...to add the where condition while joining(ON) itself.
    SQL> ed
    Wrote file afiedt.buf
      1  merge into hr.test1@test_dblink using test2 on (test1.id = test2.id and tes
    t2.id=2)
      2  when matched then update set test1.col1=test2.col2
      3* when not matched then insert (id, col1) values(test2.id,test2.col2)
    SQL> /
    2 rows merged.
    SQL>For you the condition would be...
    on (trg.PO_NO=src.PO_NO and trg.LINE_DISTRIB_SEQ=src.LINE_DISTRIB_SEQ AND src.upload_flag='U')cheers,
    Edited by: Avinash Tripathi on Dec 14, 2009 2:53 PM

  • Dynamic LOV with where conditions

    Hi all! I have a question regarding Dynamic LOVs. I have a List of values that can be used from three pages, the query is something like this:
    SELECT a.CODE CODE_DISPLAY,
    a.CODE CODE_RETURN
    FROM OREF_COUNTRIES a,
    OREF_REGIONS b
    WHERE a.REG_ID = b.ID AND
    b.CODE = :P336_LOV_REGION;
    The thing is I don't want to hardcode the name of the item ":P336_LOV_REGION" because this is the name of 1 item of one page, and I'd like to use this LOV from another two pages, so the name of the item won't be ":P336_LOV_REGION". How can I create a reusable dynamic LOV with a where condition depending on one item of the page?
    Thanks!!

    hi! anyone has any information about this?
    Daniela.

  • Loading a combobox with data from a different domain

    I have filled in a combobox with values from an .asp page and
    have used it
    successfully. The problem is that if the flash file is ran
    from a different
    domain from the load location, the combobox doesn't get
    filled in (as
    apposed to the error if I ran it off of my drive).
    datafeed.asp spits out the appropriate stuff for the AddItems
    function to
    read correctly. (as I has said, it does work). The combobox
    gets filled in
    the development environment (Macromedia Flash MX Professional
    2004) as well
    as flash player.
    But when I upload it to one of my other websites, the data is
    never
    retrieved. Even though that the webserver containing the data
    feed, the
    webserver hosting the flash file and my machine can all read
    datafeed.asp.
    Am I missing a setting that allows a flash file to read data
    from another
    domain?
    The following code has been changed for security reasons. But
    believe me it
    works in its original format.
    myData = new LoadVars();
    myData.onLoad = AddItems;
    myData.load("
    http://www.mydomain.com/datafeed.asp")
    function AddItems() {
    for (i=0; i<numItems; i++) {
    var ProductID = eval("myData.ProductID"+i);
    var ProductName = eval("myData.ProductName"+i);
    var ProductSale = eval("myData.ProductSale"+i);
    var DataProvider = { productid
    roductID, productsale
    roductSale };
    _root.application.chooseproducts.prodlist_cb.addItem(ProductName,
    DataProvider);
    Thank You,
    Julian

    not sure, but this might be what you need...
    //allow loading of files from domain
    System.security.allowDomain("
    http://www.mydomain.com");

  • Export data with where condition

    Hello,
    I am doing an export using exp utility in oracle.
    exp fas/fas@fdbl file=aud log=aud.log parfile=exp
    Contents of parfile - exp
    compress=n
    indexes=n
    constraints=n
    grants=n
    triggers=n
    statistics=none
    consistent=y
    query=\"where org_grp_i=33 \"
    I am getting error when i include query = \"where org_grp_i=33 \". Without giving this condition the export is doing fine, its successful. how do i give this where condition in the parfile since i want to export lots of tables with this same condition. org_grp_i is common in all the tables.
    Thanks

    1. create directory ----
    sql> conn / as sysdba
    sql>create directory "data" as 'c:\';
    2. grant read, write privs. to exp or imp users.
    sql>grant read , write on directory data to scott;
    sql>grant read , write on directory data to tester;
    3.conn imp or exp user
    sql>conn scott/tiger
    SQL> host expdp scott/tiger directory=data dumpfile=eg.dmp tables=avgsal
    Export: Release 10.1.0.2.0 - Production on Wednesday, 25 October, 2006 19:14
    Copyright (c) 2003, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** directory=data dumpfile=
    eg.dmp tables=avgsal
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 64 KB
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "SCOTT"."AVGSAL"                            5.312 KB       5 rows
    Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
    Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
      C:\EG.DMP
    Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 19:15
    SQL> drop table avgsal purge;
    Table dropped.
    SQL> host impdp tester/tester directory=data dumpfile=eg.dmp
    Import: Release 10.1.0.2.0 - Production on Wednesday, 25 October, 2006 19:16
    Copyright (c) 2003, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Master table "TESTER"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
    Starting "TESTER"."SYS_IMPORT_FULL_01":  tester/******** directory=data dumpfile
    =eg.dmp
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
    . . imported "SCOTT"."AVGSAL"                            5.312 KB       5 rows
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    Job "TESTER"."SYS_IMPORT_FULL_01" successfully completed at 19:16
    SQL>
    note : cmd>impdp help=y
    cmd> expdp help=y
    see doc. for more info
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/toc.htm
    Message was edited by:
    user52

  • Is Hyperion Essbase is working with ODI 11g under different Domain Range?

    Hi All,
    I installed ODI 11.1.1.3 with IP(172.x.8.21) and Hyperion Essbase (172.x.0.36). With different domain Range ODI(172.x.*8*.21) and Essbase(172.x.*0*.21) so will it work under different IP Domain ranges from 8 to 0?
    Cause i was trying to develop Physical Data server for Essbase and i was not able to view Application Schema and other object in drop down list like: Catalog, Database Scheam etc.
    Evening i am providing Correct Domain name, port and user name & passowrd. even i tried with providing direct IP address.
    Server Details :
    1- Hyperion Essbase server Name: Essbaseserver
    2- Port: 1423
    3- admin
    4- xxxxxx
    as u know guys Test Connection button is not working for Essbase its only works for RDBMS in ODI.
    looking for your help.
    Thank u

    Yes it works though the dropdown will not be automatically populated and you can't click the test button as that is mainly for technologies that use JDBC, you will need to manually enter the app/db
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Unable to protect 2 computers with same name, but different Domains

    DPM 2012 R2 and UR2
    All DC:s and servers are 2012 R2 + Latest patches.
    ad.A.com has full  2 Way trust with ad.B.com. (Different forrest)
    DPM Server is DPM.ad.A.com
    Computer EXCH.ad.A.com is protected without problem 
    Computer SQL.ad.B.com  is protected without problem
    When I try to attach agent from EXCH.ad.B.com I'll get problems.
    Error 346: DPM is unable to retrieve the configuration information from EXCH.ad.B.com
    I'll guess this has to do with same name of computer, although in different domains.  Is this as Designed, or is it a defect? 
    /Peter

    please try a different User to attach/install the DPM Agent.
    if this is not the solution, you maybe have a Problem with wmi, try and test with wbemtest
    Seidl Michael | http://www.techguy.at |
    twitter.com/techguyat | facebook.com/techguyat

  • Select with no conditions taking long time, too many blocks, pctused?

    select * from at_journal;is taking 15 seconds, which is absurd. I have similar situations with other log tables in this system.
    (selecting with rownum < 5 and with first_rows hint still takes 15 seconds)
    Suspicious parameters:
    PCT_FREE 1
    PCT_USED 99
    (Some other log tables have PCT_FREE 5, PCTUSED 90)
    The tables have frequent inserts, once every day all records older than 90 days get deleted.
    After computing statistics:
    Blocks: 42,304 (seems absurdly high)
    Size: 663 Mb
    NUM_ROWS: 505,966
    After copying data without compression to new table:
    Blocks: 3,785
    Size: 60 Mb
    NUM_ROWS: 505,966
    The select on the new table is instantaneous.
    On a side note, in general is compression for a table with frequent deletes OK? It seems OK to me.
    Storage parameters of table creation script:
    PCTUSED    99
    PCTFREE    1
    INITRANS   1
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
                FREELISTS        1
                FREELIST GROUPS  1
                BUFFER_POOL      DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    NOMONITORING;I imagine that most blocks for the table are empty. In my mind pctused of 99 means most of the block space should be full. I have read several explanations of PCTUSED/pctfree including oracle documentation and it seems pctused of 99 means the block should be 99% full.
    Much thanks,
    goo

    goo wrote:
    I imagine that most blocks for the table are empty. In my mind pctused of 99 means most of the block space should be full. I have read several explanations of PCTUSED/pctfree including oracle documentation and it seems pctused of 99 means the block should be 99% full.Hello, you don't give your database version, but if you were using Automatic Segment Space Management you would not need to worry about the PCTUSED setting, and it could be that you already are:
      1  select tablespace_name, segment_space_management
      2 from dba_TABLESPACES
    TABLESPACE_NAME                SEGMEN
    SYSTEM                         MANUAL
    SYSAUX                         AUTO
    UNDOTBS1                       MANUAL
    TEMP                           MANUAL
    USERS                          AUTO
    EXAMPLE                        AUTOAnd if you are already using ASSM, then the PCTUSED is not an issue (PCTFREE still applies, but it's not an issue in your case).
    goo wrote:
    On a side note, in general is compression for a table with frequent deletes OK? It seems OK to me.Frequent DELETEs could be an issue because they will not reset the High Watermark, though there will not be a performance penalty because of the compression for DELETEs (the record only needs to be located for a DELETE, not decompressed). Your PCTUSED, however, is high enough so that any newly deleted record slots should be quickly reused, but... it depends on how those new records are being INSERTed. If, as Daniel says, the HWM is being effectively bypassed (Direct Path INSERTs, etc.), then the table will grow in size every day, but the volume of records effectively stays just about the same.
    Have a look at how the new records are being added to that table, if it's a:
    INSERT /*+ APPEND */ INTO tableA
    SELECT...Then the HWM is being advanced, and the newly vacated slots from the DELETEd records are not being reused. So the table will continually grow, for roughly the same amount of data, and there'll be a proportionately longer data retrieval time.

  • Select statement - Where Condition not possible

    Hi,
    I am trying to extract data from sap standard table CFX_COL.I want extract based on a field which is of type string.I can see that in the table but when I code below I am getting error.Any other alterantives?
    REPORT x.
    TABLES:proj.
    DATA: it_proj TYPE STANDARD TABLE OF proj.
    DATA:wa_proj TYPE  proj.
    DATA: it_cfol TYPE STANDARD TABLE OF CFX_COL.
    DATA:wa_cfol TYPE  CFX_COL.
    data:v_name type STRING.
    PARAMETERS: p_pspid LIKE proj-pspid.
    SELECT * FROM proj INTO CORRESPONDING FIELDS OF TABLE it_proj
    WHERE pspid = p_pspid.
    READ TABLE it_proj INTO wa_proj INDEX 1.
    concatenate wa_proj-pspid '-' wa_proj-post1 into v_name.
    select * from CFX_COL into CORRESPONDING FIELDS OF TABLE it_cfol
    where name in v_name.
    Error:The Field "NAME"  is a long string , so it cannot be used in WHERE, ON or HAVING conditions.
    Rgds
    Vara

    Hi Vara.
    Select will not work if you are trying to search based on the name field as in the table  CFX_COL it has data type String which basically is not content but a reference to a storage area and internally it is stored in a different format not searchable. Even , if you try to find the number of entries in the table you can not put any value in this field as it will not be available for input as it doesn't contain any value.
    STRING: Character string with variable length This data type can only be used in types (data elements, structures, table types) and domains. In the Dictionary a length can be specified for this type (at least 256 characters). It may be used in database tables, however, only with restrictions. For a description of them refer to the documentation of the ABAP statement 'STRING' . In ABAP, this type is implemented as a reference to a storage area of variable size. As default for the output length 132 characters are proposed. You cannot attach search helps to components of this type.
    http://help.sap.com/saphelp_40b/helpdata/en/cf/21f2e5446011d189700000e8322d00/content.htm
    Regards
    Apoorva

  • JPA - Select with where clause

    Hi
    I have 2 classes:
    -Class A
    -Class B with a member which holds a reference to an object of Class A --> unidirectional one-to-one relation. The mapping is the following:
                   <one-to-one name="a">
                        target-entity="domain.A" fetch="LAZY"
                        optional="false">
                        <join-column name="ID" table="A" />
                   </one-to-one>
    Now i want to find all objects of B which have a certain instance of A. I tried this, but it doesn't work:
         <named-query name="findBsByA">
              <query>select b from B b where b.a = ?1</query>
         </named-query>
    Any suggestions?
    Thanks for help
    Michael

    name or ID might be reserved words in access. Either change the name of the column or put [] around them. Also, you ar looking for a record where fields name and name1 are equal. You probably don't have a name1 field.
    String name1=nameTextfield.getText().trim();
    String query="SELECT [ID] from Suppliers WHERE [name]='"+name1+"';"
    Pay attention to the single and double quotes I have.

  • SQL Script - error in executing the select with multiple conditions

    Hi gurus,
    I'm having trouble in the command syntax below:
    SELECT * FROM "TEST_RVS"."VH_TEST"  WHERE   "AUFNR" = 20210807 AND  "BWART" = 101.
    WHAT IS THE CORRECT SYNTAX WHERE TO CONDITION WITH MULTIPLE FIELDS?
    Thanks !

    What is the error you are getting?  Did you try wrapping the values with quotes?
    SELECT * FROM "TEST_RVS"."VH_TEST"  WHERE   "AUFNR" = '20210807' AND  "BWART" = '101'.
    Cheers,
    Rich Heilman

  • Loop at table with unspecified type but with where-condition

    Hi,
    Doing a loop over an internal table with unspecified type and in addition using a condtion may be done as follows: Thereby the
    condition would be "... WHERE parentid EQ i_nodeid" if the type of <it_htab> would be static. However dynamic specification of a component through bracketed character-type data objects is not possible.
    FIELD-SYMBOLS: <it_htab> TYPE STANDARD TABLE,
                                    <wa_htab> TYPE ANY,
                                    <parentid> TYPE rsparent.
      ASSIGN me->ref_htab->* TO <it_htab>.
      LOOP AT <it_htab> ASSIGNING <wa_htab>.
        ASSIGN COMPONENT 'PARENTID' OF STRUCTURE <wa_htab> TO <parentid>.
        CHECK <parentid> EQ i_nodeid.
      ENDLOOP.
    Since you have to loop over the whole table and to check within the loop whether the condition is fullfilled, this is rather bad for performance.
    Questions: Are there any tricks to do this better?
    Best Regards and Thank you,
    Ingo

    >
    Lalit Mohan Gupta wrote:
    > you can put the condition in the where clause....
    only if you have the upcoming 7.0 EhP2 (Kernel 7.02 or 7.20) the following dynamic where works:
    DATA cond_syntax TYPE string.
    cond_syntax = `parentid = i_nodeid`.
    LOOP AT <it_htab> ASSIGNING <wa_htab>
                           WHERE (cond_syntax).
    in older releases you would have to use program generation to achieve a dynamic where... .
    Kind regards,
    Hermann

Maybe you are looking for

  • Fact - dimension and Fact Join

    Hi , I have a issue in OBIEE 11g here , I am trying to query two columns from 2 different fact tables F1 and F2 the join between these tables is F1 - D - F2 , where D is the confirmed dimension. so when i am querying for f1.c1 , d.c1 , f2.c1 , its th

  • DW CS3 Mac - delayed work-flow

    Our office has three Macs running DW CS3; Two Intel Macs and one G5... When working with files from ANY remote server (and with any file type) on the Intel Macs the work flow is very sluggish / delayed (i.e. any action takes about 3-5 seconds to resp

  • Monitor for IMac is Faded and Blueish

    What is causing my faded and blue tintish display right now?

  • Why does clone stamp not work?

    When I use Photoshop Elements 9, I get the following error: Could not use clone stamp tool because of a program error.  I uninstalled Photoshop Elements and reinstalled it with the same results.  This error shows up on both my XP computer and my Wind

  • Flash CS3 help URGENT

    Im working on a flash project and im trying to copy the frames of one file to another but it has motion tweens and motion guides....and the frames are specifically place at certain times. how do i copy the frames to another file with out getting the