Isn't this a valid way to write queries ?

Guys,
Please can you let me know if this is valid way of writing the query. I seem to get an error saying missing right parenthesis when i try to execute it. But the queries work individually.. I want to use it something like an inline view
Cheers
G
select x.user_id,x.MONTH,x.tickets,x.total_bet_amount,y.p1,y.p2,y.p10,y.p25,y.p50 from (
(SELECT /*+ PARALLEL(d,8) PARALLEL(b,8) */
          b.user_id ,
          to_char(d.date_gameplay_started, 'Mon-RRRR') AS "MONTH",
          count(d.date_gameplay_started) AS "TICKETS",
          --    e.game_type AS "GAME",
          sum(d.total_bet_amount) as TOTAL_BET_AMOUNT
FROM      production.gl_user_registrations a,
          production.gl_user_game_sessions b,
          production.vf_game_parameters c,
          production.gl_user_game_play_summarys d,
          production.vf_game_parameters e
WHERE      b.game_configuration_id =  c.parameters_id
AND      b.user_game_session_id = d.user_game_session_id
AND      d.game_configuration_id =  e.parameters_id
AND      b.user_id = a.user_id
and      d.date_gameplay_started between TO_DATE('01/11/2006', 'dd/mm/rrrr') and TO_DATE('01/12/2006', 'dd/mm/rrrr')
AND      a.registration_site IN ('ladbrokes.com')
group by      b.user_id,
                 to_char(d.date_gameplay_started, 'Mon-RRRR')
ORDER BY      b.user_id,
                 "MONTH",
               "TICKETS"
) x,
(select user_id, count(decode(bet_amount,0.01,user_id))          p1,
                        count(decode(bet_amount,0.05,user_id))        p5,
                     count(decode(bet_amount,0.1,user_id))               p10,
                     count(decode(bet_amount,0.25,user_id))        p25,
                     count(decode(bet_amount,0.50,user_id))        p50
from production.gl_bet_transactions gbt
where date_inserted between TO_DATE('01/11/2006', 'dd/mm/rrrr') and TO_DATE('01/12/2006', 'dd/mm/rrrr')
group by user_id) y
where x.user_id = y.user_id

Thanks guys.. This is sorted.. I guess i missed a right parenthesis in FROM
Cheers

Similar Messages

  • Is this the best way to write this in AS3

    I have converted my old AS2 to As3. It now appears to work the same as before but being new to AS3 I have a few questions.
    In this example I click on a button which takes me to a keyframe that plays a MC. There is another btn that takes me back to the original page.
    In AS2 it is written like this.
    // Go to keyFrame btn
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Scul_mc");
    //End Behavior
    // Play Movie
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Movie");
    //End Behavior
    //load Movie Behavior
    if(this.mcContentHolder == Number(this.mcContentHolder)){
    loadMovieNum("PL_Japan_Scul.swf",this.mcContentHolder);
    } else {
    this.mcContentHolder.loadMovie("PL_Japan_Scul.swf");
    //End Behavior
    // Return key
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Intro");
    //End Behavior
    In AS3 it is written like this.
    // Play Movie
    var myrequest_Jpn:URLRequest=new URLRequest("PL_Japan_Scul.swf");
    var myloader_Jpn:Loader=new Loader();
    myloader_Jpn.load(myrequest_Jpn);
    function movieLoaded_Jpn(myevent_Jpn:Event):void {
    stage.addChild(myloader_Jpn);
    var mycontent:MovieClip=myevent_Jpn.target.content;
    mycontent.x=20;
    mycontent.y=20;
    //unload method - Return to keyframe
    function Rtn_Jpn_Intro_(e:Event):void {
    gotoAndStop("Japan_Intro");
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    function removeMovie_Jpn(myevent_Jpn:MouseEvent):void {
    myloader_Jpn.unload();
    myloader_Jpn.contentLoaderInfo.addEventListener(Event.COMPLETE, movieLoaded_Jpn);
    Rtn_Jpn_Intro_btn.addEventListener("click",Rtn_Jpn_Intro_);
    // Go to keyFrame btn
    function Scul_Play(e:Event):void {
    gotoAndStop("Jpn_Scul_mc");
    Jpn_Scul_btn.addEventListener("click",Scul_Play);
    1. Is there a better, more efficient way to achieve this in AS3?
    2. I have used an //unload method in the AS3 script which does remove the MC from the scene but I notice in the output tab my variable code is still being counted for the last MC played.
    Is this normal?

    Hi Andrei, I have started a new project and taken your advice to construct it with a different architecture with all the code in one place.
    I have two questions regarding your last code update.
    var myrequest_Jpn:URLRequest;
    var myloader_Jpn:Loader;
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    Jpn_Scul_btn.addEventListener(MouseEvent.CLICK, Scul_Play);
    function Scul_Play(e:MouseEvent):void {
         myrequest_Jpn = new URLRequest("PL_Japan_Scul.swf");
         myloader_Jpn = new Loader();
         myloader_Jpn.contentLoaderInfo.addEventListener(Event.COMPLETE, movieLoaded_Jpn);
         myloader_Jpn.load(myrequest_Jpn);
    function movieLoaded_Jpn(e:Event):void {
         // remove listener
         myevent_Jpn.target.removeEventListener(Event.COMPLETE, movieLoaded_Jpn);
         this.addChild(myloader_Jpn);
         myloader_Jpn.x = 20;
         myloader_Jpn.y = 20;
         // remove objects that are in "Japan_Intro" frame
    function removeMovie_Jpn(e:MouseEvent):void {
         // add back objects that are in "Japan_Intro" frame
         // remove from display list
         this.removeChild(myloader_Jpn);
         myloader_Jpn.unload();
         myloader_Jpn = null;
         // this moved from Rtn_Jpn_Intro_ function
         //gotoAndStop("Japan_Intro");
    Its all works great except for the line to remove event..
    1.
    myevent_Jpn.target.removeEventListener(Event.COMPLETE, movieLoaded_Jpn);
    I get an error:   1120: Access of undefined property myevent_Jpn.
    Removing this statement allows the code to work but that is not a solution.
    2.
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    I would like this button to remove more than one movie. Is this possible.
    Thanks for the help todate.

  • Best way to write this sql ?

    Please let me know best way to write this SQL.
    select col1, count(*)
    from TableA
    group by col1
    having count(*) =
    (select max(vals)
    from
    select col1, count(*) as vals
    from TableA
    group by col1
    having count(*) > 1
    )

    post EXPLAIN PLAN
    SELECT col1,
           COUNT(*)
    FROM   tablea
    GROUP  BY col1
    HAVING COUNT(*) = (SELECT MAX(vals)
                       FROM   (SELECT col1,
                                      COUNT(*) AS vals
                               FROM   tablea
                               GROUP  BY col1
                               HAVING COUNT(*) > 1))

  • What is the EL way to write this?

    Hi,
    I'm trying to write embed some Java code within my Struts tag, and I'm getting compilation errors. This
    <html:submit property="next" disabled="<%= (endCount<maxCount) ? "false" : "true" %>"><bean:message key="button.next"/></html:submit>
    gives me the errors that look like:
    : This attribute is not recognized.
                                  <html:submit property="next" disabled="<%= (endCount<maxCount) ? "false" : "true" %>"><bean:message key="button.next"/></html:submit>
    ^---^
    The last time I had this problem, BallusC showed me an EL way to write out what the value of the attribute was, but I can't figure out how to rewrite, '<%= (endCount<maxCount) ? "false" : "true" %>', in EL. Can you help? Or maybe there's a better way?
    Thanks, - Dave

    WebLogic has problems parsing expressions which have nested quotes in them.
    If you use " around the entire expression, and also have a String delimited with " in your expression, it throws an error.
    example - something like this compiles and works on Tomcat, but not on Weblogic
    <html:img src="<%= "images/" + imageName %>"/>One solution is to use single quote delimiter around the entire expression
    <html:img src='<%= "images/" + imageName %>'/>Its a documented feature of Weblogic - or at least I think I remember reading something about it in Weblogics docs somewhere, but I can't remember exactly where right now.
    Anyway thats one work-around.
    Given this:
    <html:hidden property="<%=IMConstants.startCount %>" value="<%= endCount %>" />The error message seems to indicate that IMConstants.startCount is an Integer. You need to convert that to a String.
    The following should work I think (hack hack...)
    <html:hidden property='<%=IMConstants.startCount  %>' value='<%= endCount + ""%>' />

  • Is there another easy way to write this program??

    Hi ,i new in Java Programing,Is there another way to write this program?? This program below is about FIND THE AREA OF A CIRCLE WHEREIN THE RADIUS OF THE CIRCLE RANGES FROM 1 TO 10 BY 1 IN A FOR LOOP.
    import javax.swing.JOptionsPane;
    public class Area2 {
    public static void main(String[] args ) {
    double pi = 3.14;
    int r;
    String a = "Area = ";
    double area;
    for (r = 1; <= 10; r++)
    area = pi * r * r;
    a = a + area + "\n";
    JOptionPane.showMessageDialog(
    null , a);
    System.exit ( 0 );
    I did not write it ,i want to know if is there another way (easy)to write it.
    Thank you very much
    Sincerely Erick.

    Not much to improve upon this. It is a pretty simple program. Note my comment about PI.
    import javax.swing.JOptionsPane;
    public class Area2 {
       public static void main(String[] args ) {
          double final PI = 3.14; // Final because it's a constant value, convention for constants is to use uppercase
         int r;
         String a = "Area = ";
        for  (r = 1; <= 10; r++)
            area  = pi * r * r;
            a = a + area +  "\n";
        JOptionPane.showMessageDialog(null , a);
        System.exit  ( 0 );

  • Import a playlist from Spotify to buy the songs on iTunes?  Why isn't there an easy way to do this?  Low hanging fruit Apple.

    Import a playlist from Spotify to buy the songs on iTunes?  Why isn't there an easy way to do this?  Low hanging fruit Apple.

    Yeah, once people get hooked on streaming music, they tend to be much less interested in purchasing downloads, and especially not from a music store that sells songs in an inconvenient (AAC) format instead of the de facto standard, MP3 format.
    However, let me not deter you.  If you would like to make the suggestion to Apple, you can use the iTunes Feedback page:
    http://www.apple.com/feedback/itunesapp.html

  • Need code for this Small validation on when-validate-item

    Hi All,
    I have a text item(date datatype) in forms 4.5 I need to do a small validation want to write on when-validate-item. When I enter a date in that text item (Ex 10-JUN-2005) it has to check
    1) It Cannot be "blank"
    2) It cannot be "Not older than today"
    can you please put me code for this small validation. I am new to Forms.
    Thanks in Advance,
    Reddy

    I always put code in the when-validate-RECORD trigger to ensure fields are entered, rather than setting the property. That way, the user can enter other fields within the record, and then gets a message that the field is required only when leaving the record.
    ...of course, if the date item is the only field in the block, then the when-validate triggers will not run unless the user at least types a space in the date. In that case, you need to check in the key-commit trigger.

  • Need help to get alternate or better way to write query

    Hi,
    I am on Oracle 11.2
    DDL and sample data
    create table tab1 -- 1 millions rows at any given time
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date
    create table tab2 -- close to 100 million rows
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date,
    upd_date date
    insert into tab1 values (1,'ABCDEFG', 'XYZ','Y',sysdate);
    insert into tab1 values (2,'XYZABC', 'DEF','Y',sysdate);
    insert into tab1 values (3,'PORSTUVW', 'ABC','Y',sysdate);
    insert into tab2 values (1,'ABCDEFG', 'WYZ','Y',sysdate);
    insert into tab2 values (2,'tbVCCmphEbOEUWbxRKczvsgmzjhROXOwNkkdxWiPqDgPXtJhVl', 'ABLIOWNdj','Y',sysdate);
    insert into tab2 values (3,'tbBCFkphEbOEUWbxATczvsgmzjhRQWOwNkkdxWiPqDgPXtJhVl', 'MQLIOWNdj','Y',sysdate);I need to get all rows from tab1 that does not match tab2 and any row from tab1 that matches ref_cd in tab2 but key is different.
    Expected Query output
    'ABCDEFG',  'WYZ'
    'XYZABC',   'DEF'
    'PORSTUVW', 'ABC'Existing Query
    select
       ref_cd,
       key
    from
        select
            ref_cd,
            key
        from
            tab1, tab2
        where
            tab1.ref_cd = tab2.ref_cd and
            tab1.key    <> tab2.key
        union
        select
            ref_cd,
            key
        from
            tab1
        where
            not exists
               select 1
               from
                   tab2
               where
                   tab2.ref_cd = tab1.ref_cd
        );I am sure there will be an alternate way to write this query in better way. Appreciate if any of you gurus suggest alternative solution.
    Thanks in advance.

    Hi,
    user572194 wrote:
    ... DDL and sample data ...
    create table tab2 -- close to 100 million rows
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date,
    upd_date date
    insert into tab2 values (1,'ABCDEFG', 'WYZ','Y',sysdate);
    insert into tab2 values (2,'tbVCCmphEbOEUWbxRKczvsgmzjhROXOwNkkdxWiPqDgPXtJhVl', 'ABLIOWNdj','Y',sysdate);
    insert into tab2 values (3,'tbBCFkphEbOEUWbxATczvsgmzjhRQWOwNkkdxWiPqDgPXtJhVl', 'MQLIOWNdj','Y',sysdate);
    Thanks for posting the CREATE TABLE and INSERT statments. Remember why you go to all that trouble: so the people whop want to help you can re-create the problem and test their ideas. When you post statemets that don't work, it's just a waste of time.
    None of the INSERT statements for tab2 work. Tab2 has 6 columns, but the INSERT statements only have 5 values.
    Please test your code before you post it.
    I need to get all rows from tab1 that does not match tab2 WHat does "match" mean in this case? Does it mean that tab1.ref_cd = tab2.ref_cd?
    and any row from tab1 that matches ref_cd in tab2 but key is different.
    Existing Query
    select
    ref_cd,
    key
    from
    select
    ref_cd,
    key
    from
    tab1, tab2
    where
    tab1.ref_cd = tab2.ref_cd and
    tab1.key    <> tab2.key
    union
    select
    ref_cd,
    key
    from
    tab1
    where
    not exists
    select 1
    from
    tab2
    where
    tab2.ref_cd = tab1.ref_cd
    Does that really work? In the first branch of the UNION, you're referencing a column called key, but both tables involved have columns called key. I would expect that to cause an error.
    Please test your code before you post it.
    Right before UNION, did you mean
    tab1.key    != tab2.key? As you may have noticed, this site doesn't like to display the &lt;&gt; inequality operator. Always use the other (equivalent) inequality operator, !=, when posting here.
    I am sure there will be an alternate way to write this query in better way. Appreciate if any of you gurus suggest alternative solution.Avoid UNION; it can be very inefficient.
    Maybe you want something like this:
    SELECT       tab1.ref_cd
    ,       tab1.key
    FROM           tab1
    LEFT OUTER JOIN  tab2  ON  tab2.ref_cd     = tab1.ref_cd
    WHERE       tab2.ref_cd  IS NULL
    OR       tab2.key     != tab1.key
    ;

  • A better way to write last_day query

    Hi folks,
    I am looking for a better way to write a query to find last_day in month but if its sunday or holiday it should move to day before last day.
    So for example if 31 is sunday it should go for 30, if 30 is holiday it should move down to 29.
    I got this so far but the connect by level is hardcoded to 15. Want to see if there is a better way to get this working:
    select max(datum)
      from (    select last_day(trunc(sysdate)) - level + 1 as datum
                  from dual
            connect by level < 15)
    where to_char(datum, 'day') != 'sunday'    
       and to_char(datum, 'DDMM') not in
             ('3012')Best regards,
    Igor

    Like this
    select to_char(last_day_month, 'Day') day_is,
           last_day_month,
           last_day_month - case when to_char(last_day_month, 'fmday') = 'sunday' then 1
                                 when to_char(last_day_month, 'ddmm' ) = '3012'   then 1
                                 else 0
                            end last_business_day_month
      from (
              select last_day(add_months(trunc(sysdate, 'year'), level-1)) last_day_month
                from dual
              connect by level <= 12
    DAY_IS    LAST_DAY_MONTH LAST_BUSINESS_DAY_MONTH
    Tuesday   31-JAN-12      31-JAN-12              
    Wednesday 29-FEB-12      29-FEB-12              
    Saturday  31-MAR-12      31-MAR-12              
    Monday    30-APR-12      30-APR-12              
    Thursday  31-MAY-12      31-MAY-12              
    Saturday  30-JUN-12      30-JUN-12              
    Tuesday   31-JUL-12      31-JUL-12              
    Friday    31-AUG-12      31-AUG-12              
    Sunday    30-SEP-12      29-SEP-12              
    Wednesday 31-OCT-12      31-OCT-12              
    Friday    30-NOV-12      30-NOV-12              
    Monday    31-DEC-12      31-DEC-12 

  • Is there any way to write-enable an NTFS-format WD external Hard Drive ?

    I have a WD Elements external HD unit, 1TB previously formatted NTFS under Windows XP on a PC. I would like to use this HD unit to both read and write data using both the Windows PC and a MacBook Pro. But when connected to the MacBook Pro (USB), the HD unit shows up as Read Only.
    Is there a way to write-enable the HD unit without losing, or having to backup/restore, the mass of data already saved there ?
    I have tried installing NTFS-G3 on the MBP, as suggested elsewhere. Having done so, when I "get information" about the WD unit, the disc format shows as "Windows NT File System (NTFS)" and not NTFS-G3 as expected. Ran chkdsk on the WD under Windows to iron out any problems in the disc's file system. It ran for several hours before completing successfully, but there was no change at all - the unit is still read-only after re-connecting to the MBP.
    Can anyone help out please?

    Why would you expect it to say NTFS-3G? NTFS-3G is just a program that translates the NTFS to something the Mac OS can deal with. It doesn't change the format of the hard drive. The drive is formatted with the New Technology File System (NTFS), not the NTFS-3G file system.
    Were you not able to write to the drive with NTFS-3G installed? Did you install the free version? If so, did you install MacFuse, also? It is required for the free version of NTFS-3G.
    Edit:
    I just plugged in an NTFS drive and I'm guessing what you were looking for was something to indicate what was doing the translation. On mine I get, "Windows NT File System (Tuxera)." So, I think I understand what you meant before. My guess is as I stated above. Make sure you also have MacFuse installed if you are using the free version of NTFS-3G.
    Message was edited by: Barney-15E

  • Is this the best way to Triple Boot?

    Hi all, I have a had a pickle of a time setting up Leopard...with my triple boot setup.
    I am curious if I went about it "properly"or if there is a better way.
    Use instructions at your own peril if you wish. I am not responsible for errors or any problems you may have by using my instructions. This is my individual experience. *I am happy if this works for someone* struggling to set up a triple boot, but am posting this more so to see if there are any improvements to be made, or mistakes that need correcting to this method...
    I had an Intel MBP (SR) with 3 partitions. Tiger, Vista and Ubuntu but when trying to install Leopard it said it would not install and I would have to change my drive to guid partition scheme.
    So, through trial and error this is the only way I could get it to work.Keep in mind I started from scratch with vista and ubuntu, but did make a backup of my tiger drive.
    1. BACK UP
    2. Wipe everything and repartition internal disk to guid partition map and 1 partition. Install Leopard.
    3. Use either disk utility or carbon copy cloner(my purchased copy of SuperDuper is still not able to do what CCC, a free program can do,apparently because they are trying to figure out time machine and are holding up a leopard compat. version, uuughh, but thats a different post...) to clone Leopard to external drive that is set up as GUID partition scheme.Make sure you are able to boot this external.
    4. Wipe internal, repartition to 3 partitions using disk utility and MBR partition scheme in this order from top to bottom(in disk utility partition gui);
      a. Leopard partition: OSX extended journaled
      b. Vista partition: I think there is only one option: maybe Fat? Just make sure you select "windows" format (The vista installer will need to reformat this during install anyway)
      c. Ubuntu partition: "Free Space"
    5. Then to install leopard, (which apparently won't install on a drive set up as MBR partition scheme, but that is what we formatted the internal drive as anyway) clone the external copy of leopard to the internal OSX partition we just made.
    6. Then install vista by booting from install cd. During install you may have to reformat the Windows partition using the windows installer, but it should install fine after that.
    7. Then Install ubuntu using live cd/dvd to the internal free space partition, splitting/ formatting the last partition using the ubuntu install/partition tool on the "manual"partition mode(make sure you are using the correct free space partition. I confirmed this by looking at the sizes of the partitions that showed up): "free space" into root and swap partitions if you want. I used ext2 for root
         *Side note:*If you have the same MBP as me you may have to change some setting when booting the live cd: Once the cd loads and you get to the preliminary menu window, press F6 to edit. A command will show up on the screen: You have to erase the last two words starting at "quiet" till end. Then write "allgenericide" in their space, keeping all of the command before quiet.  then press enter. It should then load to the ubuntu desktop where you can click on the install icon.(this took me a long time to figure out. I have also have to do this everytime I want boot into ubuntu, which stinks. Anyone know how to resolve this? (Linux masters?)
    8. boot into osx and install rEFIt
    Issues:
    1. My Leopard partition is not showing up in OSX's startup disk pane in sys pref. but it is booting/ showing up as if it was, if having trouble, try holding option key during startup.
    2. I have also had a few issues with rEFIt not starting up as default menu, but when holding option key at startup it will show up. Then gives me the option of OSX, Vista or Ubuntu once selected.
    3. And the command thing with ubuntu at every startup I mentioned earlier.Is there a way to write allgenericide as a default or any other way to fix this?
    If anyone has a better way of accomplishing this please let me know. I got to this point through a lot of trial and error and I'm not sure if there is a more stable/better way for a triple boot setup...
    I would like for the Leopard partition to show up as the osx startup disk in the pref pane, but regardless it is still working.
    Correct me if I'm wrong, but it seems boot camp makes the drive into an MBR partition scheme anyway, so I'm curious what others who were already running dual or triple boot, boot camp systems had to do when upgrading their boot camp setups from tiger to leopard. Did it not allow you to install to the MBR partition scheme made by boot camp? Did you have to start from scratch as well?
    Thank you in advance for your patience and support.  

    http://wiki.onmac.net/index.php/TripleBoot_viaBootCampI would install Vista before installing Leopard.
    That has worked better for me anyway.
    And that may make Leopard the default.
    In Vista, AppleControl is under /Windows/SysWOW64 if you ever need to get to it (there is also AppleOSSMgr and AppleTimeSrvc )
    http://wiki.onmac.net/index.php/TripleBoot_viaBootCamp

  • Best way to write SELECT statement

    Hi,
    I am selecting fields from one table, and need to use two fields on that table to look up additional fields in two other tables.
    I do not want to use a VIEW to do this. 
    I need to keep all records in the original selection, yet I've been told that it's not good practice to use LEFT OUTER joins.  What I really need to do is multiple LEFT OUTER joins.
    What is the best way to write this?  Please reply with actual code.
    I could use 3 internal tables, where the second 2 use "FOR ALL ENTRIES" to obtain the additional data.  But then how do I append the 2 internal tables back to the first?  I've been told it's bad practice to use nested loops as well.
    Thanks.

    Hi,
    in your case having 2 internal table to update the one internal tables.
    do the following steps:
    *get the records from tables
    sort: itab1 by key field,  "Sorting by key is very important
          itab2 by key field.  "Same key which is used for where condition is used here
    loop at itab1 into wa_tab1.
      read itab2 into wa_tab2     " This sets the sy-tabix
           with key key field = wa_tab1-key field
           binary search.
      if sy-subrc = 0.              "Does not enter the inner loop
        v_kna1_index = sy-tabix.
        loop at itab2 into wa_tab2 from v_kna1_index. "Avoiding Where clause
          if wa_tab2-keyfield <> wa_tab1-key field.  "This checks whether to exit out of loop
            exit.
          endif.
    ****** Your Actual logic within inner loop ******
       endloop. "itab2 Loop
      endif.
    endloop.  " itab1 Loop
    Refer the link also you can get idea about the Parallel Cursor - Loop Processing.
    http://wiki.sdn.sap.com/wiki/display/Snippets/CopyofABAPCodeforParallelCursor-Loop+Processing
    Regards,
    Dhina..

  • Fastest way to write out internal table to database table ?

    Hi friends,
    my question is, what is the fastest way to write about 1,5 mill. of rows from an internal table to a database table ?
    points will be awarded immediately,
    thanks for your help,
    clemens

    Hi Clemens,
    If you just want to write (INSERT) 1.5 million rows of an internal table into a database table, use:
    INSERT <table name> FROM TABLE <itab>.
    Transaction Log Size could be a problem, therefore writing in packages could help, but this depends on your row size, your database configuration and on the current changes to your database. May be it runs in one package, if the rows are small (few bytes) then one package will be the fastest but you'll not much faster than with reasonable packages (3-20 MBytes). On Oracle with rollback segments you will probably have no problems at 1.5 million rows.
    Best regards
    Ralph

  • What is a best way to write SQL ?

    Sample Case
    drop table t;
    drop table b;
    create table t ( a varchar2(4), b number, c varchar2(1));
    insert into t values ('A00', 10, 'R');
    insert into t values ('A01', 11, 'R');
    insert into t values ('A02', 12, 'R');
    insert into t values ('A03', 13, 'R');
    insert into t values ('A00', 10, 'P');
    insert into t values ('A01', 11, 'P');
    insert into t values ('A02', 12, 'P');
    insert into t values ('A03', 13, 'P');
    commit;
    create table b ( j varchar(4), k varchar2(1), l varchar2(5), m number(3), n varchar2(5), o number(3));
    insert into b values ('A00', 'P', 'FIXED', 100, 'FLOAT', 60);
    insert into b values ('A01', 'P', 'FIXED', 101, 'FIXED', 30);
    insert into b values ('A02', 'R', 'FLOAT', 45, 'FLOAT', 72);
    insert into b values ('A03', 'R', 'FIXED', 55, 'FLOAT', 53);
    commit;
    10:19:13 SQL> select * from t;
    A B C
    A00 10 R
    A01 11 R
    A02 12 R
    A03 13 R
    A00 10 P
    A01 11 P
    A02 12 P
    A03 13 P
    8 rows selected.
    10:19:19 SQL> select * from b;
    J K L M N O
    A00 P FIXED 100 FLOAT 60
    A01 P FIXED 101 FIXED 30
    A02 R FLOAT 45 FLOAT 72
    A03 R FIXED 55 FLOAT 53
    1/     In table t each reference having 2 records one with P another is with R
    2/     In table b each refrence merged into single record and there are many records which are not existing in table t
    3/      both t and j tables can be joined using a = j
    4/     If from table t for a reference indicator is 'P' then if have to pick up l and m columns, if it is 'R' then I have to pick up n and o columns
    5/     I want output in following format
    A00     P     FIXED          100
    A00     R     FLOAT          60
    A01     P     FIXED          101
    A01     R     FIXED          30
    A02     P     FLOAT          72
    A02     R     FLOAT          45
    A03     P     FLOAT          53
    A03     R     FIXED          55
    6/     Above example is a sample ouput, In above example I have picked up only l,m,n,o columns, but in real example there are many columns ( around 40 ) to be selected. ( using "case when" may not be practical )
    Kindly suggest me what is a best way to write SQL ?
    thanks & regards
    pjp

    Is this?
    select b.j,t.c as k,decode(t.c,'P',l,n) as l,decode(t.c,'P',m,o) as m
    from t,b
    where t.a=b.j
    order by j,k
    J K L M
    A00 P FIXED 100
    A00 R FLOAT 60
    A01 P FIXED 101
    A01 R FIXED 30
    A02 P FLOAT 45
    A02 R FLOAT 72
    A03 P FIXED 55
    A03 R FLOAT 53
    8 rows selected.
    or is this?
    select b.j,t.c as k,decode(t.c,b.k,l,n) as l,decode(t.c,b.k,m,o) as m
    from t,b
    where t.a=b.j
    order by j,k
    J K L M
    A00 P FIXED 100
    A00 R FLOAT 60
    A01 P FIXED 101
    A01 R FIXED 30
    A02 P FLOAT 72
    A02 R FLOAT 45
    A03 P FLOAT 53
    A03 R FIXED 55
    8 rows selected.

  • Best way to write entire DVD-R?

    It's come to my attention that certain set top DVD players (Phillips in particular) won't play recordable media with a small amount of information written to the disc. But if you burn more than 4GB to the disc, the player reads the disc just fine. I'm working with a 15-minute program, so I'm obviously not near the 4GB. I'm interested in maximizing functionality and playability on all machines, so I'm wondering if there's a way within DVDSP, Disk Utility or Toast to write the entire disc. I've tested this by inserting video tracks that the user cannot reach from the menus, but the user could easily use the 'chapter forward' function and get lost in the dummy tracks. Thanks in advance for any thoughts.

    Yes, TY media are good, but Memorex? This forum is littered with references to the coasters that they make.
    The media in question here are TY, Verbatim and some leftover Apple brand discs from the old days. DVD-R manufacturer definitely has nothing to do with this. It's definitely an idiosyncrasy of the Phillips player in question. I've never had it happen with any of the other dozen or so players we have around here.
    We maintain many different brands of DVD player in our studios to be able to simulate any situation our products may find themselves in. Our goal is to be able to reach the largest audience possible for our clients, no matter their technological limitations. That is not always easy or even possible, given the amount of old, poor, and poorly maintained computers and DVD players out there. But we try to reach as many as possible. As tempting as it might be to always blame the user's equipment, we have to try to find novel ways of making every project as accessible as possible.
    I'll mark this question as answered, because I've discovered that there is no way to write to the edge of a DVD-R without the requisite amount of QT tracks within the DVDSP project. If anyone ever has any other ideas, please offer them. Thanks to all for contributing.

Maybe you are looking for

  • How do I set-up a Shared Folder to automatically grant read

    In OS 10.6.8, how do I set-up a Shared folder to automatically grant read & write access to all new MS Office files?  Older files are fine.  But, when new files are created and saved by one registered user, those files are "read-only" when opened by

  • How to import project from Final cut pro 7 to X ?

    how to import project from Final Cut Pro 7 to X ?

  • Skipping a disabled component in the tab order

    It seems that when you disable a button, it isn't automatically skipped in the tab ordering. Worse than that, the two obvious methods of skipping a disabled component (in topic summary above) have no effect. .... Is there a solution for this?

  • Adobe support is terrible!

    Just a general question, does anyone else have issues with Adobe's support? It all has to be via the website, no phone support in my country. Raised the issue at the start of March, still waiting at the end of March. Loved everything about Flash when

  • What do i do when error -50 appears?

    I purchased 2 episodes for a TV show (4 total downloads: 2 in HD 2 non-HD) and all were downloading. Then 3 of them stopped and it says that there was a problem downloading (error -50 occured)... Now only 1 of them finished. Is there anyway I can mak