Using partition names in the query

Dear all,
Does query 1 and 2 have the same impact
update MEDT.CUST a
set MEDCV = round((select sum(BILLAMOUNT) from MEDTC b
where b.subno = a.subno and b.contrno = a.contrno AND CHARGETYPE = 'L'
AND CALL_TYPE = '001' AND TARIFF_GROUP in ( 'MOCONNET','VICFWD') AND TRANSDATE > to_date('03-DEC-08','DD-MMM-YY') AND TRANSDATE < to_date('31-JAN-09','DD-MMM-YY') ),3) ;
Commit; AND (here am using partitions to speed up the update)
update MEDT.CUST a set MEDCV = round((select sum(BILLAMOUNT) from MEDTC partition(dec200801) b where b.subno = a.subno and b.contrno = a.contrno AND CHARGETYPE = 'L' AND CALL_TYPE = '001' AND TARIFF_GROUP in ( 'MOCONNET','VICFWD') AND TRANSDATE > to_date('03-DEC-08','DD-MMM-YY') AND TRANSDATE < to_date('16-DEC-08','DD-MMM-YY') ),3) ;
commit;
update MEDT.CUST a set MEDCV = round((select sum(BILLAMOUNT) from MEDTC partition(dec200802) b where b.subno = a.subno and b.contrno = a.contrno AND CHARGETYPE = 'L' AND CALL_TYPE = '001' AND TARIFF_GROUP in ( 'MOCONNET','VICFWD') AND TRANSDATE > to_date('16-DEC-08','DD-MM-YY') AND TRANSDATE < to_date('31-DEC-08','DD-MMM-YY') ),3) ;
commit;
update MEDT.CUST a set MEDCV = round((select sum(BILLAMOUNT) from MEDTC partition(jan200901) b where b.subno = a.subno and b.contrno = a.contrno AND CHARGETYPE = 'L' AND CALL_TYPE = '001' AND TARIFF_GROUP in ( 'MOCONNET','VICFWD') AND TRANSDATE > to_date('01-JAN-09','DD-MMM-YY') AND TRANSDATE < to_date('16-JAN-09','DD-MMM-YY') ),3) ;
commit;
update MEDT.CUST a set MEDCV = round((select sum(BILLAMOUNT) from MEDTC partition(jan200902) b where b.subno = a.subno and b.contrno = a.contrno AND CHARGETYPE = 'L' AND CALL_TYPE = '001' AND TARIFF_GROUP in ( 'MOCONNET','VICFWD') AND TRANSDATE > to_date('16-JAN-09','DD-MMM-YY') AND TRANSDATE < to_date('31-JAN-09','DD-MMM-YY') ),3) ;
commit;

EXPLAIN PLAN for various SQL would contain answers
Post Operating System (OS) name & version for DB server system.
Post results of
SELECT * from v$version

Similar Messages

  • Program name for the query generated using sq0102-03

    Hi Folks,
    How can we know the proggram  name for the query generated using sq01 and all?
    K.Kiran.

    Hi Kiran,
    U can get program name of nay transaction code by following this procedure
    after entering tcode it will direct u to the related screen then on the tool bar select system then go for status there u can find program name
    Rewards if helpfull
    Regards,
    Pavan

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

  • Anyway to supress the coulmn names in the query output from SQLPLUS

    Hi,
    I am using sqlplus to run a script which returns the results with column names.
    Is there anyway to omit the column names from the query output from sqlplus?
    I would like to have only results with out their column names in the output.
    Thanks in advance!!

    Hi,
    Maybe your LINES(IZE) isn't set ?
    SCOTT>set lines 130
    SCOTT>select status, machine, module
      2    from v$session
      3   where upper(username) = 'SCOTT';
    STATUS   MACHINE                                                          MODULE
    INACTIVE PFAE3\VPC4894-03                                                 TOAD 9.7.2.5
    ACTIVE   PFAE3\VPC4894-03                                                 SQL*Plus
    2 rows selected.
    SCOTT>As an alternative to setting linesize, you can format columns:
    SCOTT>set lines 80
    SCOTT>col status for a8
    SCOTT>col machine for a30
    SCOTT>col module for a30
    SCOTT>select status, machine, module
      2    from v$session
      3   where upper(username) = 'SCOTT';
    STATUS   MACHINE                        MODULE
    INACTIVE PFAE3\VPC4894-03               TOAD 9.7.2.5
    ACTIVE   PFAE3\VPC4894-03               SQL*Plus
    2 rows selected.
    SCOTT>Regards
    Peter

  • Using item values in the query

    Hi,
    Is there a way I can use item values in the query...?
    as an example, something like this
    select a.*, :P20_CUST_NAME as CUSTOMER_NAME
    from
    table TEMP a;
    haven't tried it yet but want to get the feedback first before making an attempt...
    Thanks

    Yes, as long as that item has a value in session state..
    Thank you,
    Tony Miller
    Webster, TX

  • Problem with 0FIGL_VC1 when use constant selection in the query

    Please kindly help me. I have this problem for 2 weeks already.
    When I create a query from virtual cube 0FIGL_VC1 (balance sheets / p&l statements), if I use constant selection in any of key figure, my report could not display financial statment correctly. 
    My report layout
    Columns :  key figures  (including 0FIGL_VC1_CK001)
    Rows:  0GLACCEXT  (financial statement item) << as hierarchy
    Initially, the query is processed correctly.
    However, based on the requirement from my customer, I really have to use "constant selection" for some of my columns. Whenever I do so, the query display incorrectly. (Some nodes of financial statement item just disappear. (it seem like all contra item will disappear.)  
    Please help!

    If I dont use constant selection in the query, data are display correctly.
    But If I use constant selection in the query, some financial statement item dont display any value
    Example :
       Financial statement item(Display in hier)     Period1   Total Period1(Constant selection)
                 A                                                       10            60
                 B                                                       20            60
                 C                                                       30            60
                 D                                                       0              60
    - Financial statement item "D"  has some value.
    - Financial statement item "D"  is in the hierarchy,one gl account has been assigned to more than one group differentiated by debit/credit indicator.
    Please help!!

  • How to find name of the Query in SE09

    Hi Experts,
    Can anyone tell me how do find the name of the Query which is not released.
    Like for example:
    When I try to open the modified requests of all the users It displays me the names of the Tables, WEB templates etc. But for Query it only shows the Elements of Query Builder only some junk data.
    Please help me understand which query request that is.
    Thanks

    Do you have the TR no. which is released for the query.
    if you go there and check in SE09, it would show you the query name i guess which are the objects included in the request.
    Try this and hope this would  help you.

  • How can I specify the PARTITION name at the time of data load?

    Hi,
    I have a table with 4 partitions. By using SQL*Loader I'm going to load data into the same. While inserting the records it should go to the 2nd partition only.
    Where should i specify the Partition name?
    Please clarify me with sample code.
    Thanks.

    Assuming that the partition is empty before the load, I would load the data into a temp table with the same structure as the partitioned table. After all the data is successfully loaded, exchange the partition of the table with the temp table using 'alter table ... exchange partition...'
    Another question is, how is your table partitioned?
    Message was edited by:
    Jens Petersen

  • Error when using "inlist operator" in the query filter of Webi 3.1

    Hi,
    We are currently in the process of migrating Deski to webi (BOXI 3.1).
    The problem is, Deski is using the "inlist" operator which is working fine but after migrating to webi the inlist operator in the query filter is throwing the below error,
    *Error Message :*
    A database error occured. The database error text is: ORA-00907: missing right parenthesis. (WIS 10901)
    Appreciate your assistance on this.
    Thanks !
    Regards,
    Perialt

    Karthik ,
    Yes I am seeing an additional paranthesis in Webi SQL query.
    For example plz consider the product table below,
    SELECT
    Product.ID,
    Product.Name
    FROM Product
    WHERE
    Product.Name IN ( @Prompt('4) Name:','C','Product\Name-M',multi,free)  )
    As a work around in Custom SQL, If I remove the paranthesis the below query is running fine in webi
    SELECT
    Product.ID,
    Product.Name
    FROM Product
    WHERE
      Product.Name IN  @Prompt('4) Name:','C','Product\Name-M',multi,free) 
    But I want a permanent solution.

  • Performance hit using "where" clause in the query

    Hi All,
    I am facing a huge performance hit in the java code when using "where" clause in queries. Following are the details:
    1. SELECT * FROM Employee
    2. SELECT * FROM Employee where employeeid in (26,200,330,571,618,945)
    There is no difference in Query Execution Time for both queries.
    Business Logic Time is huge in second case as compared to first one (ratio - 1:20).
    Rows returned are more in first case as compared to second case.(ratio - 1:4)
    Business Logic is same for both the cases where I iterate through the ResultSet, get the objects and set them in a data structure.
    Does anybody know the reason of unexpected time difference for the business logic in the second case?

    Since you're mentioning clustering your index, I'll assume you are using Oracle. Knowing what database you are using makes it a lot easier to suggest things.
    Since you are using Oracle, you can get the database to tell you what execution plan it is using for each of the 2 SQL statements, and figure out why they have similar times (if they do).
    First, you need to be able to run SQL*Plus; that comes as part of a standard database installation and as part of the Oracle client installation - getting it set up and running is outside the scope of this forum.
    Second, you may need your DBA to enable autotracing, if it's not already:
    http://asktom.oracle.com/~tkyte/article1/autotrace.html
    http://www.samoratech.com/tips/swenableautotrace.htm
    Once it's all set up, you can log in to your database using sql*plus, issue "SET AUTOTRACE ON", issue queries and get execution plan information back.
    For example:
    SQL> set autotrace on
    SQL> select count(*) from it.ticket where ticket_number between 10 and 20;
      COUNT(*)
            11
    Execution Plan
    Plan hash value: 2983758974
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            |     1 |     4 |     1   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE   |            |     1 |     4 |            |          |
    |*  2 |   INDEX RANGE SCAN| TICKET_N10 |    12 |    48 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("TICKET_NUMBER">=10 AND "TICKET_NUMBER"<=20)
    Statistics
              0  recursive calls
              0  db block gets
              1  consistent gets
              0  physical reads
              0  redo size
            515  bytes sent via SQL*Net to client
            469  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> This tells me that this query used an INDEX RANGE SCAN on index TICKET_N1; the query can't do much better than that logically... In fact, the statistic "1 consistent gets" tells me that Oracle had to examine only one data block to get the answer, also can't do better than that. the statistic, "0 physical reads" tells me that the 1 data block used was already cached in Oracle's memory.
    the above is from Oracle 10g; autotrace is available back to at least 8i, but they've been adding information to the output with each release.
    If you have questions about sql_plus, check the forums at asktom.oracle.com or http://forums.oracle.com/forums/category.jspa?categoryID=18
    since sql*plus is not a JDBC thing...
    Oh, and sql*plus can also give you easier access to timing information, with "set timing on".

  • Using wild chatacters in the query

    Hi experts,
    I have a query like this:
    IF NOT i_name1 IS INITIAL.
        SELECT    kunnr
          FROM    kna1
          INTO    TABLE it_kna1
         WHERE    name1 EQ i_name1.
    ENDIF.
    Lets says KNA1 has some customer names like CABD, ZABY, PABQ, LABN.
    Suppose a customer enters the customer name as AB, how can I use the wild characters in the query to ensure
    that all these 4 names are fetched?
    Thanks,
    Ajay.

    hi ajay ,
        who told  it is not possible pls do this way
         Don't worry You can use   " Ranges : i_name1 like kn1-name1 .  PASTE BELOW   CODE IN YOUR FUNCTION MODULE
    IT WILL RUN LIKE A BULLET  .
    Ranges : i_name1 like knA1-name1 .
    MOVE 'I' TO i_NAME1-sign.
        MOVE 'CP' TO I_NAME1 option.
        MOVE I_NAME1 TO I_NAME1-low.
        APPEND I_NAME1.
    IF NOT i_name1 IS INITIAL.
    SELECT kunnr
    FROM kna1
    INTO TABLE it_kna1
    WHERE name1 EQ i_name1.
    ENDIF.
    rEGARDS
    dEEPAK .

  • Can i use partition by for the following

    hi, i wanted to find out if i can use partition by or rank to the get the needed results below. If yes can anyone help me out with it.
    if there is an other way to get the results also please let me know.
    i'm using Oracle version 10.2.0.4.0
    create table script:
    CREATE TABLE DMM.QUES
      CASENAME        VARCHAR2(100 BYTE),
      CASENUMBER      VARCHAR2(20 BYTE),
      COVERAGE        VARCHAR2(10 BYTE),
      DIVISIONNUMBER  VARCHAR2(6 BYTE),
      CLASSNUMBER     number,
      TIER            VARCHAR2(2 BYTE),
      MONTHLYRATE     NUMBER
      )Insert statement scripts:
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','health', '456J','987',null,.25)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','health', '456J','123',null,.25)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','health', '456J','453',null,.25)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','dental', '456J','453','ee',.29)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','dental', '456J','453','es',.23)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','dental', '456J','453','ec',.44)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','dental', '456J','453','fa',.33)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','dental', '456J','123','ee',.45)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','dental', '456J','123','es',.45)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','dental', '456J','123','ec',.46)
    insert into QUES (CASENAME,CASENUMBER,  COVERAGE,  DIVISIONNUMBER,  CLASSNUMBER,  TIER,MONTHLYRATE)
    values ('ABC','123J','dental', '456J','123','fa',.49)select * from ques:
    ABC     123J     health     456J     987          0.25
    ABC     123J     health     456J     453          0.25
    ABC     123J     health     456J     123          0.25
    ABC     123J     dental     456J     453     ee     0.29
    ABC     123J     dental     456J     453     es     0.23
    ABC     123J     dental     456J     453     ec     0.44
    ABC     123J     dental     456J     453     fa     0.33
    ABC     123J     dental     456J     123     ee     0.45
    ABC     123J     dental     456J     123     es     0.45
    ABC     123J     dental     456J     123     ec     0.46
    ABC     123J     dental     456J     123     fa     0.49i would like to get the following output
    ABC     123J     health     456J     123          0.25
    ABC     123J     dental     456J     123     ee     0.45
    ABC     123J     dental     456J     123     es     0.45
    ABC     123J     dental     456J     123     ec     0.46
    ABC     123J     dental     456J     123     fa     0.49i would like the code to take the minimum of classnumber for each divisonnumber/coverage combination and give me all the records for that classnumber.
    Thanks in advance.

    Hi,
    That's an example of a Top-N Query , and yes, analytic functions are a good way to do it:
    WITH     got_r_num     AS
         SELECT     ques.*
         ,     RANK () OVER ( PARTITION BY  coverage
                               ,          divisionnumber
                          ORDER BY          classnumber
                        ) AS r_num
         FROM    ques
    SELECT  casename, casenumber, coverage, divisionnumber, classnumber, tier, monthlyrate
    FROM     got_r_num
    WHERE     r_num     = 1
    ;Thanks for posting the CREATE TABLE and INSERT statements, that's very helpful!
    "PARTITION BY" is a clause often used with analytic functions. "PARTTIION" also means at least two other things in Oracle, so people will understand you better if you say "analytic functions", rather than "partition by".
    For more about the RANK function, see this thread:
    Re: A "double grouping" SQL query

  • HT4436 If someone else has set up an ICloud account (that uses his name in the email address) using my Apple ID, do I have to change my Apple ID to open an account with my name in the email address?

    If someone else has set up an ICloud account using my email address and Apple ID but has chosen his name for the mail name, can I get rid of his name in the [email protected] and put mine in there?  Or do I have to set up a whole new acount with a new Apple ID?  Will I be able to do that with his name already linked to my email address?

    How did he manage to do this? - he would have to have known your password if he was using an existing Apple ID. You should change it immediately to something strong and unguessable. That will prevent him accessing the account or using the email he has set up (assuming he hasn't changed the password and locked you out).
    You can't change the primary @icloud.com address once set up, though you can create additional addresses as email aliases: if he's given this address out you will get his emails but you could set up a Rule to trash them.
    You might to better to create a new ID and iCloud account anyway. To do this you wil need a different non-Apple email address (you could use a free GMail one); or you have the option in the iCloud prefs pane to choose an @icloud.com address and make that the ID.

  • Unable to use Navigational Attr in the query ?

    Hi experts,
    We are using BEx 3.X.
    We have a report based on an infoset. We want to use some navigational attributes in the query and
    restrict the values of these attributes.
    But we are unable to use them as navigational attr. They are displayed as display attributes only.
    We are unable to restrict them. This is because the query is on Infoset.
    When i use the same navigational attr in a query based on a infocube, it is displaying as Navigational Attr.
    We are in BI 7 but using BEx 3.X.
    How to resolve this ?
    Regards,
    Nishuv.

    Hi,
    Master Data Read
    A simple master data read should be done using generic BI functionality in the update rules. Choose the
    option u201CMaster Data Attribute ofu201D in the update rule details for the selected characteristic and select an
    attribute by using the F4 help. With this setting, the value of the characteristic to be updated is read from the
    master data table of the specified characteristic.
    Characteristic Material is provided by the InfoSource.
    Characteristic Material Group is not provided by the InfoSource.
    Characteristic Material Group is an attribute of characteristic Material
    Therefore you can fill Material Group from the master data table of Material: Select the method Master Data
    Attribute from and Material as source.
    The generic master data read only works for characteristics that are available in the communication
    structure.
    For a more complex master data read or if the characteristic is not available in the communication structure,
    you have to implement the master data read yourself in a routine for the specific characteristic. If so, the
    function module RSAU_READ_MASTER_DATA should be used to read the master data.
    In Infoset u can use max 2 cubes......and Infoobjects 'N' number u can use.......
    Thanks/Tarak

  • In URM, the RMA_NOTIFY_AUTHORS service is using my name in the "from"

    IN URM, when the RMA_NOTIFY_AUTHOR service is activated from a disposition, all emails are listed "from" me.
    I have no idea why that is or how to correct it. I opened a request with Oracle support with no success as of yet. The best they could offer was to tell me to check what email address I had for the sysadmin in my config.cfg file. that email address is totally different than mine and correlates to the system administrator. All other emails that come from the URM instance reflect the sysadmin as the "from". but for some reason any emails sent via the RMA_NOTIFY_AUTHOR service has me as the from, no matter what user causes the disposition to activate.
    If anyone out there can tell me where URM decides what email address to use for all of its AUTHOR NOTIFICATION emails, I would appreciate it.
    Thanks

    This happens when you run the batch services yourself. If the batch services run by theirselves, at the scheduled time, the email address that is attached to the sysadmin is used in the from, otherwise, whoever runs the batch service manually has their name in the from for the notifications generated from the batch service.

Maybe you are looking for

  • Analysis Authorization & its compaitbility with BW 3.5 Query

    Hi, We have technically upgrade our system from BW 3.5 to BI 7.0. Now we are planning to upgrade to Analysis Authorization. 1. Is it necessary to Migrate BW 3.5 query to BI 7.0 so that it will work with Analysis Authorization? If not, then how Analys

  • Authorization tag in  http header

    While making an end point call using the webservice control the authorization tag is getting added to the http header. This is causing 401 errors when going over SSL . We are adding the credentials as part of the SOAP header. Why / How is the Authori

  • TS2446 My Apple ID has been Disabled - i reset my password, but still disabled

    Apple ID has been Disabled, I reset my password, but still disabled.

  • Iphoto 9.6 rotation of grayscale images

    If I import grayscale images into iPhoto 9.6 (under Yosemite, in this case) (either Tiff or JPEG, 8- or 16-bit), iPhoto corrupts the images if I rotate them in iPhoto. To see it happen, I merely:      Create a grayscale image (I use vuescan, but it w

  • Jms Protocol error

    Hi , I am using Oracle 10g version 10.1.3 and Oracle AS JMS Server I have a java client that is using the following configuration for JNDI conext. // set the environment properties env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMII