Select from (too many) tables

Hi all,
I'm a proud Oracle Apex developer. We have developed an Interactive Report that is generated from many joined tables in a remote system. I've read that to improve performances we can do the following:
1) Create a temporary table on our system that stores the app_user id and the colmun as a result of the query
2) Create a procedure that does:
declare
param1:= :PXX_item
param2:= :PXY_item.
param3:= :V('APP_USER')
insert into <our_table>
(select param3, <query from remore system>)
commit;
3) Rediresct to a query page where IR reads from this temp table
On "Exit" button there's a procedure that purge table data of that user (delete from temp where user=V('app_user'), so the temp table is only filled with necessary data.
Do you see any inconvenience? Application will be used from about 500 users, about 50 concurrent users at a time.
Thank you!

1) We don't have a control on source syste, we can only perform query on itI was referring to a materialized view on the system where Apex is installed, not on the source database.
2) There are many tables involvedI don't understand why this is a problem. Too much data I can see, but too many tables... not so much.
3) Data has to be in real time, with no delayThis would a problem for MV or collections. The collections would store the data as of the initial query. Any IRs using the collection after the fact would be using stale data. If you absolutely have to have the data as of right now every time, then the full query must run on the remote system every time. Tuning that query is the only option to make it faster.
4) There are many transactions on the source tables (they are the core of the source system) and so MV could not be refreshed so fastProbably could be with fast refresh enabled, but not necessarily practical to do so. As I indicated in 3, you have painted yourself into a corner here. You have indicated a need for a real-time query and that eliminates a number of possibilities for query-once use-many performance solutions.

Similar Messages

  • Too many tables with EXECUTE permision

    Hi Gurus,
    I found that my live databases has too many tables with EXECUTE permision. But I dont know how it happens: my query as follows:
    select table_name
    from dba_tab_privs
    where owner='SYS' AND
    privilege = 'EXECUTE' AND
    grantee = 'PUBLIC'
    result
    TABLE_NAME
    /598cc2d9_AWExceptionMessageRe
    /24bd47b0_AWExceptionMessageRe
    /b99e8561_AWExceptionMessageRe
    /968869b8_AWExceptionMessageRe
    /f8bf68b3_AWExceptionMessageRe
    /9abd5a42_AWExceptionMessageRe
    /5e83964b_AWExceptionMessageRe
    /f01cb9e5_AWExceptionMessageRe
    /380f765f_AWExpressCommandExce
    /adef78c4_AWMemberExistsExcept
    /5166f5c2_AWObjectExistsExcept
    TABLE_NAME
    oracle/AWXML/SparseDefinition
    oracle/AWXML/ModelDimRef
    /9d17934e_AWFunctionNotSupport
    /d18d9de8_AWHandlerBaseTest
    DBMS_AW_XML
    INTERACTIONEXECUTE
    CWM2_OLAP_INSTALLER
    DBMS_XSOQ_ODBO
    OLAPI_MDX_ROWSET_IMPL_T
    OLAPI_MDX_ROWSET_TABLE
    16444 rows selected.
    ==========================================================
    Then I execute above query in other database. result was:
    TABLE_NAME
    STANDARD
    UTL_HTTP
    DBMS_PICKLER
    DBMS_JAVA_TEST
    UTL_FILE
    UTL_RAW
    UTL_TCP
    UTL_INADDR
    UTL_SMTP
    DBMS_TRANSACTION
    DBMS_SESSION
    DBMS_DDL
    DBMS_UTILITY
    DBMS_SPACE
    DBMS_ROWID
    DBMS_PCLXUTIL
    DBMS_APPLICATION_INFO
    DBMS_OUTPUT
    DBMS_DESCRIBE
    DBMS_SQL
    DBMS_EXPORT_EXTENSION
    DBMS_JOB
    DBMS_STATS
    DBMS_ZHELP_IR
    DBMS_PSP
    DBMS_RULE
    AQ$_AGENT
    AQ$_DEQUEUE_HISTORY
    AQ$_SUBSCRIBERS
    AQ$_RECIPIENTS
    AQ$_HISTORY
    AQ$_NOTIFY_MSG
    AQ$_DUMMY_T
    DBMS_AQ_EXP_QUEUE_TABLES
    DBMS_AQ_EXP_INDEX_TABLES
    DBMS_AQ_EXP_TIMEMGR_TABLES
    DBMS_AQ_EXP_HISTORY_TABLES
    DBMS_AQ_EXP_SUBSCRIBER_TABLES
    DBMS_AQ_EXP_QUEUES
    DBMS_AQ_IMP_INTERNAL
    DBMS_RMIN
    DBMS_RESOURCE_MANAGER
    DBMS_RESOURCE_MANAGER_PRIVS
    DBMS_RMGR_PLAN_EXPORT
    DBMS_RMGR_GROUP_EXPORT
    DBMS_RMGR_PACT_EXPORT
    LOW_GROUP
    DEFAULT_CONSUMER_GROUP
    DBMS_DEBUG_VC2COLL
    DBMS_DEBUG
    PBSDE
    DBMS_SUMMARY
    DBMS_SNAPSHOT
    DBMS_REFRESH
    DBMS_SNAPSHOT_UTL
    DBMS_REFRESH_EXP_SITES
    DBMS_REFRESH_EXP_LWM
    DBMS_TRACE
    DBMS_LOB
    UTL_REF
    UTL_COLL
    ODCIPREDINFO
    ODCIRIDLIST
    ODCIINDEXCTX
    ODCIARGDESCLIST
    ODCIFUNCINFO
    ODCISTATSOPTIONS
    ODCICOLINFOLIST
    ODCIOBJECT
    ODCIOBJECTLIST
    ODCIQUERYINFO
    ODCICONST
    SYSEVENT
    DICTIONARY_OBJ_TYPE
    DICTIONARY_OBJ_OWNER
    DICTIONARY_OBJ_NAME
    DATABASE_NAME
    INSTANCE_NUM
    LOGIN_USER
    IS_SERVERERROR
    SERVER_ERROR
    DES_ENCRYPTED_PASSWORD
    IS_ALTER_COLUMN
    IS_DROP_COLUMN
    GRANTEE
    REVOKEE
    PRIVILEGE_LIST
    WITH_GRANT_OPTION
    DICTIONARY_OBJ_OWNER_LIST
    DICTIONARY_OBJ_NAME_LIST
    IS_CREATING_NESTED_TABLE
    CLIENT_IP_ADDRESS
    DBMS_REPUTIL
    DBMS_REPUTIL2
    DBMS_OFFLINE_RGT
    DBMS_REPCAT_RGT_EXP
    DBMS_REPCAT_INSTANTIATE
    DBMS_CRYPTO_TOOLKIT
    DBMS_RANDOM
    how come it happens? need help from u all !!!!!!!!!!

    you asked why you have such grant found in dba_tab_privs. Let's try to find DBMS_RANDOM (listed on your output) in $ORACLE_HOME/rdbms/admin:
    cd $ORACLE_HOME/rdbms/admin
    grep dbms_random *
    dbmsrand.sql:CREATE OR REPLACE PACKAGE dbms_random AS
    dbmsrand.sql: -- execute dbms_random.seed(12345678);
    dbmsrand.sql: -- execute dbms_random.seed(TO_CHAR(SYSDATE,'MM-DD-YYYY HH24:MI:SS'));
    dbmsrand.sql: -- my_random_number := dbms_random.random;
    dbmsrand.sql: -- my_random_real := dbms_random.value;
    dbmsrand.sql: -- select dbms_random.value from dual;
    dbmsrand.sql: -- insert into a values (dbms_random.value);
    dbmsrand.sql: -- execute :x := dbms_random.value;
    dbmsrand.sql:END dbms_random;
    dbmsrand.sql:CREATE OR REPLACE PACKAGE BODY dbms_random AS
    dbmsrand.sql:END dbms_random;
    dbmsrand.sql:CREATE OR REPLACE PUBLIC SYNONYM dbms_random FOR sys.dbms_random;
    dbmsrand.sql:GRANT EXECUTE ON dbms_random TO public;
    This is run by catproc.sql script which you run while creating database.

  • Bex Query: Too many table names in the query The maximum allowable is 256

    Hi Experts,
    I need your help, Im working on a Query using a multiprovider of 2 datastores, I need to work with cells to assign specific acconts values to specific rows and columns, so I was creating a Structure with elements from a Hierarchy, but I get this error when I'm half way of the structure:
    "Too many table names in the query. The maximum allowable is 256.Incorrect syntax near ')'.Incorrect syntax near 'O1'."
    Any idea what is happening? is ti possible to fix it? do I need to ask for a modification of my Infoproviders? Some one told me is possible to combine 2 querys, is it true?
    Thanks a lot for your time and pacience.

    Hi,
    The maximum allowable limit is 256 holds true. It is the max no. of characteristics and key figures that can be used in the column side. While creating a structure, you create key figures (restricted or calculated) and formulas etc.. The objects that you use to create these should not be more than 256.
    http://help.sap.com/saphelp_nw70/helpdata/EN/4d/e2bebb41da1d42917100471b364efa/frameset.htm
    Not sure if combination of 2 query's is possible.  You can use RRI. Or have a woorkbook with 2 queries.
    Hope it helps.

  • Select from view -v- table

    Hi Guys,
    I was just hoping to get your opinion on something.
    I have a procedure in Production that is taking longer and longer to finish and sticks on one certain section of code.
    The code is an INSERT into the main dimension table.
    This same procedure runs fine on TEST and the section of code completes an awful lot quicker.
    The traffic on Production is a lot heavier and there have been applications developed by people other than myself which SELECT from this dimension table. I'm assuming, based on the fact the code in Test and Production are identical, that this increased traffic could be eating up the bandwith and slowing the jobs.
    So, I was thinking - if I create Views and let the other applications hit the views as opposed to the main table, will this help speed it up. I did this before on a Teradata platform using a 'dirty read' which worked quite well but Oracle doesn't seem to offer this option.
    What do you guys think? Could this work or do I need to take a different approach.
    Thank You.

    GerardMcL wrote:
    I meant ordinary views.
    I was wondering if there was a way of putting some locking code in or asking for a dirty read that would speed up the SELECT from the table?There is no such thing as a dirty read with Oracle -- Teradata, SQL Server, Sybase, IBM, etc., have different locking architectures where reads can block write and writes can block reads, and that is not an issue with Oracle.
    If there's a query performance problem, which is what that will be if the SELECTs are slow, then if you could follow the following links, that will help diagnosis immensely:
    [How to Post A Tuning Request|http://forums.oracle.com/forums/thread.jspa?threadID=863295&tstart=0]
    And:
    [When your Query takes too long|http://forums.oracle.com/forums/thread.jspa?messageID=1812597#1812597]
    There is such as thing as stale reads, against Materialized Views, which are views that actually materialize and store the results of a query, and which then can subsequently be queried.

  • HT1212 my phone is disabled from too many password attemps

    my phone is disabled from too many password attempts, i cant go to factory restore

    Connect the device to your computer and open iTunes.
    2: If the device appears in iTunes, select and click Restore on the Summary pane.
    3: If the device doesn't appear in iTunes, try using the steps in this article to force the device into recovery mode.
    From Here
    Unresponsive iPad
    http://support.apple.com/kb/TS3281

  • How to assign tasks in Approval Workflow to a set of users selected from a Lookup table

    Hi all,
    I am new to Project Server and I am using Project Server 2013 On premises deployement. Please help me on how to achieve the below scenario:
    I have a requirement where, the initial PDP will have 2 fields (Reviewers and Approvers), wherein the engineer himself will select who the reviewer and approver from the Lookup tables.
    Now I have to start task process with these selected people for approval.
    Say for example , engineer has selected Alice and Bob as 2 reviewers, then
    In the workflow I have :
                 Start Task process with
    Project Data: Reviewers (which is giving error as
    [System.ArgumentException: AssignedTo at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager
    bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) ]
    Then I tried logging the value of Project Data: Reviewers, It logged the value as Alice, Bob (which looks pretty good),
    Then I tried assigning only 1 person as Reviewer, then also I get the same error.
    So can anybody please tell me where I went wrong. Is it not possible to fetch the data from the values selected as Project Data from the Lookup tables ? If not then what is the workaround I can use to achieve this ?
    Thanks,
    Shanky

    Hi Paul,
    Yes I am using SP designer for Workflows. And yes, You were right, there was a mismatch in the names of AD account and the Lookup table, now with 1 person selected from the lookup table it is assigning the task properly. However with multiple selection,
    it is failing.
    As Robert mentioned, the fetched value is a text as "Alice, Bob", which makes 2 usernames as a single text. So when I try to assign a task to this group, which returns value as "Alice, Bob", workflow fails to find such AD user, as it
    is an invalid value.
    So is there any way I can seperate this out to form 2 different username ? I checked for string extraction function in th Workflow, but nothing helped me for this scenario.
    Any input will be helpful.
    Thanks,
    Shanky

  • Select with too many where conditions not working fine....equal to and not

    Hi Everyone,
      I am getting rows into internal table lt_mseg even if this where condition like this werks NE gs_t001w-werks in below code
    is true. It looks like it's not excluding if not equal to gs_t001w-werks. Is anything wrong in below code? please help me...
    SELECT * INTO TABLE gt_t005 FROM t005 WHERE xegld = 'X'.
    SELECT * FROM t001w INTO TABLE gt_t001w FOR ALL ENTRIES IN gt_t005
    WHERE ( land1 = gt_t005-land1 OR land1 = 'NO' ) AND vkorg NE 'LDE'.
    SELECT * FROM mkpf INTO TABLE gt_mkpf
    WHERE budat IN p_oextdt AND vgart = 'WL'.
    LOOP AT gt_mkpf INTO gs_mkpf.
    CHECK gt_t001w[] IS NOT INITIAL.
    SELECT * FROM mseg APPENDING TABLE lt_mseg
    FOR ALL ENTRIES IN gt_t001w
    WHERE mblnr = gs_mkpf-mblnr
    AND mjahr = gs_mkpf-mjahr
    AND bwart NE '641'
    AND xauto = ' '
    AND werks NE gs_t001w-werks
    AND kunnr = gt_t001w-kunnr.
    ENDLOOP.

    Hi Sany,
      Thanks for your reply. I f I remove  this LOOP AT gt_mkpf INTO gs_mkpf and use for all entries how can I exlude plants that I got from t001w?
       I used range here in below code now I am getting run time error in this loop, it says value table for IN itab operator has unexpected format....
    DATA:
          gt_t005 TYPE TABLE OF t005,
          gs_t005 LIKE LINE OF gt_t005,
          gt_t001w TYPE TABLE OF t001w,
          gt_rng_plant  type range of t001w,
          gs_rng  like line of gt_rng_plant,
          gs_t001w LIKE LINE OF gt_t001w,
          gt_mkpf  TYPE TABLE OF mkpf,
          gs_mkpf  LIKE LINE OF gt_mkpf .
    SELECT * INTO TABLE gt_t005 FROM t005  WHERE xegld = 'X'.
      SELECT * FROM t001w INTO  TABLE gt_t001w FOR ALL ENTRIES IN gt_t005
       WHERE ( land1 = gt_t005-land1 OR land1 = 'NO' ) AND vkorg NE 'LDE'.
      SELECT *  FROM mkpf INTO TABLE gt_mkpf
                  WHERE budat IN p_oextdt AND vgart = 'WL'.
      gs_rng-sign = 'I'.
      gs_rng-option = 'EQ'.
      LOOP AT gt_t001w INTO gs_t001w.
        gs_rng-low = gs_t001w-werks.
        gs_rng-high = gs_t001w-werks.
        APPEND gs_rng TO gt_rng_plant.
      ENDLOOP.
        LOOP AT gt_mkpf INTO gs_mkpf.
          SELECT * FROM mseg APPENDING TABLE lt_mseg
              FOR ALL ENTRIES IN gt_t001w
              WHERE mblnr = gt_mkpf-mblnr
                AND mjahr = gt_mkpf-mjahr
              AND bwart NE '641'
                AND xauto = ' '
                AND werks not in gt_rng_plant
                 AND kunnr = gt_t001w-kunnr.
        ENDLOOP.

  • Selecting from 2 different tables

    is this possible?
    i just want to select from two different tables in one select statement and they have the same WHERE clause

    SELECT
      a.pkggrp,
      a.pkgtype,
      a.area,
      a.process,
      a.ww,
      count(a.ww) as LOTSGATED,
      sum(a.samplesize) as SUMSAMPLESIZE,
      sum(a.total_defects) as SUMTOTALDEFECTS,
      sum(case a.auditresult when 'pass' then 1 else 0 end) COUNTPASS,
      sum(case a.auditresult when 'fail' then 1 else 0 end) COUNTFAIL,
      case sum(case a.auditresult when 'fail' then 1 else 0 end)
        when 0 then 0
      else round(sum(case a.auditresult when 'fail' then 1 else 0 end) / count(a.ww) * 100,2)
        end LRR,
      case sum(case a.auditresult when 'fail' then 1 else 0 end)
        when 0 then 0
      else round(sum(case a.auditresult when 'fail' then 1 else 0 end) / sum(a.samplesize) * 1000000,0)
        end PPM,
      count(c.itrnum)
    FROM
      t_prodproc_monitoring a, t_itr c
    WHERE
      a.ww=c.ww
      and a.ww between 1 and 50
      and c.ww between 1 and 50
    GROUP BY
      a.pkggrp,
      a.pkgtype,
      a.area,
      a.process,
      a.ww
    ORDER BY
      a.pkggrp,
      a.pkgtype,
      a.area,
      a.process,
      a.ww ascthis gave me a
    "c". "ww": invalid identifier

  • SELECTing from a large table vs small table

    I posted a question few months back about teh comparison between INSERTing to a large table vs small table ( fewer number of rows ), in terms of time taken.
    The general consensus seemed to be that it would be teh same, except for teh time taken to update the index ( which will be negligible ).
    1. But now, following teh same logic, I m confused why SELECTINg from a large table should be more time taking ("expensive" ) than SELECTing from a small table.
    ( SELECTing using an index )
    My understanding of how Oracle works internally is this :
    It will first locate the ROWID from teh B-Tree that stores the index.
    ( This operation is O(log N ) based on B-Tree )
    ROWID essentially contains teh file pointer offset of teh location of the data in teh disk.
    And Oracle simply reads teh data from teh location it deduced from ROWID.
    But then the only variable I see is searching teh B-Tree, which should take O(log N ) time for comparison ( N - number of rows )
    Am I correct above.
    2. Also I read that tables are partitioned for performance reasons. I read about various partiotion mechanisms. But cannot figure out how it can result in performance improvement.
    Can somebody please help

    user597961 wrote:
    I posted a question few months back about teh comparison between INSERTing to a large table vs small table ( fewer number of rows ), in terms of time taken.
    The general consensus seemed to be that it would be teh same, except for teh time taken to update the index ( which will be negligible ).
    1. But now, following teh same logic, I m confused why SELECTINg from a large table should be more time taking ("expensive" ) than SELECTing from a small table.
    ( SELECTing using an index )
    My understanding of how Oracle works internally is this :
    It will first locate the ROWID from teh B-Tree that stores the index.
    ( This operation is O(log N ) based on B-Tree )
    ROWID essentially contains teh file pointer offset of teh location of the data in teh disk.
    And Oracle simply reads teh data from teh location it deduced from ROWID.
    But then the only variable I see is searching teh B-Tree, which should take O(log N ) time for comparison ( N - number of rows )
    Am I correct above.
    2. Also I read that tables are partitioned for performance reasons. I read about various partiotion mechanisms. But cannot figure out how it can result in performance improvement.
    Can somebody please helpIt's not going to be that simple. Before your first step (locate ROWID from index), it will first evaluate various access plans - potentially thousands of them - and choose the one that it thinks will be best. This evaluation will be based on the number of rows it anticipates having to retrieve, whether or not all of the requested data can be retrived from the index alone (without even going to the data segment), etc. etc etc. For each consideration it makes, you start with "all else being equal". Then figure there will be dozens, if not hundreds or thousands of these "all else being equal". Then once the plan is selected and the rubber meets the road, we have to contend with the fact "all else is hardly ever equal".

  • No value is select  from  user define  table

    Hi ALL,
                 i am using  B1if , i am sending  data  B1 to  isr , i am using user define table  but problem  no value is select  from  user define  table  .
    my table ID  is @SSRPOD 
    <payload operation="">
         <ns0:MT_POD_B1_System xmlns:ns0="http://xxxx.com/SC/B1/Dlvr/CustDlvr/ExtPrfOfDlvr">
              <POD>
                   <Header>
                        <SalesOrderNumber>
                             <xsl:value-of select="$msg/BOM/BO/@SSRPOD/row/U_SalOrdNo" />
                        </SalesOrderNumber>
                        <ArrivalDate>
                             <xsl:value-of select="$msg/BOM/BO/@SSRPOD/row/U_TaxDate" />
                        </ArrivalDate>
                        <Detail>
                             <DOLineQuantity>
                                  <xsl:value-of select="$msg/BOM/BO/@SSRPOD/row/U_Quantity" />
                             </DOLineQuantity>
                             <UOM>
                                  <xsl:value-of select="$msg/BOM/BO/@SSRPOD/row/U_Unitmsr" />
                             </UOM>
                        </Detail>
                   </Header>
              </POD>
         </ns0:MT_POD_B1_System>
    </payload>
    I have set following things. 
    Inbound Channel
        scenirio step identifier :z.xxxx
        Inbound Channel(IPO):INB_B1_EVNT_ASYN_EVT
        InboundType:Asynchronous
        Process Trigger:B1Event
        Identification Method: B1Event
        Identification Parameter:n.a
        Identifier:?????                                  
        Identifier Namespace:??????
      can anyone help me?
    Edited by: Sinha_Sinha on Feb 3, 2012 7:47 AM

    Found an authorization object was missing, that enabled the case types to show but hitting the GO button brought a page that can not be viewed in IE.  on to the next hurdle..........

  • How can I reset my access passcode w/o having ever synced the device before? I don't remember it and now the ipad is "disabled" from too many failed attempts.

    How can I reset my access passcode without having ever synced the device before? I don't remember my passcode and now the ipad is "disabled" from too many failed attempts.

    You will need to reset the iPad back to factory defaults : iOS: Forgot passcode or device disabled
    What iTunes purchases that you can redownload for free from the stores will show in the Purchased tabs in the App Store and iTunes Store apps, and the Purchased tab in the iBookstore in the iBooks app

  • Too many table columns

    Hi,
    I have to create a pdf with a table having multiple columns.
    But the table has too many columns to fit in a A4 page.
    I do not wan to change the paper type. I have to use A4 paper only.
    Is there a way in which I can show the table records in two consecutive rows..
    so that I can split the columns into two rows.
    There will be two header rows... and two data rows (only data rows will repeat)
    data row1 will have data from say fields 1 to 10 and data row 2 will have data from fields 11 to 20.
    Regards
    Reema.

    As far as I know there's probably no way ID is going to do what you want.
    You can place a table across a multiple page spread, but the odds of being able to do that and still keep the file printable are marginal, at best. You can't for example, leave blank space at the gutters unless you are able to add a blank column that spans the gutter, and the limt for multipage spreads is 10 pages wide, whcih doesn't sound like it's probably enough to hold almost 600 columns.
    Perhaps placing the table using named ranges of appropriate widths would work...

  • Unable To Select From SQL Server table with more than 42 columns

    I have set up a link between a Microsoft SQL Server 2003 database and an Oracle 9i database using Heterogeneous Services (HSODBC). It's working well with most of the schema I'm selecting from except for 3 tables. I don't know why. The common denominator between all the tables is that they all have at least 42 columns each, two have 42 columns, one has 56, and the other one, 66. Two of the tables are empty, one has almost 100k records, one has has 170k records. So I don't think the size of the table matters.
    Is there a limitation on the number of table columns you can select from through a dblink? Even the following statement errors out:
    select 1
    from "Table_With_42_Cols"@sqlserver_db
    The error message I get is:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message [Generic Connectivity Using ODBC]
    ORA-02063: preceding 2 lines from sqlserver_db
    Any assistance would be greatly appreciated. Thanks!

    Not a very efficient and space friendly design to do name-value pairs like that.
    Other methods to consider is splitting those 1500 parameters up into groupings of similar parameters, and then have a table per group.
    Another option would be to use "vertical table partitioning" (as oppose to the more standard horizontal partitionining provided by the Oracle partition option) - this can be achieved (kind of) in Oracle using clusters.
    Sooner or later this name-value design is going to bite you hard. It has 1500 rows where there should be only 1 row. It is not scalable.. and as you're discovering, it is unnatural to use. I would rather change that table and design sooner than later.

  • Giving Error When Selecting From a Custom Table

    There is a custom report 'Z*'  which archives data.
    In this report, while selecting data(needs to be archived) from a custom table 'Z*_T', giving runtime error in Production Server.
    The select statement is written below :
    *data izX like z_t occurs 1000 with header line._
    *select * from z*t into table i_zX.*_
    How can I change the select statement so that it will work properly?

    Sas..
    From your example code it appears you are trying to use a wild card for both your dbtable and the internal table.
    To do this, you will lilkely need to use a Field Symbol for the target internal table and your FROM will need to be a varible
    FROM (dbtabname)
    The ABAP Helps gives this example for the Select Table
    DATA  TABNAME(10).
    DATA: BEGIN OF WA,
            ID   LIKE SCUSTOM-ID,
            NAME LIKE SCUSTOM-NAME,
            REST(134),
          END OF WA.
    TABNAME = 'SCUSTOM'.
    SELECT * INTO WA FROM (TABNAME).
      WRITE: / WA-ID, WA-NAME.
    ENDSELECT.

  • Creating and selecting from a dynamic table

    Hi,
    Iam trying to create a table dynamically and selecting from it in same plsql block, but am getting "table doesnot exist" error. however if i just create a table dynamically and then do a select on it seperately it works..
    below is sample code for the same,
    working
    Line: -----
    DECLARE
    loc VARCHAR2(20):='bglr';
    l_cnt pls_integer;
    BEGIN
    -- create an employee information table
    EXECUTE IMMEDIATE
    'CREATE TABLE ' || 'emp_bglr' ||
    empno NUMBER(4) NOT NULL,
    ename VARCHAR2(10),
    job VARCHAR2(9),
    sal NUMBER(7,2),
    deptno NUMBER(2)
    end;
    select count(*) from emp_bglr ...works and return me 0 rows
    Line: -----
    but when i include select in plsql block ..it throws "Table does not exists" error...(iam running below plsql block after dropping the created table)
    not working
    Line: -----
    DECLARE
    loc VARCHAR2(20):='bglr';
    l_cnt pls_integer;
    BEGIN
    -- create an employee information table
    EXECUTE IMMEDIATE
    'CREATE TABLE ' || 'emp_bglr' ||
    empno NUMBER(4) NOT NULL,
    ename VARCHAR2(10),
    job VARCHAR2(9),
    sal NUMBER(7,2),
    deptno NUMBER(2)
    --COMMIT;
    END;
    Select count(*) into l_cnt from emp_bglr;
    dbms_output.put_line('cnt is '||l_cnt);
    end;
    Line: -----

    Becuase your code is first checked for syntax/object existance during compilation and throws an error saying the table does not exist.
    Try this:
    SQL> ed
    Wrote file afiedt.buf
      1   DECLARE
      2   loc VARCHAR2(20):='bglr';
      3   l_cnt pls_integer;
      4   BEGIN
      5   -- create an employee information table
      6   EXECUTE IMMEDIATE 'CREATE TABLE emp_bglr(
      7   empno NUMBER(4) NOT NULL,
      8   ename VARCHAR2(10),
      9   job VARCHAR2(9),
    10   sal NUMBER(7,2),
    11   deptno NUMBER(2)
    12   )';
    14  Select count(*) into l_cnt from all_objects where object_name = 'EMP_BGLR';
    15  dbms_output.put_line('tab cnt is '||l_cnt);
    16  IF (l_cnt = 1) THEN
    17  l_cnt := 0;
    18  EXECUTE IMMEDIATE 'SELECT count(*) from apps.emp_bglr' into l_cnt;
    19  dbms_output.put_line('data cnt is '||l_cnt);
    20  END IF;
    21* end;
    SQL> /
    tab cnt is 1
    data cnt is 0
    PL/SQL procedure successfully completed.
    SQL> Edited by: AP on Aug 5, 2010 5:51 AM
    Edited by: AP on Aug 5, 2010 5:52 AM

Maybe you are looking for

  • How to set a new MEASURE NUMBER in Logic

    Hi guys, I can't find this in the manual so hopefully you can help. I am trying to SET a measure number 1 in the MIDDLE of my project. What I have going on is this: I am trying to score to a video.. The Video quicktime that I was given is LONGER than

  • Reload archived file on another sap system

    Dear Experts, We have multiple plants in sap system maintained with different clients.  For example Plant A , Plant B, Plant C. Is it possible to migrate plant data from one SAP System to new sap system. we have a Plan to provide separate systems as

  • Anyone can teach me how to convert my MP3 song into Ringtone on my iPhone 5

    Anyone could teach me how to convert my MP3 music in my iPhone 5 into Ringtone?

  • Difference between FI & CO-PA???

    Hi Experts, We confirmed an production order (related to sales order production). We confirmed zero activity and afterwards zero quantity has been delivered (goods receipt created with zero amount) to stock. By one activity I see following ... Plan q

  • Factory start date in factory calendar

    Hi, what to fill in "Factory Date Start" field while creating new factory calendar? Thanks!