Fine tuning the cursor

I am using two cursors in my Pro*C applicatioin
exec sql declare cur_open_act cursor for
select distinct d.member_number,
a.account_number,
a.registration_type,
f.registration_desc,
a.office_code,
a.open_flag,
a.date_opened,
a.state,
a.restriction_code,
a.restriction_date,
nvl(c.book_shares, 0) +
nvl(c.memo_book_shares, 0) +
nvl(b.non_company_sweep_balance, 0) +
nvl(a.cash_td_balance, 0) +
nvl(a.cash_sd_balance, 0) +
nvl(a.margin_td_balance, 0) +
nvl(a.margin_sd_balance, 0)
) as balance
from br_accounts a,
(select account_number,
sum(sweep_td_balance) non_company_sweep_balance
from br_sweep_accounts
group by account_number) b,
stars_accounts c,
br_member_accounts d,
br_office_codes e,
company_registration_types f
where a.account_number = b.account_number (+)
and a.account_number = d.account_number
and a.sweep_fund_number = c.fund_number (+)
and a.sweep_account_number = c.account_number (+)
and a.registration_type = f.registration_type (+)
and a.office_code = e.office_code
and a.open_flag='Y'
and d.relationship_code in ('PRI','RET','TTE')
and e.managed_product_ind != 'Y';
exec sql declare cur_close_act cursor for
select distinct d.member_number,
a.account_number,
a.registration_type,
f.registration_desc,
a.office_code,
a.open_flag,
a.date_opened,
a.state,
a.restriction_code,
a.restriction_date,
nvl(c.book_shares, 0) +
nvl(c.memo_book_shares, 0) +
nvl(b.non_company_sweep_balance, 0) +
nvl(a.cash_td_balance, 0) +
nvl(a.cash_sd_balance, 0) +
nvl(a.margin_td_balance, 0) +
nvl(a.margin_sd_balance, 0)
) as balance
from br_accounts a,
(select account_number,
sum(sweep_td_balance) non_company_sweep_balance
from br_sweep_accounts
group by account_number) b,
stars_accounts c,
br_member_accounts d,
br_office_codes e,
company_registration_types f
where a.account_number = b.account_number (+)
and a.account_number = d.account_number
and a.sweep_fund_number = c.fund_number (+)
and a.sweep_account_number = c.account_number (+)
and a.registration_type = f.registration_type (+)
and a.office_code = e.office_code
and a.open_flag='N'
and d.relationship_code in ('PRI','RET','TTE')is
and e.managed_product_ind != 'Y'
and (
nvl(c.book_shares, 0) +
nvl(c.memo_book_shares, 0) +
nvl(b.non_company_sweep_balance, 0) +
nvl(a.cash_td_balance, 0) +
nvl(a.cash_sd_balance, 0) +
nvl(a.margin_td_balance, 0) +
nvl(a.margin_sd_balance, 0)
) != 0;
The query used is redundant for the most part and is shown below
select distinct d.member_number,
a.account_number,
a.registration_type,
f.registration_desc,
a.office_code,
a.open_flag,
a.date_opened,
a.state,
a.restriction_code,
a.restriction_date,
nvl(c.book_shares, 0) +
nvl(c.memo_book_shares, 0) +
nvl(b.non_company_sweep_balance, 0) +
nvl(a.cash_td_balance, 0) +
nvl(a.cash_sd_balance, 0) +
nvl(a.margin_td_balance, 0) +
nvl(a.margin_sd_balance, 0)
) as balance
from br_accounts a,
(select account_number,
sum(sweep_td_balance) non_company_sweep_balance
from br_sweep_accounts
group by account_number) b,
stars_accounts c,
br_member_accounts d,
br_office_codes e,
company_registration_types f
where a.account_number = b.account_number (+)
and a.account_number = d.account_number
and a.sweep_fund_number = c.fund_number (+)
and a.sweep_account_number = c.account_number (+)
and a.registration_type = f.registration_type (+)
and a.office_code = e.office_code
and d.relationship_code in ('PRI','RET','TTE')is
and e.managed_product_ind != 'Y'
Is there a more efficient way other than using 2 separate cursors?
I don't want to use the redundant portion as a single cursor since it affects the performance.
Edited by: user9285722 on Apr 1, 2011 4:43 PM

Hi,
Why dont you just use the 1st cursor and along with what you do with the first cursor, if balance!=0 then do what you do with second cursor.
I dont know how you do in pro*c, but here is the algorithm.
open cur_open_act;
loop
-- Do your operations that you do with cursor1.
---Now along with that
IF cur_open_act.balance != 0 then
----- Do your operations that you do with cursor2.
END IF;
end loop;G.

Similar Messages

  • How to guide for Fine tuning the performance of SAP EP

    All,
    Could anyone please let me know where to locate the how to guide for fine tuning the performance of the SAP Enterprise Portal?
    thanks,
    ~L

    hi leena,
    Look into these threads...
    https://www.sdn.sap.com/irj/sdn/thread?threadID=119605
    https://www.sdn.sap.com/irj/sdn/thread?threadID=101325
    Also see,
    <a href="https://websmp103.sap-ag.de/~form/sapnet?_SHORTKEY=00200797470000073623&_OBJECT=011000358700001480992005E">this link</a>
    https://media.sdn.sap.com/public/eclasses/bwp04/PortalTuning_files/Default.htm
    Regs,
    jaga
    Message was edited by: jagadeep sampath

  • Fine Tuning The Enterprise Portal

    Hello world
    Currently i am searching about the best ways to fine tune our E Portal the below Info are the results of my search so far.
    Hope They Help You and please share any knowledge you have around this area.
    Tuning The E-Portal
    1-Tunable Parameters of SAP Web Application Server (JAVA)
    :Reducing the Network Traffic -From the Config Tool window,
    select: <instance> + services + http, and change the
    value of the following properties:
    -NeverCompressed: delete this values --> *.css, *.pdf, *.js, image,
    application/pdf, text/JavaScript
    -CacheControl: 604800
    Servlet_js p
    -EnableChunkedResponse: True
    -MinimumGZipLength:  1024
    2-SAP Web Application Server (Java) Monitoring Server
    Adjusting Log Severity Levels
    - re adjust the severty from ALL to ERROR
    3-Disabling the Distributed Statistics Service
    1.Run\usr\sap\<system_number>\JC<instance_id>\j2ee\configtool
    \offlinecfgeditor.bat
    2. Select Configurations -> cluster_data -> server -> cfg -> services->
    Propertysheet dsr-runtime -> <edit-button> -> startup-mode ->
    3. Select Custom and enter manual, and then select Apply custom .
    4. Restart the cluster.
    4- PRT Configuration
    \usr\sap\<system_id>\JC<instance_number>\j2ee\cluster\server<number>\apps\sap.com\irj
    \servlet_jsp\irj\root\WEB-INF\portal\system\properties
    SET
    -async.response.pool.size=100
    -PRT monitor  monitor.off=false
    -Log on to the portal as an administrator, and navigate to:
    System Administration -> Monitoring -> Portal
    -> Components Overview System Administration ->Monitoring ?? Portal ?? Threads Overview
      to help you identify bottlenecks in performance.
    5-Tuning the Application Server
    - Configuring JVM parameters on AS Java
    Set <-XX:SoftRefLRUPolicyMSPerMB=1000> (from default 1)
    - Avoiding session leaks - Tracing Single User Sessions
    - Tuning HTTP Provider Service
    -Enabling production mode
    6-Java Memory Analyzer Tool
    -Install Java Memory Analyzer Tool MAT
    - run performance reports using Solution Manger  // this only work if you have running solution manger on your system
    If You Have Any Tips Please Share
    Regards,
    Ahmed Salam

    Dear Ashish,
    From the Config Tool window --> Servlet_js p Tap
    -EnableChunkedResponse: True
    -MinimumGZipLength:  1024
    Read carfuly and you will find the answers
    Hope it helped
    Regards,
    Ahmed Salam.

  • Inputs for Fine tuning the program

    Hi All,
    Following code is taking lot of time... No i need to fine tune the same ,,,
    Please give some inputs..
    SELECT VBELN INTO VBUK-VBELN FROM VBUK
    WHERE ( CMGST EQ 'B' OR CMGST EQ 'C' )
    AND VBELN IN S_VBELN.
    SELECT * FROM VBAP WHERE VSTEL IN SHP_PT
    AND VBELN EQ VBUK-VBELN
    AND VKGRU '101'.
    SELECT VBELN POSNR EDATU FROM VBEP
    INTO (VBEP-VBELN,VBEP-POSNR,VBEP-EDATU)
    WHERE VBELN EQ VBAP-VBELN AND POSNR EQ VBAP-POSNR
    AND LFREL EQ 'X' AND BMENG GT 0
    AND EDATU BETWEEN DATE_LOW
    AND DAT_HIGH
    ORDER BY EDATU VBELN POSNR.
    CLEAR LIPS.
    PERFORM APPEND_DATA_TO_ITAB1 TABLES ITAB1
    USING VBEP-VBELN VBEP-POSNR
    VBEP-EDATU LIPS-VBELN
    LIPS-POSNR vbap-VSTEL.
    ENDSELECT.
    ENDSELECT.
    ENDSELECT.
    Regards,
    Chan
    Moderator message: Please Read before Posting in the Performance and Tuning Forum
    Edited by: Thomas Zloch on Nov 24, 2010 1:17 PM

    HI,
    Remove the select endselect the select all the entries into internal table then from tat internal table select by using for all entries into another internal table. for eq -
    IF NOT s_vbeln[] IS INITIAL.
      SELECT vbeln cmgst
            INTO TABLE itvbuk
            FROM vbuk
            WHERE vbeln IN s_vbeln.
      DELETE itvbuk WHERE  cmgst NE 'B' AND cmgst NE 'C' .
    ENDIF.
    IF NOT itvbuk[] IS INITIAL.
      SELECT *
             FROM vbap
             INTO TABLE itvbap
             FOR ALL ENTRIES IN itvbuk
             WHERE vbeln EQ itvbuk-vbeln.
      DELETE itvbap WHERE vkgru NE '101' AND NOT vstel IN shp_pt.
    ENDIF.
    Like wise modify the logic and check the secondary index is available for the where clause which you will be specifing.
    Regards,
    Madhukar Shetty

  • Fine tuning the logging to cisco device

    Dear Netpro Community,
    I am trying to fine tune the AAA portion on the cisco device
    Here is my current configuration:
    aaa new-model
    aaa authentication login default group radius local
    aaa authentication enable default group radius enable
    If the radius server is offline, the first level is not a problem. However, the issue occurs if I want to go to enable mode. It will not use the enable password defined locally, but instead it will go to and search for radius server for authentication.
    Debug:
    test_switch>en
    Password:
    01:05:15: RADIUS: Authenticating using $enab15$
    01:05:15: RADIUS: ustruct sharecount=1
    01:05:15: RADIUS: Initial Transmit tty0 id 44 x.x.x.x:1812, Access-Request,
    len 72
    01:05:15: Attribute 4 6 AC10E10F
    01:05:15: Attribute 5 6 00000000
    01:05:15: Attribute 61 6 00000000
    01:05:15: Attribute 1 10 24656E61
    01:05:15: Attribute 2 18 69ABFDF8
    01:05:15: Attribute 6 6 00000006
    01:05:20: RADIUS: Retransmit id 44
    01:05:25: RADIUS: Retransmit id 44
    01:05:30: RADIUS: Retransmit id 44
    Password:
    01:05:35: RADIUS: Marking server x.x.x.x:1812,1813 dead
    01:05:35: RADIUS: Tried all servers.
    01:05:35: RADIUS: No valid server found. Trying any viable server
    01:05:35: RADIUS: Tried all servers.
    01:05:35: RADIUS: No response for id 44
    01:05:35: RADIUS: No response from server
    % Password: timeout expired!
    % Error in authentication.
    How do I ensure that i can access the switch in privilege mode if there is no path to the radius server?

    Jagdeep:
    With the default "radius-server retransmit" value, there are (potentially) three retransmissions that may occur if the RADIUS server doesn't respond to the first request. With a 1 sec. "radius-server timeout", this provides a four second window of opportunity for a successful response.
    If he doesn't want to use a "radius-server timeout" as low as 1 sec. (per your concern), he can use the "radius-server retransmit" command to constrain (to a reasonable period) the time required to mark an MIA RADIUS Server as dead.
    e.g.:
    radius-server host aaa.bbb.ccc.ddd auth-port 1812 acct-port 1813 timeout 2 retransmit 1 key xxxxxxxxxx
    Contrary to your statement, your approach and mine are trying to facilitate the same thing, i.e.: accommodating fall back to the enable method prior to login timeout.
    However, your recommendation only results in a successful login after 20+ sec., due to postponement of fall back, resulting from the 20 sec. spent determining that the MIA RADIUS Server is dead.
    I don't ever want to wait 20+ sec. for a login, and don't find it necessary to wait that long to conclude that an AAA server is MIA.

  • FIne Tuning the Cisco Prime Alarms

    HI Expert,
    One of our client having Cisco Wireless LAN infrastructure with Cisco Prime. Currently they are getting more alarms (minor) on their environment.
    They would like to modify the Alarm pattern / threshold to minimise the Alarms pop-up in prime. Could you please advise me how we can modify this ?
    Also do  Cisco having any documents for how to  fine tune ? 
    Thank you.
    -Ananthan

    Hi 
    Here's the document for the customization of alarms.
    Configuring Alarm Severity Levels
    A newly generated alarm has a default severity level that you might want to change.
    To configure an alarm’s severity level, follow these steps:
    Step 1 Choose Administration > System Settings.
    Step 2 From the left sidebar menu, choose Severity Configuration.
    Step 3 Select the check box of the alarm condition whose severity level that you want to change.
    Step 4 From the Configure Security Level drop-down list, choose a severity level, then click Go.
    Step 5 Click OK to confirm the changes.
    Configuring Alarm Severity Levels
    http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/2-2/user/guide/pi_ug/alarms.html#pgfId-1054721
    - Ashok
    Please rate the useful post or mark as correct answer as it will help others looking for similar information

  • Fine-tuning the appearance of JFileChooser

    I have what I hope is a simple question:
    I'm creating a customized JFileChooser. One of the cool things it does is it displays its own custom icons for the files. These icons are a bit bigger than the standard icons for my look-and-feel (Linux default LandF, whatever that is, in Java 1.5). These icons are about 45 pixels high. They look GREAT when viewing in the "icon" view, but when the user switches to the "list" view, they draw on top of eachother. Somehow JFileChooser doesn't know to leave more space.
    Any suggestions on this?
    And the other question, which I'm sure is a FAQ but I can't find it: I also have a file filter on this JFileChooser, and yet it gives the user the option of changing to "view any file type". Is there a way to turn that off? I really want to constrain what my users are doing.
    Thanks

    hi leena,
    Look into these threads...
    https://www.sdn.sap.com/irj/sdn/thread?threadID=119605
    https://www.sdn.sap.com/irj/sdn/thread?threadID=101325
    Also see,
    <a href="https://websmp103.sap-ag.de/~form/sapnet?_SHORTKEY=00200797470000073623&_OBJECT=011000358700001480992005E">this link</a>
    https://media.sdn.sap.com/public/eclasses/bwp04/PortalTuning_files/Default.htm
    Regs,
    jaga
    Message was edited by: jagadeep sampath

  • Fine tuning the database query

    To analyse the load of a particular object. we do use 'performance analysis' in ABAP. But let us suppose we've come to know that more load is on the database. i.e. suppose 80% on database, 20% on Application server. what could be the possible steps that u wud perform on the query so that the load gets decreased. we don't have a chance to transform the load from database to application server (such as using internal tables and hence reducing the load). we should do something on the database side. so what can we do. any solution would be highly appreciated.
    thanks in advance for the solution.

    Hi,
    You should use ST05 and then Switch TRACE ON for SQL.
    Then do your query again.
    After you have run your query, you switch the trace OFF and then you display the trace.
    When displaying the trace you can see which SQL queries that have been made and how long time they have taken (left most column).
    If the time is RED that indicates a bad query.
    Anyway. Doubleclick on the query to find out how the query is made.
    And analyse the table(s) that are used and whether or not an INDEX is used.
    If no index is used you can ADD an index to the database table(s) in transaction SE10. Or directly in the database if you have that possibilty.
    ST05,
    Trace on,
    Run query,
    Trace off,
    Display trace,
    Analyze trace.
    Good luck!
    BR Mattias

  • Few Methods of fine tuning query

    I want to know few methods of fine tuning the query

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/toc.htm

  • How to fine tune the performnce of Adobe - WebDynpro Java

    Hi Experts,
    Upon deploying an Adobe - WebDynpr Java application on my local NWDW machine having 2 GB RAM, it takes around 10 minutes by watch before the PDF form appears on the screen with the populated data.
    This is really depressing as the client will surely not accept this.
    Any tips on fine tuning the performance of Adobe online applications?
    Regards,
    Shobhit

    hi,
    when the J2EE engine is running...
    goto task manager....
    see performance.
    if the memory usage is more than the memory you have installed,
    that means you are using virtual memory...(ie. hard disk as RAM)
    try shutting down any excess processes which you are not using.
    (CAUTION: shut down only those processes which you know)
    Summary is:-
    check if you are on virtual memory.
    because if you are using virtual memory....
    you are falling short of RAM.
    our server also has 2 GB RAM, but it works fine(including Interactive forms)
    regards,
    -ag

  • The cursor on my fourth Gen. iPod Nano isn't working, is this fixable?

    I got my iPod Nano in 2008, shortly after it was first released. About three months after getting it, I lent it to my friend, because she had a thousand songs and atleast 4 dozen CDs. She was going to sync them for me, I got it back two months later and it was pretty banged up. No dents. Just scratches to the paint. I was pretty ******, but it worked fine. So, I didn't think too much of it at the time.
    Two years later, it started to have problems. As it is a fourth gen. it is supposed to change songs when you shake it. I didn't use that feature so often at first, because I had, had a first gen. shuffle and wasn't really comfortable shaking it. But, when I started it changed songs with a fairly light shake. But when it started to experience slight problems, (would randomly change songs when it was sitting perfectly still), it also became harder to change the song by shaking it.
    It eventually took more and more force, until I didn't want to shake it, because it practically took hitting it against the palm of my hand to make it change songs.
    About a year ago, the cursor that lets you change songs and control the volume died. I didn't have any other music player so I got a pair of headphones to control volume and went back to shaking it to change songs, since that still worked. And all that was needed to pause it was to remove the headphones.
    Now, everything works fine besides the cursor, and I was wondering if that is a problem that could be easily fixed, if it is a problem that can't be fixed or if it is a problem that CAN be fixed but costs about as much as just replacing it.

    Try the standard fixes:
    - Reset:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Restore the iPod from backup via iTunes on yur computer
    - Restore the iPod to factory defaults/new iPod.

  • To extend a clip I have `Show Fine Tuning controls' turned on in my iMovie 11 preferences, but the blue forward/backward buttons don't appear.  To get the orange handle bar, is there a hotkey?

    To extend a clip I have `Show Fine Tuning controls' turned on in my iMovie 11 preferences, but the blue forward/backward buttons don't appear.  To get the orange handle bar, is there a hotkey?

    That's a comment in the file. It has no effect at all.

  • Small fine tuning is required in the calculation

    Hi Gurus,
       BI PM module for the report Schedule attainment filtered for one order.
    The result supposed to be Total job scheduled = 1, completed orders = 1 and No of orders completed on Schedule = 0. However, the report shows, Total job scheduled = 7, completed orders = 1 and No of orders completed on Schedule = 0.
       By this what happens is that total jobs scheduled become 930 for Plant = 2200, Planner Group = P01, Order Type = PM03 while Completed orders and Completed orders on Schedule is correct.
        ie Formulae in update routine IF( IS_INITIAL( /BIC/ZIBFDCH ), 1, 0 ).
        Please tell the small fine tuning in the calculation, points will be assigned.
    Regards,
    Kiran A

    Answer Finded

  • FF was running fine. My cursor jumped out of the text box while i was typing and now no text box on FF will let me type in it? Help!

    Basically as above, i opened a new tab to search for an article and as i was typing the cursor jumped out of the box without my realising. I placed the cursor back in the box and started but no characters appeared. I tried the URL bar and again nothing. I opened Chrome and it worked fine so clearly something ive managed to do but i have no idea what!
    I didn't use any shift, alt or ctrl buttons accidentally. I have tried shutting FF down and reopening but nothing.
    Can anyone help please?
    As an addition, why does the cursor jump out like that?
    Thanks

    Hello darrendons, try disabling graphics '''hardware acceleration'''. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Did this fix your problems? Please report back to us!
    Thank you.

  • Latest batch of RAW files has all the raw fine tuning options greyed out

    I shoot about 1000 images a week with my 40d and edit/organize all of them in Aperture... the latest batch (a pretty important batch at that) of 800 or so imported fine but does not allow me to use the 'Raw Fine Tuning' options as if they are JPGs. I can still go to the images i imported last week and the RAW fine tuning works fine, even some in the same album... any ideas?
    Aperture 1.5.6

    more informaion:
    today's images imported fine, so you can rule out the security patch.
    even more peculiar i exported some of the images, and imported the same masters back in and much to my suprise the RAW fine tuning works. I rebuilt the library hoping that would help but it didn't, I'm just going to go back through the library and re-tag and rate my picks from the shoot, but any idea on how to keep this from happening again? it has to be some wacky setting or something, I can export the broken image and the import it again and it works fine.
    any help would be appreciated
    mark

Maybe you are looking for

  • IPhoto 11 crashing at start-up after importing photos to Photostream

    Hi I started to import photos to Photostream and iPhoto crashed. It then crashed continually at start-up. I followed the advice here: https://discussions.apple.com/message/16364442#16364442 and iPhoto stayed open long enough for it to recognose my ca

  • Composite primary key and performance

    Hi I have a table with 110 columns.And PK for that table is a combination of 7 keys . We need to schedule a daily job which will insert/update the table .Daily on a average( estimate) we have around 100000 insertion and same number of updates on the

  • Tabular Report problem

    Hi There, I have a report with 22 coulmns it is Tabular report how can adjust the 22 columns in my report. I have only one group. Please advice. Thanks, Zee

  • Autolocked my iphone 5

    Hi i was purchased iphone 5 in United Kingdom, not locked and sim free full price, but i don`t know why my iphone autolocked to AT&T USA How i can unlock my iPhone5? Now i can`t use sim card anyone Please help me

  • Mavericks Kernel Panic/Crash. Any solution?

    I have a MacBook Pro, 2009, i upgraded to Mav and now i get sudden reboots "due to a problem" with a gray screen and the "your mac has been restarted due to a problem" message in several languages. And it happens often. Online it's said it's Kernel P