Problem with my select statement

Dear buddies,
Really seeking someone to guide me in this sql issue.
Here is the scenario.
- should check for the number of prospects(to be customers) downloaded from a file for every dealer based on the
region
description about columns shown
1st column, region
2nd column, dealer code
3rd column, number of prospect received
4th column, the percentage of conversion
5th column, i must order by the 4th column and select the top 20 percentage and take its average.
sample data
region dealer_code no. of no of % of % of Comparing with
prospect prospect prospect Top 20 top 20 conversion
received converted conversion Conversion
A     dealer 1     150     50     33%     56%     Red
     dealer 2     100     40     40%     56%     Red
     dealer 3     120     60     50%     56%     Red
          130     70     54%     56%     Red
          200     20     10%     56%     Red
B          140     60     43%     56%     Red
          110     60     55%     56%     Red
          100     60     60%     56%     Green
          130     69     53%     56%     Red
          140     75     54%     56%     Red
D          110     40     36%     56%     Red
          100     30     30%     56%     Red
          140     74     53%     56%     Red
          100     70     70%     56%     Green
          110     65     59%     56%     Green
E          130     85     65%     56%     Green
          150     65     43%     56%     Red
          150     70     47%     56%     Red
          160     95     59%     56%     Green
          170     100     59%     56%     Green
F          200     150     75%     56%     Green
          100     65     65%     56%     Green
          120     40     33%     56%     Red
          140     80     57%     56%     Green
          150     85     57%     56%     Green
Legend (for the sample data)
when % of prospect conversion > % of top 20 conversion, then green
when % of prospect conversion = % of top 20 conversion, then yellow
when % of prospect conversion < % of top 20 conversion, then red
NOTE
i have a few more columns after this, but if i know how to fix these columns, i can manage them too.
here is my sql
select a.dealer_region,
         a.dealer_code,
         count(b.id) as  "No of Prospect Received",
         COUNT (case when b.id in (select d.id
                                               from contact_details d
                                               where d.contact_result ='04'
                                               and d.dealer_code = c.dealer_code)
                            then b.id end) "No of Prospect Converted to Booking",
       (COUNT (case when  b.id in (select d.id
                                                from contact_details d
                                                where d.contact_result ='04'
                                                and d.dealer_code = c.dealer_code)
                            then b.id end)
                     / (count(b.id))*100 || '%')"%of Prospect Conversion" ,    
       ((COUNT (case when  b.id in (select d.id
                                                 from contact_details d
                                                 where d.contact_result ='04'
                                                 and d.dealer_code = c.dealer_code
                                                 and rownum <20)
                            then b.id end)
                                                   /20 )* 100 || '%')"% Top 20 Conversion",  
                                /*(avg((COUNT (case when  b.id in (select d.id
                                                                                   from contact_details d
                                                                                   where d.contact_result ='04'
                                                                                   and d.dealer_code = c.dealer_code)
                                                               then b.id end)
                                                                                / (count(b.id))*100 || '%'))
        (case when((COUNT (case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='04'
                                           and d.dealer_code = c.dealer_code
                                           and rownum <20)
                   then b.id end)
                            / 20 )* 100) > ((count(case when  b.id in (select d.id
                                                                                                                   from contact_details d
                                                                                                                   where d.contact_result ='04'
                                                                                                                  and d.dealer_code = c.dealer_code
                                                                                                                  and rownum <20)
                                                                                               then b.id end)
                                                                                                                   / 20 )* 100)
                        then 'Green'     
          when((COUNT (case when  b.id in (select d.id
                                                            from contact_details d
                                                            where d.contact_result ='04'
                                                            and d.dealer_code = c.dealer_code
                                                            and rownum <20)
                                       then b.id end)
                                                 / 20 )* 100) = ((count(case when b.id in (select d.id
                                                                                                                                     from contact_details d
                                                                                                                           where d.contact_result ='04'
                                                                                                                  and d.dealer_code = c.dealer_code
                                                                                                                                         and rownum <5)
                                                                                                              then b.id end)
                                                                                                                       / 20 )* 100)
       then 'Yellow'
       else
       'Red'
        end) "Comparison with Top 20 Convers",
/* i can handle this part if the sql given above  is solved */
        COUNT (case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='05'
                                           and d.dealer_code = c.dealer_code)
                    then b.id end) "#of Lead ConvertedC",
       (COUNT (case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='05'
                                           and d.dealer_code = c.dealer_code)
                   then b.id end)
           / (count(b.id))*100 || '%')"%of Lead ConversionC",
       ((COUNT (case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='05'
                                           and d.dealer_code = c.dealer_code
                                           and rownum <21)
                   then b.id end)
           / 20 )* 100 || '%')"% Top 20 ConversionC",
      /*  (avg((COUNT (case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='04'
                                           and d.dealer_code = c.dealer_code)
                   then b.id end)
           / (count(b.id))*100 || '%'))
        (case when((COUNT (case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='05'
                                           and d.dealer_code = c.dealer_code
                                           and rownum <21)
                   then b.id end)
           / 20 )* 100) > ((count(case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='05'
                                           and d.dealer_code = c.dealer_code
                                           and rownum <21)
                                           then b.id end)
                                           / 20 )* 100)
       then 'Green'    
       when((COUNT (case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='05'
                                           and d.dealer_code = c.dealer_code
                                           and rownum <21)
                   then b.id end)
           / 20 )* 100) = ((count(case when  b.id in (select d.id
                                           from contact_details d
                                           where d.contact_result ='05'
                                           and d.dealer_code = c.dealer_code
                                           and rownum <21)
                                           then b.id end)
                                           / 20 )* 100)
       then 'Yellow'
       else
       'Red'
        end) "Comparison with Top 20 ConverC"                                                                              
from dealers a, prospect_list b, files c, marketing_details e, customer f
where b.file_id = c.file_uid
and c.dealer_code = a.dealer_code
and b.id = e.id
and e.id = f.id
group by a.dealer_region, a.dealer_code; hope someone can help me out.
i actually can change the count(d.dealer_code) to 20 and solve the problem but what if they are less than 20 dealers in the table?
because the table will be refreshed every morning with new data and the unnecessary one will be removed.
it works fine now when i divide it by 20.
pls advice
thanks
alagu
Edited by: user645399 on Jul 1, 2009 7:49 PM
Edited by: user645399 on Jul 1, 2009 7:56 PM
Edited by: user645399 on Jul 1, 2009 8:14 PM
Edited by: user645399 on Jul 1, 2009 10:20 PM

Hope this helps. First rank all the rows. Then find the average for the top3 using CASE statement
LPALANI@l11gr2>select ename, sal, dense_rank() over (order by sal desc) dr,
  2  avg(sal) over() avg_sal_all
  3  from scott.emp;
ENAME                   SAL               DR      AVG_SAL_ALL
KING                  5,000                1            2,073
FORD                  3,000                2            2,073
SCOTT                 3,000                2            2,073
JONES                 2,975                3            2,073
BLAKE                 2,850                4            2,073
CLARK                 2,450                5            2,073
ALLEN                 1,600                6            2,073
TURNER                1,500                7            2,073
MILLER                1,300                8            2,073
WARD                  1,250                9            2,073
MARTIN                1,250                9            2,073
ADAMS                 1,100               10            2,073
JAMES                   950               11            2,073
SMITH                   800               12            2,073
14 rows selected.
LPALANI@l11gr2>
LPALANI@l11gr2>select ename, sal,
  2  avg(case when dr <=3 then sal end) over () avg_sal_top,
  3  count(case when dr <=3 then 1 end) over() cnt_of_top3_earners,
  4  avg_sal_all,
  5  dr
  6  from (select ename, sal, dense_rank() over (order by sal desc) dr, avg(sal) over() avg_sal_all from scott.emp);
ENAME                   SAL      AVG_SAL_TOP CNT_OF_TOP3_EARNERS      AVG_SAL_ALL               DR
KING                  5,000            3,494                   4            2,073                1
FORD                  3,000            3,494                   4            2,073                2
SCOTT                 3,000            3,494                   4            2,073                2
JONES                 2,975            3,494                   4            2,073                3
BLAKE                 2,850            3,494                   4            2,073                4
CLARK                 2,450            3,494                   4            2,073                5
ALLEN                 1,600            3,494                   4            2,073                6
TURNER                1,500            3,494                   4            2,073                7
MILLER                1,300            3,494                   4            2,073                8
WARD                  1,250            3,494                   4            2,073                9
MARTIN                1,250            3,494                   4            2,073                9
ADAMS                 1,100            3,494                   4            2,073               10
JAMES                   950            3,494                   4            2,073               11
SMITH                   800            3,494                   4            2,073               12

Similar Messages

  • I refurbished my macbook air 7 months ago because there was a problem with the steady state drive. Now my battery seems to be dead again. How long does the warranty last? Do I need to pay for a new battery?

    I refurbished my macbook air 7 months ago because there was a problem with the steady state drive. Now my battery seems to be dead again. How long does the warranty last? Do I need to pay for a new battery?

    As I wrote Apple will diagnose an Apple product even if it is out of warranty for free. That should be your first step to find out if the problem is the battery or something else.
    Once you have Apple telling you a 7 month old battery is defective (if that turns out to be the case)  then it becomes a game of horse trading. You'll need to speak to the tech and when he tells you there is nothing he can do you will need to speak to the tech manager and when she says most likely there is nothing they can do you go to the store manager, etc.  It is unlikely (though possible) that they will give in easily you need to be firm, polite and let on that you're willing to accept a partial reimbursement.
    So again the first step is to find out what is wrong.
    good luck

  • Smart scan not working with Insert Select statements

    We have observed that smart scan is not working with insert select statements but works when select statements are execute alone.
    Can you please help us to explain this behavior?

    There is a specific exadata forum - you would do better to post the question there: Exadata
    I can't give you a definitive answer, but it's possible that this is simply a known limitation similar to the way that "Create table as select" won't run the select statement the same way as the basic select if it involves a distributed query.
    Regards
    Jonathan Lewis

  • Update with a select statement

    hi experts,
    I need some help again.. :)
    I have an insert query here with a select statement.. Juz wondering how to do it in update?
    insert into newsmail_recipient
            (IP_RECIPIENTID,NF_LISTID,NF_STATUSID,D_CREATED,D_MODIFIED,C_NAME,C_EMAIL,USER_ID,NEWSMAIL_ID)
            select newsmail_recipientid_seq.nextval
              , liste
              , 1
              , sysdate
              , sysdate
              , null
              , null
              , ru.nf_userid
              , null
            from roleuser ru, unit u, userinfo ui
            where u.ip_unitid = ru.nf_unitid
            and u.ip_unitid = unit_id
            and ui.ip_userid = ru.nf_userid
            and ui.nf_statusid = 1
            and n_internal = 0
            and ui.ip_userid not in (select user_id
                                       from newsmail_recipient
                                      where user_id = ui.ip_userid
                                        and nf_listid = liste
                                        and nf_statusid = 1);let me know your thoughts.
    Regards,
    jp

    Hi,
    924864 wrote:
    ... I have an insert query here with a select statement.. Juz wondering how to do it in update?How to do what, exactly?
    MERGE can UPDATE existing rows, and INSERT new rows at the same time. In a MERGE statement, you give a table or a sub-query in the USING clause, and define how rows from that result set match rows in your destination table. If rows match, then you can UPDATE the matching row with values from the sub-query.
    Very often, MERGE is easier to use, and perhaps more efficient, than UPDATE just for changing existing rows. That is, while MERGE can do both INSERT and UPDATE, it doesn't have to . You can tell MERGE just to do one or the other if you wish.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Since you're asking about a DML statement, such as UPDATE, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Specific problem with buttons and states

    Hello,
    I first apologize for using Google Translate :-(
    I have a problem with InDesign not solve. It is for a digital publication.
    My goal is:
    A 'gallery' button is pressed and the ball image appears with three buttons: "Previous image", "Next image" and "close gallery".
    I do not want the gallery to be visible, or buttons that control, until the button is pressed "gallery", so I think all buttons except "gallery" with the "hidden until activated" option selected.
    I want the gallery, and buttons that control it, disappears when I press the button "close gallery".
    What I call "Gallery" is an image that fills the screen.
    After placing the image on your site have become the property button "Hidden until activated."
    Then convert this button in order to several states (what I will call "button states") and by the successive states with the images I want to show in the gallery.
    I think the interactions of the buttons.
    When button "gallery" I assign the following "I click the"
    - "Go to state"
    - Hide "gallery"
    - Show "close gallery"
    - Show "previous picture"
    - Show "next image"
    - Show "button states."
    The buttons "Previous Image" and "Next Image" are assigned, respectively, to go to previous state and go to the next state.
    When button "close gallery" I assign the following "I click the"
    - Show "gallery"
    - Hide "close gallery"
    - Hide "previous picture"
    - Hide "next image"
    - Show "button states."
    The buttons "Previous Image" and "Next Image" are assigned, respectively, to go to previous state and go to the next state.
    When button "close gallery" I assign the following "I click the"
    - Show "gallery"
    - Hide "close gallery"
    - Hide "previous picture"
    - Hide "next image"
    - Hide "button states."
    I put it up and working properly until I press "close gallery". Then I hide the buttons "close gallery", "previous image" and "next picture" but it keeps me visible "button states" showing the last image that was shown.
    Do not know how to fix this and I'm going crazy!
    Please can anyone help me?
    The solution may be another approach but without using "Folio Overlays".
    Thank you very much.

    I've moved your post to the DPS forum.
    I'm afraid the way you're doing this is not going to work with DPS.
    This should all be done with a multi state object. The first state would contain nothing but a button to go to the first state. After that set up each state with the proper buttons. Without seeing the file it's a bit difficult for me to envision exactly what you want to do.

  • Problem with the selection screen in submit program

    Hi Friends,
    i am facing the problem wih the selection screen in submit program. in my Module pool program i am using the submit program statement, When i execute the program , The module program display the submit program selections creen.
    I have implemented the code same as below.
    submit ztest with tknum =p_tknum and  return.
    Can you pleaes help me how to avoid the submit program selection screen.
    Thanks,
    Charan

    Hi Charan,
    You have to give the selection screen values when you submit a job.
    Press F1 on submit and you will see more details.
    Here is an example from ABAP Documentation.
    Program accessed
    REPORT report1.
    DATA text(10) TYPE c.
    SELECTION-SCREEN BEGIN OF SCREEN 1100.
      SELECT-OPTIONS: selcrit1 FOR text,
                      selcrit2 FOR text.
    SELECTION-SCREEN END OF SCREEN 1100.
    Calling program
    REPORT report2.
         DATA: text(10)   TYPE c,
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
          range_tab  LIKE RANGE OF text,
          range_line LIKE LINE OF range_tab.
    rspar_line-selname = 'SELCRIT1'.
    rspar_line-kind    = 'S'.
    rspar_line-sign    = 'I'.
    rspar_line-option  = 'EQ'.
    rspar_line-low     = 'ABAP'.
    APPEND rspar_line TO rspar_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'H'.
    APPEND range_line TO range_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'K'.
    APPEND range_line TO range_tab.
    SUBMIT report1 USING SELECTION-SCREEN '1100'
                   WITH SELECTION-TABLE rspar_tab
                   WITH selcrit2 BETWEEN 'H' AND 'K'
                   WITH selcrit2 IN range_tab
                   AND RETURN.
    Regards,
    Jovito.

  • Big problem with a select using remote database

    Hi Guy.
    I have a big problem with a simple query, but this is a scenario.
    Actuallly I'm in Alexandria - Egypt with a server with Oracle 10.2.0.4 database 32 bit on linux Red Hat as 4.8. the server can connect to another database oracle but 9.2.0.6 installed on Red Hat As 4.5 placed in Milano Italy . Ttwo networks are connected via two adsl cisco router with firewall and Vpn functions. In Egypt there isn't a very good adsl.
    In Alexandria, I'm trying to connect to database in Italy with sqlplus. The sqlplus connected I write.. select * from addetti and all work fine.
    My problem is that when I try to make the same select on a table with many columns oracle database kill me a session.
    My table (ic_lav) is long 174 colums 1924 byte for row. Well when I write a query with select * from ic_lav all oracle close my session.
    So I began to change my query I start to
    select field1 from ic_lav... and work
    select field1,field2,field3,..........field50 from ic_lav and work
    select field1,field2,field3,..........field70 from ic_lav and doesn't work
    the select work with 68 columns
    problem: the query with more then 1064 byte for row doesn't work.
    I've tryed with anoter big table with the same problem, but the select fwork with 65 columns...
    Iit is obvious that there is any problem with the limit of the query.
    The same query (select * from ic_lav) in localMilano)l work fine.
    The same query (select * from ic_lav) in vpn with a better adsl line and openvpn software (NO CISCO firewall) WORK FINE.
    The same query connectetd in Milano with a vpn make with analogic modem and remote access by windows work fine.
    the query (make on my laptop connectet with vpn by cisco doesn't work.
    In cisco firewall we haven't any error (cisco man tell me so)
    on database 9 I found :
    *** 2009-06-12 09:49:45.509
    *** SESSION ID:(66.44406) 2009-06-12 09:49:45.497
    FATAL ERROR IN TWO-TASK SERVER: error = 12152
    *** 2009-06-12 09:49:45.509
    ksedmp: internal or fatal error
    Current SQL statement for this session:
    select * from ic_lis where ditta
    ----- Call Stack Trace -----
    but I don't understand why the lost connection problem (bug 3816595 A processstate dump is produced for a lost connection (12152) ) is caused by len of row
    Anybody have some idea ?
    Thank you

    My table (ic_lav) is long 174 colums 1924 byte for row. Well when I write a query with select * from ic_lav all oracle close my session.Do you get any error?
    If the query length is a problem, you could create a view and query the view instead to see if this problem is resolved.

  • Help needed with a SELECT statement. How can I make it run faster?

    Hi,
    not sure if my brain is just too tired but I can't seem to crack this problem today.
    Here is my scenario.
    I have 2 tables
    TABLE1 (searchId INTEGER, routeId INTEGER);
    TABLE2 (routeId INTEGER, cityId INTEGER);
    There are indexes on all 4 columns.
    (routeId on TABLE1 is a primary key).
    In the data I am using, a given search has more than 500 routes, each route has between 10 and 300 cities among more than 4000 possible different cities.
    Now, what I want to create is the list of route couple, within a certain search, that do not have a single city in common.
    That list should populate a table with the following structure
    TABLE3 (searchId INTEGER, routeId1 INTEGER, routeId2 INTEGER)
    Here is the fastest select statement I have found so far.
    SELECT :searchId, t1.routeId, t2.routeId FROM table1 t1, table1 t2
    WHERE t1.searchId=:searchId AND t2.searchId=:searchId
    AND t1.routeId>t2.routeId
    AND NOT EXISTS (
    SELECT cityId FROM table2
    WHERE routeId=t1.routeId
    INTERSECT
    SELECT cityId FROM table2
    WHERE routeId=t2.routeId);
    But it still seem really slow to me.
    Any suggestion for an improved version is welcome.
    Thanks,
    Martin.
    Title was edited by:
    user453358

    I originaly posted this thread because I tought I was missing something "obvious" that would perform better that would make my SELECT statement perform better.
    So I did not want to go as deep as using TKPROOF yet.
    Here is the statistics I gets on my statement.
      1   SELECT t1.searchId,t1.routeId, t2.routeId id2
      2      FROM table1 t1, table1 t2
      3     WHERE t1.searchid=t2.searchid
      4      AND t1.searchId=91
      5      AND t1.routeId>t2.routeId
      6      AND NOT EXISTS (
      7             SELECT cityId FROM table2
      8              WHERE routeId=t1.routeId
      9             INTERSECT
    10             SELECT cityId FROM table2
    11*            WHERE routeId=t2.routeId)
    SQL> /
    43302 rows.
    Tidsåtgång: 00:01:55.02
    Körschema
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=9 Card=1 Bytes=14)         
       1    0   FILTER                                                             
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'table1' (TABLE) (Cost=1 Card=1 Bytes=7)                                                
       3    2       NESTED LOOPS (Cost=3 Card=1 Bytes=14)                          
       4    3         TABLE ACCESS (BY INDEX ROWID) OF 'table1' (TABLE) (Cost=2 Card=1 Bytes=7)
       5    4           INDEX (RANGE SCAN) OF 'table1_IDX1' (INDEX) (Cost=1 Card=1)                                                    
       6    3         INDEX (RANGE SCAN) OF 'table1_IDX1' (INDEX) (Cost=0 Card=1)                                                      
       7    1     INTERSECTION                                                     
       8    7       SORT (UNIQUE) (Cost=3 Card=108 Bytes=864)                      
       9    8         TABLE ACCESS (BY INDEX ROWID) OF 'table2' (TABLE) (Cost=2 Card=108 Bytes=864)                                 
      10    9           INDEX (RANGE SCAN) OF 'table2_IDX1' (INDEX) (Cost=1 Card=108)                                               
      11    7       SORT (UNIQUE) (Cost=3 Card=108 Bytes=864)                      
      12   11         TABLE ACCESS (BY INDEX ROWID) OF 'table2' (TABLE) (Cost=2 Card=108 Bytes=864)                                 
      13   12           INDEX (RANGE SCAN) OF 'table2_IDX1' (INDEX) (Cost=1 Card=108)                                               
    Statistik
              1  recursive calls                                                   
              0  db block gets                                                     
        2872765  consistent gets                                                   
              0  physical reads                                                    
            812  redo size                                                         
         964172  bytes sent via SQL*Net to client                                  
          32245  bytes received via SQL*Net from client                            
           2888  SQL*Net roundtrips to/from client                                 
         860256  sorts (memory)                                                    
              0  sorts (disk)                                                      
          43302  rows processed  Looks like a big number of consistent gets! Any idea how to improve on that?
    Martin.

  • Problems with the selection of text or objects

    dear fireworks community!
    unfortunately i have problems with my running version fireworks (CS6) and i can't find any solution or even get help via the customer support.
    i can't switch between objects with a click, when i've choosen one already. i also can't cancel the entire selection. the only way (to select a new item) is to click on an empty space, hold it and pull the selection over a new item.
    another thing is that i cant select a textfield with a doubleclick or switch beteween choosen tools within the usage of a shortcut …
    what i already tried:
    updating, deinstalling, re-storing preferences, "cleaning" the libraries, installing (this entire scenario for at least three times)
    i hope someone of you can help me!
    thanks in advance!

    incredible!
    thank you so much!

  • Problem with the FOR statement.....again!

    Hi everyone,
    Well I'm still trying to do a car slideshow using external
    files and can't seem to see the end. The current movie is here:
    http://www.virtuallglab.com/projects.html
    I also attach the code. My problem is I had originally set up
    an animation with 2 pictures sliding in with some text, and then
    wait 4 seconds before sliding out, and then next pictures and text
    would slide in and so on, using a setInterval.
    The problem is the FOR loop seems to skip the setInterval and
    the function "wait", so it just loops quickly and jumps to last
    picture, so on the example above, it just slides the last picture
    (i=9) and that's it!
    Can you not include another function within a FOR statement.
    Or is there a way to tell the FOR loop to wait until all motion is
    finished?
    Any help greatly appreciated
    import mx.transitions.*;
    import mx.transitions.easing.*;
    for (i=0; i<10 ; i++) {
    var picLeft = "pics/"+i+".jpg";
    var picRight = "pics/"+i+"b.jpg";
    var txtToLoad = "text/"+i+".txt";
    this.createEmptyMovieClip("leftHolder",1);
    leftHolder.loadMovie(picLeft,i,leftHolder.getNextHighestDepth());
    leftHolder._x = -200;
    leftHolder._y = 15;
    var leftTween:Tween = new Tween(leftHolder, "_x",
    Strong.easeOut, leftHolder._x, 10, 2, true);
    this.createEmptyMovieClip("centerHolder",2);
    centerHolder.loadMovie(picRight,i+"b",centerHolder.getNextHighestDepth());
    centerHolder._x = 180;
    centerHolder._y = 250;
    var centerTween:Tween = new Tween(centerHolder, "_y",
    Strong.easeOut, centerHolder._y, 15, 2, true);
    text._x = 600;
    myData = new LoadVars();
    myData.onLoad = function(){
    text.carText.text = this.content;
    myData.load(txtToLoad);
    var textTween:Tween = new Tween(text, "_x", Strong.easeOut,
    text._x, 420, 2, true);
    myInterval = setInterval(wait, 4000);
    function wait() {
    var leftTweenFinished:Tween = new Tween(leftHolder, "_x",
    Strong.easeOut, leftHolder._x, -200, 1, true);
    var centerTween:Tween = new Tween(centerHolder, "_y",
    Strong.easeOut, centerHolder._y, 250, 1, true);
    var textTween2:Tween = new Tween(text, "_x", Strong.easeOut,
    text._x, 600, 1, true);
    clearInterval(myInterval);
    ***************************************************************************************** ***

    There is no way to tell a for loop to wait. That is not what
    they do.
    The entire for loop will execute (if possible, and it doesn't
    enter some kind of continuous infinite loop) completely before each
    time the frame is rendered.
    If you want to spread things out over time you need to use
    the setInterval -- but not inside a for loop! If you do that you
    immediately set however many intervals as your loop has. In this
    case you will also assign the ids for those intervals to the same
    variable, effectively overwriting the value so you will never be
    able to clear most of those intervals.
    So you need to rethink you whole structure. Set up some kind
    of counter and limit like this:
    var slidesToShow:Number=10;
    var curSlide:Number=0;
    Then have your setInterval increment the curSlide each time
    it is called and check to see if it has shown all of them. That is
    where your "loop" comes in.
    As for the other part of your question -- yes you actually
    have two different issues going on -- again you cannot make a for
    loop wait for anything. So no there is no way to pause it while you
    wait for your tween to end. But you can be notified when a tween
    ends.
    Check out the documentation about the tween class in the help
    files. There you will find the onMotionFinished event. So you can
    set up one of those to start whatever needs to be started when the
    tween has finished.
    You should also use the MovieClipLoader class to load your
    images, because you have no idea how long it will take to load
    them. Using that class you get a nice event (onLoadInit) that tells
    you when the asset is ready to be used.
    Finally I'm thinking you might want to use setTimeout instead
    of setInterval. It only goes once, while setInterval repeats
    forever. So I would think your algorithm would be something like
    this.
    1. load external asset
    2. when ready animate in and set onMotionFinished handler
    3. when motion is finished start loading next asset and
    setTimeout for 4 seconds.
    4. when 4 seconds is up or the clip is loaded (which ever
    takes longer) go to 2 and repeat.
    If this is going to be run locally on a hard drive or CD you
    won't have any problem with the length of time it takes to load the
    external assets, but if it is over the web it will take time.

  • Short dump with a select statement

    I have the following select statement (I have also inluded my data statement(s)) and I get a short dump.  The error is as follows:
    <b>What happened?                                                                 
        Error in ABAP application program.                                                                               
    The current ABAP program "ZPARTNER" had to be terminated because one of the
        statements could not be executed.                                                                               
    This is probably due to an error in the ABAP program.                                                                               
    Following a SELECT statement, the data read could not be placed in AN      
        the output area.                                                           
        A conversion may have been intended that is not supported by the           
        system, or the output area may be too small.                                                                               
    Error analysis                                                                 
        An exception occurred. This exception will be dealt with in more detail    
        below. The exception, assigned to the class 'CX_SY_OPEN_SQL_DB', was not   
         caught, which                                                             
         led to a runtime error. The reason for this exception is:                 
        The data read during a SELECT access could not be inserted into the        
        target field.                                                              
        Either conversion is not supported for the target field's type or the      
        target field is too short to accept the value or the data are not in a     
        form that the target field can accept          </b>                            
    it_adrc TYPE TABLE OF adrc,
          wa_adrc LIKE LINE OF it_adrc,
    SELECT addrnumber name1 street city1 region post_code1 tel_number
      FROM adrc INTO TABLE it_adrc
      FOR ALL ENTRIES IN it_detail
      WHERE addrnumber = it_detail-adrnr.
    Regards,
    Davis

    If you only need the fields mentioned in the select query, then follow this:
    TYPES: BEGIN OF ADRC_TYPE,
         ADDRNUMBER LIKE ADRC-ADDRNUMBER,
         NAME1        LIKE ADRC-NAME1,
         STREET        LIKE ADRC-STREET,
         CITY        LIKE ADRC-CITY,
         REGION        LIKE ADRC-REGION,
         POST_CODE1 LIKE ADRC-POST_CODE1,
         TEL_NUMBER LIKE ADRC-TEL_NUMBER,
           END OF ADRC_TYPE,
           ADRC_T_TYPE TYPE TABLE OF ADRC_TYPE.
    DATA: IT_ADRC TYPE ADRC_T_TYPE WITH HEADER LINE.
    IF NOT IT_DETAIL[] IS INITIAL.
    SELECT addrnumber name1 street city1 region post_code1 tel_number
      FROM adrc INTO TABLE it_adrc
      FOR ALL ENTRIES IN it_detail
      WHERE addrnumber = it_detail-adrnr.
    ENDIF.
    Thanks,
    SKJ

  • Problem with column selection in GUI_DOWLOAD

    Hi everyone !
    I want to save data from an internal table to a DAT file using GUI_DOWLOAD. In this internal table, there are 2 colums that won't be downloaded so I call the FM this way :
        CALL FUNCTION 'GUI_DOWNLOAD'
             EXPORTING
                  FILENAME                = L_FILE
                  FILETYPE                = 'DAT'
                  COL_SELECT              = 'X'
                  COL_SELECT_MASK          = V_COLSELECT
             TABLES
                  DATA_TAB                = TAB_OUT
                  FIELDNAMES              = TAB_FIELDNAMES.
    V_COLSELECT contains an 'X' for each column I need to be downloaded and a space for the 2 other columns.
    In the result file, the columns that I didn't select don't appear BUT there are 2 columns with no header and filled with zeros at the right edge of the file. I don't know where these 2 columns come from. Maybe a problem with fieldnames but I'm not sure (in TAB_OUT, all columns are present but in TAB_FIELDNAMES there are only headers for the selected columns).
    If anybody have an idea, please just tell me.
    Points will be rewarded for helpful answers.
    Thanks.
    Nicolas.

    Hi,
    Try to keep fields same in TAB_FIELDNAMES and TAB_OUT. because anyway you are using COL_SELECT_MASK.
    I think you are using COL_SELECT_MASK properly ie
    if you have 6 field in the TAB_OUT out of that you need to donwload 1,3,6 then your
    COL_SELECT_MASK will be X X  X
    aRs

  • Problem with variable selections

    Hi All
        I am executing the report with period 46.2007-50.2007 . I am getting the result for this period.But if i run the report with same selections from 42.2007-50.2007, I am not getting the data.It says no applicable data found.
    I am using interval as the option for variable .Could some one help on this?
    Thanks
    Raghu N

    Hello
    According to your selection you should get the data.
    check the both selection (46 - 50) and (42 - 50) in the LISTCUBE transaction.
    if data available in both cases then problem may be with other restrictions.
    If no user exits are in that variable try create one more variable as it is and then try by restricting with new variable.

  • Problem with Binary search statement

    Hi,
    I have problem with reading the internal with Binary search.
    I have two internal tables BSAS and BSIS. In BSAS I have 1,200,000 line items and BSIS 500,000 line items. I need to delete the line items if BSIS-BELNR NE BSAS-AUGBL.
    I am using the following code :
        LOOP AT gt_bsas .
          READ TABLE gt_bsis WITH KEY bukrs = gt_bsas-bukrs
                                      belnr = gt_bsas-augbl
                                      gjahr = gt_bsas-gjahr.
          IF sy-subrc NE 0.
            DELETE gt_bsas.
            CLEAR  gt_bsas.
          ELSE.
         endif.
    endloop.
    By this execution of the loop is taking long time. If I use the binary search it is fast but result is not correct.
    Please suggest me, how to resolve this issue.
    Thanks,
    Sri.

    Try this way:
    LOOP AT gt_bsas .
    <b>SORT GT_BSIS BY BUKRS BELNR GJAHR.</b>
    READ TABLE gt_bsis WITH KEY bukrs = gt_bsas-bukrs
    belnr = gt_bsas-augbl
    gjahr = gt_bsas-gjahr
    <b>BINARY SEARCH.</b>
    <b>IF sy-subrc eq 0.</b>
    ****Do Nothing.
    ELSE.
    <b>DELETE gt_bsas sy-tabix.</b>
    CLEAR gt_bsas.
    endif.
    endloop.
    1. Also make sure that the KEY mentioned in READ statement follows the same seqeunce of gt_bsis structure.
    Thanks,
    Santosh
    Message was edited by:
            SKJ

  • Problem in jdbc select statement

    {{  public List dis(int getmodified,int getindex){
    List outerList=null;
    outerList=new ArrayList();
    List display=null;
    try{
         System.out.println("testing.....3");
    con=getconnection();
    pstmt= con.prepareStatement("SELECT title from newss where nno >(10*(?)) and nno <=(10*?)");
         pstmt.setInt(1,getmodified);
         pstmt.setInt(2,getindex);
         System.out.println("testing.....2");
         //pstmt.setInt(1,pgno);
    rs=pstmt.executeQuery();
              while(rs.next())
                   display=new ArrayList();
                   display.add(rs.getString(1));
                   System.out.println("###########################" +rs.getString(1));
                   System.out.println("(((((((((((())))))))))" +display);
                   outerList.add(display);
    }catch(Exception e){
    System.out.println ("exception in select statement" +e.getMessage());
         System.out.println("*************" +outerList);
    return outerList;
    my problem is it says exception in select statement and no data found
    can someone resolve my problem}

    Check the below code snippet this what my fellow poster meant.check whether the proposed works well or not.
    public List dis(int getmodified,int getindex){
        List outerList = new ArrayList();
        List display=null;
         try{
              System.out.println("testing.....3");
              con = getconnection();
              pstmt = con.prepareStatement("SELECT title from newss where nno > ? and nno <= ?");
              pstmt.setInt(1,10*getmodified);
              pstmt.setInt(2,10*getindex);
              System.out.println("testing.....2");
              rs = pstmt.executeQuery();
              while(rs.next()){
                   display=new ArrayList();
                   String title = rs.getString(1);
                   display.add(title);
                  System.out.println("###########################" +title);
                  System.out.println("(((((((((((())))))))))" +display);
                  outerList.add(display);
       }catch(Exception e){
           e.printStackTrace();
       }finally{
           if(rs != null){
                 try{rs.close();}catch(Exception e){e.printStackTrace();}
           if(pstmt != null){
                   try{pstmt.close();}catch(Exception e){e.printStackTrace();}
           if(con != null){
                   try{con.close();}catch(Exception e){e.printStackTrace();}
            con = null;
            pstmt = null;
            rs = null;
       return outerList;
    REGARDS,
    RaHuL

Maybe you are looking for

  • Open discoverer report in new browser window and without connections page

    Hi All, We are using Oracle 11g Discoverer 11.1.1.4.  Requirement is to open the discoverer report in a new browser window and without connections page. When we are running discoverer reports with this parameters we unwantedly get the connections pag

  • Green cast when printing

    How can I get rid of the green/yellow cast over my images in the newest Aperture 3.4.5? Photoshop CS5 prints perfectly using the same profile and settings. I have repaired the database. No effect

  • My Curve 8520 wont retreive picture messages, help?

    I have had my curve 8520 for about three weeks and whenever i get a picture message i try to retrieve it and i dont get it. it says receiving message for a while but then it just goes away, other times it will wont receive the message for a long time

  • Error 3200 when updating iPhone 4 to iOS 5.

    Need help.

  • Adadmin problem

    AD code level : [11i.AD.I.6] AD Administration Main Menu 1. Generate Applications Files menu 2. Maintain Applications Files menu 3. Compile/Reload Applications Database Entities menu 4. Maintain Applications Database Entities menu 5. Change Maintenan