Need help in logic change to avoid select statement inside loop .

Hello all ,
Please see the below code . Here i got the shipment number in internal table  IT_VTTK . So For this shipment number i want to get the details from Vekp table in to internal table  IT_VEKP  . There is no need for me to use For all entries . I have passed the value of it_vekp into work area wa_vekp and getting the details in to IT_vekp using loop.
But since we should not use the select statement inside the loop , Can anybody please tell me how to achieve this functionality .
Instead of passing into work area wa_vttk if i directly use the internal table I'm getting the following error .
"IT_VTTK" is a table without a header line and therefore has no component called "TKNUM".
Hence i have used select statement inside a loop . Please tell me is there any other way to avoid this ?
types:begin of ty_likp,
        vbeln type likp-vbeln,
       end of ty_likp,
       begin of ty_vttk,
        tknum type vttk-tknum,
        end of ty_vttk.
DATA: IT_VEKP TYPE STANDARD TABLE OF TY_VEKP,
      WA_VEKP TYPE TY_VEKP.
  data:it_likp type standard table of ty_likp,
       wa_likp type ty_likp,
       it_likp1 type standard table of ty_likp,
       it_vttk type standard table of ty_vttk,
       wa_vttk type ty_vttk.
  data:w_tknum type vttk-tknum.
if not it_likp is initial .
    select vbeln
            from
             vbfa
      into table it_vttk
       for all entries in it_likp where vbelv = it_likp-vbeln and vbtyp_n = '8'.
  endif .
IF IT_VTTK[] IS NOT INiTIAL.
    loop at it_vttk into wa_vttk.
    SELECT venum
           EXIDV
           EXIDV2
           BRGEW
           NTGEW
           GEWEI
           TARAG
           GEWEI
           VHART
           INHALT
         FROM VEKP INTO TABLE IT_VEKP where VPOBJKEY = wa_vttk-tknum  and vpobj = '4'.
      endloop.
      endif.

Hello,
Why would you not like to use FOR ALL ENTRIES in the second select? Is it becasue of the length or type mismatch error between the fields VPOBJKEY and wa_vttk-tknum ?
Vikranth

Similar Messages

  • Need help On Triggers/Change pointers in SAP

    Hi Experts,
    I Need help On Triggers/Change pointers in SAP.
    I have a requirement  as soon as an entry is created in one of the  Standard SAP  table it should check against my Ztable and update and create the corresponding entry in another Ztable.
    Can some one help me out on this with the syntax and how to do it

    Hi,
    Check whether you have any enhancement option (BADI, user exit, Customer enhancement etc) in the program which is used to save the data in the SAP standard table. If so, then try to write your code in that appropriate enhancement.

  • I Need help. I Change My Number and now imessage don t work.

    I Need help. I Change My Number and now imessage don t work.

    Hi Ivonka88,
    Here are some steps to try troubleshooting your issue with, depending on your specific symptoms:
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/ts4268
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Cheers!
    - Ari

  • HT1349 I need help finding an old library that itunes states my ipod is already linked to

    I need help finding an old library that it states my ipod is already linked to.  My computer recently had a terrible virus and needed to be wiped clean.  I had to redownload itunes and I bought several songs.  I want to add them to my old library because I had several cd's that I had uploaded.  Is there a way to find that old library and combine them without having to erase all the songs that are currently on my ipod???  Thanks

    Umm.  If you wiped the hard drive, then all old libraries are gone unless you have them on backup.

  • Normal State Button Shows Selected State At Loop Point

    My menu shows the Normal State Button Shows as the selected state At Loop Point. I want it to show for instance black until it is selected then "rollover" to red. TIA for any help.
    Murman

    There are two ways that you can do this without resorting to using a layer based shape or a layer based menu.
    First, you need to decide if it is important for the logo to appear in full colour or if you can get away with a single colour instance of it appearing. If the answer to this is that a single colour is OK, then use a standard overlay menu. Otehrwise, try using a masked overlay menu (there are limitations...)
    With a standard overlay, the background image is as you want it to appear without anything selected - all shapes and text, etc, should be in place as if no button is chosen.
    You then create the overlay, which is a simple .pict file that is the size of the menu. On this you simply place as many instances of the logo as you need - create them in black or grayscale and don't add anything else. The overlay will be mostly white with the black or gray shapes on it.
    Add this to your menu in DVDSP and drag out the button rectangles to cover the background text and the overlay shape. When the button is selected, the logo shape will show up, but will not show in the normal state.
    You can get the logo to be whatever colour you need by using the colour mapping within the property inspector for the button.
    If you definitley need a full colour logo to appear, you can either use a layer based photoshop menu, or use overlay masks:
    http://www.editorsbin.com/authoring/mask_overlay.html
    be aware that there are some limitations when using the masking technique - but all is explained in that tutorial.

  • Select statements inside a SQL Expression field

    Hello
    Why cannot we use the Select statements inside a SQL expression field in Crystal Reports ?
    Any alternatives for this...
    SELECT Top(1) "SomePrivateDatabase"."SPDname" FROM "SomePrivateDatabase"
    inner join "Subscriber" on
    "Subscriber"."SPDID" = "SomePrivateDatabase"."SPDID"
    inner join "UserDetails" on
    "UserDetails"."SPDID" = "SubscriberCore"."SPDID"
    Regards
    Srivatsa
    Edited by: Srivatsa Haridas on Dec 3, 2008 12:17 PM

    Hi Srivatsa,
    SQL Expressions is something the Database supports. We query the Client engine for a list of functions they make available. If the SQL Statement is not list it's not an option and therefore it won't work.
    Your work arounds are to use either a Stored Procedure, this is the most efficient way, all processing is done server side and CR simply waits for the data to format in the report. Another option is to use a
    Command Object, use one CO per report so try to get all data within the SQL statement. We simply pass the SQL to the server and wait for the result set, if you get an error it will be the SQL you typed in. Test in a SQL test tool first to confirm you are getting the data correctly.
    For more assistance in designing reports please post your report deisgn questions to the Reprot Design forums. I am moving this one to that queue.
    Thank you
    Don

  • Fetching a value from a select statement inside select clause

    hello all,
    I have a problem executing a procedure it gives me a runtime error, what am doing is i have multiple select statement inside a select clause. am using the entire select statement for a ref cursor. when running the query seperately am able to get the records but it's not getting compiled.
    here is the piece of code which am working with
    create or replace procedure cosd_telecommute_procedure
    (p_from_date in date,
    p_to_date in date,
    p_rset in out sys_refcursor)
    as
    p_str varchar2(10000);
    begin
    p_str := 'select personnum, '||
    'fullname, '||
                   'personid, '||
         'hours, '||
         'applydtm, '||
    'paycodeid, '||
         'laborlev2nm, '||
         'laborlev3nm, '||
         'laborlev2dsc, '||
    'adjdate, '||
         'timeshtitemtypeid, '||
         '(select max(eff_dt) from cosd_telecommute_info_tbl '||
         'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt between ''01-aug-2005'' and ''30-aug-2005'') thisyreffdt, '||
                   '(select elig_config7 from cosd_telecommute_info_tbl '||
                   'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt = (select max(eff_dt) from cosd_telecommute_info_tbl '||
                   'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt between ''01-aug-2005'' and ''30-aug-2005'')) thisyrmiles,'||
    '(select max(eff_dt) from cosd_telecommute_info_tbl '||
                   'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt between trunc(p_from_date) and trunc(p_to_date)) fiscalyreffdt, '||
         '(select elig_config7 from cosd_telecommute_info_tbl '||
                   'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt = (select max(eff_dt) from cosd_telecommute_info_tbl '||
                        'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt between trunc(p_from_date) and trunc(p_to_date))) fiscalyrmiles '||
    'from cosd_vp_telecommute '||
    'where trunc(applydtm) '||
    'between p_from_date and p_to_date '||
                   'and personnum = ''029791''';
                   open p_rset for p_str;
    end cosd_telecommute_procedure;
    and here is the piece of error am getting
    ERROR at line 1:
    ORA-00904: invalid column name
    ORA-06512: at "TKCSOWNER.COSD_TELECOMMUTE_PROCEDURE", line 40
    ORA-06512: at line 5

    Did you run the query in SQL plus? Check whether all the column are valid in your database. Below is the query which i got from your procedure just run and check it out. It is really hard for us to tell you the problem without knowing the table structure
    select personnum, fullname, personid, hours, applydtm, paycodeid, laborlev2nm, laborlev3nm,
    laborlev2dsc, adjdate, timeshtitemtypeid,
    (select max(eff_dt) from cosd_telecommute_info_tbl
      where emplid = cosd_vp_telecommute.personnum
      and eff_dt between '01-aug-2005' and '30-aug-2005') thisyreffdt,
      (select elig_config7 from cosd_telecommute_info_tbl where emplid = cosd_vp_telecommute.personnum
      and eff_dt = (select max(eff_dt)
                    from cosd_telecommute_info_tbl
                    where emplid = cosd_vp_telecommute.personnum
                    and eff_dt between '01-aug-2005' and '30-aug-2005'
       ) thisyrmiles,
      (select max(eff_dt)
       from cosd_telecommute_info_tbl
       where emplid = cosd_vp_telecommute.personnum
       and eff_dt between trunc(p_from_date) and trunc(p_to_date)
       ) fiscalyreffdt,
       (select elig_config7 from cosd_telecommute_info_tbl where emplid = cosd_vp_telecommute.personnum
       and eff_dt = (select max(eff_dt)
                     from cosd_telecommute_info_tbl
                     where emplid = cosd_vp_telecommute.personnum
                     and eff_dt between trunc(p_from_date) and trunc(p_to_date)
       ) fiscalyrmiles
    from cosd_vp_telecommute
    where trunc(applydtm) between p_from_date and p_to_date
    and personnum = '029791'

  • Need help in Logic to Concat

    Hello everyone,
    This is the requirement,
    I have a table like this below :
    Actual table: Item_Seller
    item_id
    seller_name
    12310450
    Pro Team
    12310450
    CSNStores.com
    12310451
    CSNStores.com
    12310452
    CSNStores.com
    12310452
    Pro Team
    12310453
    Pro Team
    12310691
    CSNStores.com
    12310691
    Pro Team
    12310692
    CSNStores.com
    12310692
    Pro Team
    The requirement is to concatenate seller_name in the table like below output, this should not be performed using a stored procedure. I need help in writing a select query to display the below output.
    Item_id
    sellername_concat
    12310450
    Pro Team,CSNStores.com
    12310451
    CSNStores.com
    12310452
    CSNStores.com,Pro Team
    12310453
    Pro Team
    12310691
    CSNStores.com,Pro Team
    12310692
    CSNStores.com,Pro Team
    Any help would be much appreciated!
    Thanks
    Madhumathi

    Just this would be enough 
    SELECT item_id,
    STUFF((SELECT ',' + seller_name
    FROM Item_Seller
    WHERE item_id = t.Item_id
    FOR XML PATH(''),TYPE).value('.','varchar(max)'),1,1,'') AS SellerName_Concat
    FROM (SELECT DISTINCT item_id FROM Item_Seller)t
    see
    http://visakhm.blogspot.in/2014/01/rowset-concatenation-with-special.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Need help on logic/ coding

    Dear all,
    I need help on , How to compare two lists? I wrote the following code. but I'm not success. please help.
    declare
    rec_cnt number;                             --This for getting first record set count
    pd_cnt  number;                              -- This for getting second  record set count
    flg_tst char(1):='F';                      -- this flag  is set to false.
    begin             
          go_block('block1');                     -- In this block displays my first  list         
          last_record;                                 -- cursor Point out the last record.
          rec_cnt := :system.cursor_record;        -- here getting total number of records in the first list
          go_block('block2');                        -- In this block displays my second  list        
          last_record;                                 -- cursor Point out the last record.
          pd_cnt := :system.cursor_record;        -- here getting total number of records in the  second list
          begin   
               /* go_block('block1');
               first_record; */
               for i in 1..rec_cnt
               loop                                         /* Here my comparison  of records going on. for every record in  first list there  should be
                                                           corresponding record in second record.
                                         otherwise should throw message.
                                         suppose if one record is not matched then the control should exit from the two loops and throws the message */
                      go_block('block1');                              
                      go_record(i);
                      go_block('block2');
                      first_record;
                         for j in 1..pd_cnt
                         loop
                               if :block1.TEST_ID =:block2.TEST_CODE then     /*If two records match set the flag as True and exit from second loop. there is no need to further check. */
                                        flg_tst := 'T';                /* And loops should take next record from second list, again loops goes for second list record matching */
                                        exit;
                                  else
                                       if j != pd_cnt then       /*not match then compare with next record of the second record */                            
                                           next_record;
                                       end if;          
                                  end if;    
                         end loop;   
                      if (flg_tst := 'F' and j=pd_cnt) then     /*suppose one record in first list is not equal with all records in second list,exit from second loop and shows message */
                   exit;
                      elsif (flg_tst := 'F' and i != rec_cnt) then
                               next_record;
                      else
                           exit;
                      end if;   
                end loop;
               if flg_tst = 'F' then
                            message('For mu test no corresponding test code');                  
                      end if;
              /* Exception when others then
               message('HI:=  '||sqlerrm);
               message('HI:=  '||sqlerrm); */
          end ;
    end;
          My problem is :
    1. we should take one record from firstlist and compare with all records in second list.
    --> suppose match then,we should continue for next record for first list.
    -->not match then exit from two loops and shows error.
    2. we should compare all the records in first list with all records in second list.
    Thanks
    SB
    Edited by: SB on Dec 7, 2011 1:31 AM

    Hi all,
    Now I've changed my query as follows,
    PROCEDURE testing IS
    rec_cnt number:=0;
    pd_cnt  number:=0;
    flg_tst char(1);
    begin
          go_block('med_uw');
          last_record;
          rec_cnt := :system.cursor_record;
          go_block('panel_doctor');
          last_record;
          pd_cnt := :system.cursor_record;
          message('rec_cnt'||rec_cnt||'  '||'pd_cnt'||pd_cnt);
          message('rec_cnt'||rec_cnt||'  '||'pd_cnt'||pd_cnt);
           begin
               for j in 1..pd_cnt
               loop
                      flg_tst:='F';
                      go_block('panel_doctor');
                      go_record(j);
                      go_block('med_uw');
                      first_record;
                         for i in 1..rec_cnt
                         loop 
                                    if :block2.TEST_ID =: block1.TEST_CODE then
                                        flg_tst := 'T';
                                        exit;
                                  else
                                       next_record;
                                end if;          
                         end loop;   
                      if (flg_tst = 'F')then
                              exit;
                         else
                           next_record;
                      end if;   
               end loop;
            if flg_tst = 'F' then
                                message('For'||'  '||:block1.PD_DOC_CODE||' '|| 'doc code med test has not been added, please add the test or delete the doc code');                  
            end if;
          end ;
    end;
          but still the problem persist.
    Edited by: SB on Dec 7, 2011 5:22 AM

  • Need Help, Power Mode Changer

    So the yoga is a cool computer but, it lacks lots of features. I for one miss the ideapad touch button power mode feature from my old laptop.
    I am remaking this program but I need help with the graphics.
    This is where I am right now:
    http://i43.tinypic.com/5mwgeq.png
    My goal is to make a hotkey controllable program that will change mode with the key function : ALT + Spacebar
    It will probably take me 20 more min to add this hotkey feature. However, I need help with the graphics. If you guys help with the graphics, I will share this program with the public. 
    Also, I would love suggestions and ask for your opinion. Is this something you would be intrested in?
    Of course, the program will be free of charge and I might even make it open source.
    ***Edit***
    To show you guys I am not BSing:
    http://alltechtalk.net/Power_Mode_Changer.exe
    To change between modes, press the LEFT ALT + Z. In the final version, the hotkey will be left alt + space bar, for now, this is a beta.

    The program has already been made. All I need is help with the graphics. 
    Attached below is a sample background and button png, in the size it needs to be. 
    http://www.sendspace.com/file/xmnqnw
    To show you guys I am not BSing:
    http://alltechtalk.net/Power_Mode_Changer.exe
    To change between modes, press the LEFT ALT + Z. In the final version, the hotkey will be left alt + space bar, for now, this is a beta.

  • Need help how to change LOV query

    Hi All,
    Can some one help me how to use the LOV Query based on responsibility (I am using form personalization)
    When the user logs in with XX_Payables Super user with say (Responsibility id =500) then the LOV should be
    Select BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    from CE_BANK_ACCOUNTS ba
    but if the user logs in with any other responsibilits then the lov should be
    Select BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    from CE_BANK_ACCOUNTS ba
    where BA.multi_currency_allowed_flag = 'Y'
    step 1
    I have created a built in builtin type : Create Record group from query
    Arugument : Select statement
    Group name : XX_Group
    step 2
    Property
    Object type : LOV
    target object : PAY_ACTIVE_BANK_ACCOUNTS
    property name : Group name
    value XX_GROUP
    Using this method i am able to select only one query
    How can i control this based on responsibility.
    Appreciate if some one can help me to resolve this issue.
    Regards,
    Rajini

    Thanks for your reply, I tried to use this query but i am getting error as FRM-41076 Error populating group and FRM-41072 Cannot create group
    but if i use any one of the query or either of the query it works fine. but i dont see any issues when i run only any one of the query in argument in form personalization. Union all is returing rows in database.
    SELECT BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    CBAU.bank_acct_use_id ,
    BA.multi_currency_allowed_flag bank_multi_currency_flag,
    BA.zero_amount_allowed bank_zero_amounts_allowed,
    BA.account_owner_org_id legal_entity_id,
    CBB.bank_name,
    CBB.bank_branch_name
    FROM
    CE_BANK_ACCOUNTS BA,
    CE_BANK_BRANCHES_V CBB,
    CE_BANK_ACCT_USES_OU_V CBAU
    WHERE ((BA.multi_currency_allowed_flag = 'Y' AND
    (BA.currency_code = :pay_sum_folder.functional_currency_code or
    BA.currency_code = :parameter.pay_in_full_currency_code )) or
    BA.currency_code = nvl( :parameter.pay_in_full_currency_code, BA.currency_code))
    AND CBAU.BANK_ACCOUNT_ID = BA.BANK_ACCOUNT_ID
    AND sysdate between TRUNC(CBB.start_date) and nvl(TRUNC(CBB.end_date), sysdate + 1)
    AND CBB.branch_party_id = BA.bank_branch_id
    AND SYSDATE < NVL(BA.END_DATE,SYSDATE+1)
    AND BA.ACCOUNT_CLASSIFICATION = 'INTERNAL'
    AND CBAU.ap_use_enable_flag = 'Y'
    AND CBAU.org_id = :pay_sum_folder.org_id
    AND NVL(BA.netting_acct_flag, 'N') <> 'Y'
    AND fnd_global.resp_name = 'XX PAYABLES SUPER USER'
    AND CBB.bank_name_alt = 'Head office bank'
    UNION ALL
    SELECT BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    CBAU.bank_acct_use_id ,
    BA.multi_currency_allowed_flag bank_multi_currency_flag,
    BA.zero_amount_allowed bank_zero_amounts_allowed,
    BA.account_owner_org_id legal_entity_id,
    CBB.bank_name,
    CBB.bank_branch_name
    FROM
    CE_BANK_ACCOUNTS BA,
    CE_BANK_BRANCHES_V CBB,
    CE_BANK_ACCT_USES_OU_V CBAU
    WHERE ((BA.multi_currency_allowed_flag = 'Y' AND
    (BA.currency_code = :pay_sum_folder.functional_currency_code or
    BA.currency_code = :parameter.pay_in_full_currency_code )) or
    BA.currency_code = nvl( :parameter.pay_in_full_currency_code, BA.currency_code))
    AND CBAU.BANK_ACCOUNT_ID = BA.BANK_ACCOUNT_ID
    AND sysdate between TRUNC(CBB.start_date) and nvl(TRUNC(CBB.end_date), sysdate + 1)
    AND CBB.branch_party_id = BA.bank_branch_id
    AND SYSDATE < NVL(BA.END_DATE,SYSDATE+1)
    AND BA.ACCOUNT_CLASSIFICATION = 'INTERNAL'
    AND CBAU.ap_use_enable_flag = 'Y'
    AND CBAU.org_id = :pay_sum_folder.org_id
    AND NVL(BA.netting_acct_flag, 'N') <> 'Y'
    AND fnd_global.resp_name != 'XX PAYABLES SUPER USER'

  • Help!  Crashing JVM while doing SELECT statement through JDBC-ODBC bridge

    Hi everyone,
    Help please. I am working on a project on my own computer using the jdk version 1.5.0_04.
    The project involves running a select on a Microsoft Access 2003 database via the JDBC-ODBC bridge. The database is registered in the ODBC database sources, and it works fine in those other projects.
    Yet, when I'm running similar code in this project, it crashes the Java Virtual Machine. I get the following in a log file:
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c901010, pid=2308, tid=1364
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_04-b05 mixed mode, sharing)
    # Problematic frame:
    # C [ntdll.dll+0x1010]
    --------------- T H R E A D ---------------
    Current thread (0x000360f8): JavaThread "main" [_thread_in_native, id=1364]
    siginfo: ExceptionCode=0xc0000005, reading address 0x00000018
    Registers:
    EAX=0x00000004, EBX=0x26bb5250, ECX=0x7ffde000, EDX=0x00000004
    ESP=0x0007f8d8, EBP=0x0007f8f0, ESI=0x00000000, EDI=0x02ea1590
    EIP=0x7c901010, EFLAGS=0x00010246
    Top of Stack: (sp=0x0007f8d8)
    0x0007f8d8: 74355a16 00000004 02ea15b4 7432139f
    0x0007f8e8: 02ea15b4 02ea1590 0007f900 74322c5d
    0x0007f8f8: 02ea15b4 000361b4 0007f914 74325fa0
    0x0007f908: 02ea1590 74350000 00390000 0007f930
    0x0007f918: 7432740e 02ea1590 0007f950 00000003
    0x0007f928: 00aabe20 000361b4 0007f948 6d3e11da
    0x0007f938: 02ea1590 0007f950 000360f8 26bb5250
    0x0007f948: 0007f980 00ad826f 00000000 0007f99c
    Instructions: (pc=0x7c901010)
    0x7c901000: 90 90 90 90 90 64 8b 0d 18 00 00 00 8b 54 24 04
    0x7c901010: 83 7a 14 00 75 4f f0 ff 42 04 75 19 8b 41 24 89
    Stack: [0x00040000,0x00080000), sp=0x0007f8d8, free space=254k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C [ntdll.dll+0x1010]
    C [ODBC32.dll+0x2c5d]
    C [ODBC32.dll+0x5fa0]
    C [ODBC32.dll+0x740e]
    C [JdbcOdbc.dll+0x11da]
    j sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
    j sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
    j sun.jdbc.odbc.JdbcOdbcConnection.createStatement(II)Ljava/sql/Statement;+27
    j sun.jdbc.odbc.JdbcOdbcConnection.createStatement()Ljava/sql/Statement;+7
    j LUDatabaseWorker.getBoxScoreFromDB(LStatisticalItems/BoxScore;)LStatisticalItems/BoxScore;+215
    j NewUSCHOLiveUpdate.processTheBoxScores()V+78
    j NewUSCHOLiveUpdate.main([Ljava/lang/String;)V+9
    v ~StubRoutines::call_stub
    V [jvm.dll+0x82696]
    V [jvm.dll+0xd6fd9]
    V [jvm.dll+0x82567]
    V [jvm.dll+0x895e6]
    C [java.exe+0x14c0]
    C [java.exe+0x64cd]
    C [kernel32.dll+0x16d4f]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
    j sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
    j sun.jdbc.odbc.JdbcOdbcConnection.createStatement(II)Ljava/sql/Statement;+27
    j sun.jdbc.odbc.JdbcOdbcConnection.createStatement()Ljava/sql/Statement;+7
    j LUDatabaseWorker.getBoxScoreFromDB(LStatisticalItems/BoxScore;)LStatisticalItems/BoxScore;+215
    j NewUSCHOLiveUpdate.processTheBoxScores()V+78
    j NewUSCHOLiveUpdate.main([Ljava/lang/String;)V+9
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x00a6e550 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2240]
    0x00a6d258 JavaThread "CompilerThread0" daemon [_thread_blocked, id=736]
    0x00a6c440 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2252]
    0x00a47808 JavaThread "Finalizer" daemon [_thread_blocked, id=3352]
    0x00a46328 JavaThread "Reference Handler" daemon [_thread_blocked, id=1560]
    =>0x000360f8 JavaThread "main" [_thread_in_native, id=1364]
    Other Threads:
    0x00a67a68 VMThread [id=2700]
    0x00a6f8c8 WatcherThread [id=2480]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 576K, used 404K [0x22b90000, 0x22c30000, 0x23070000)
    eden space 512K, 70% used [0x22b90000, 0x22bea738, 0x22c10000)
    from space 64K, 66% used [0x22c20000, 0x22c2a990, 0x22c30000)
    to space 64K, 0% used [0x22c10000, 0x22c10000, 0x22c20000)
    tenured generation total 1408K, used 846K [0x23070000, 0x231d0000, 0x26b90000)
    the space 1408K, 60% used [0x23070000, 0x231438e0, 0x23143a00, 0x231d0000)
    compacting perm gen total 8192K, used 507K [0x26b90000, 0x27390000, 0x2ab90000)
    the space 8192K, 6% used [0x26b90000, 0x26c0ed38, 0x26c0ee00, 0x27390000)
    ro space 8192K, 66% used [0x2ab90000, 0x2b0e9dc0, 0x2b0e9e00, 0x2b390000)
    rw space 12288K, 46% used [0x2b390000, 0x2b927e98, 0x2b928000, 0x2bf90000)
    Dynamic libraries:
    0x00400000 - 0x0040c000      C:\jdk1.5.0_04\bin\java.exe
    0x7c900000 - 0x7c9b0000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f4000      C:\WINDOWS\system32\kernel32.dll
    0x77dd0000 - 0x77e6b000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77e70000 - 0x77f01000      C:\WINDOWS\system32\RPCRT4.dll
    0x77c10000 - 0x77c68000      C:\WINDOWS\system32\MSVCRT.dll
    0x6d6b0000 - 0x6d839000      C:\jdk1.5.0_04\jre\bin\client\jvm.dll
    0x77d40000 - 0x77dd0000      C:\WINDOWS\system32\USER32.dll
    0x77f10000 - 0x77f56000      C:\WINDOWS\system32\GDI32.dll
    0x76b40000 - 0x76b6d000      C:\WINDOWS\system32\WINMM.dll
    0x629c0000 - 0x629c9000      C:\WINDOWS\system32\LPK.DLL
    0x74d90000 - 0x74dfb000      C:\WINDOWS\system32\USP10.dll
    0x6d2f0000 - 0x6d2f8000      C:\jdk1.5.0_04\jre\bin\hpi.dll
    0x76bf0000 - 0x76bfb000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d680000 - 0x6d68c000      C:\jdk1.5.0_04\jre\bin\verify.dll
    0x6d370000 - 0x6d38d000      C:\jdk1.5.0_04\jre\bin\java.dll
    0x6d6a0000 - 0x6d6af000      C:\jdk1.5.0_04\jre\bin\zip.dll
    0x6d3e0000 - 0x6d3ed000      C:\jdk1.5.0_04\jre\bin\JdbcOdbc.dll
    0x74320000 - 0x7435d000      C:\WINDOWS\system32\ODBC32.dll
    0x5d090000 - 0x5d127000      C:\WINDOWS\system32\COMCTL32.dll
    0x7c9c0000 - 0x7d1d5000      C:\WINDOWS\system32\SHELL32.dll
    0x77f60000 - 0x77fd6000      C:\WINDOWS\system32\SHLWAPI.dll
    0x763b0000 - 0x763f9000      C:\WINDOWS\system32\comdlg32.dll
    0x773d0000 - 0x774d2000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x20000000 - 0x20017000      C:\WINDOWS\system32\odbcint.dll
    0x774e0000 - 0x7761d000      C:\WINDOWS\system32\ole32.dll
    0x77120000 - 0x771ac000      C:\WINDOWS\system32\OLEAUT32.dll
    0x77fe0000 - 0x77ff1000      C:\WINDOWS\system32\Secur32.dll
    0x76fd0000 - 0x7704f000      C:\WINDOWS\system32\CLBCATQ.DLL
    0x77050000 - 0x77115000      C:\WINDOWS\system32\COMRes.dll
    0x77c00000 - 0x77c08000      C:\WINDOWS\system32\VERSION.dll
    0x0f9a0000 - 0x0f9ab000      C:\WINDOWS\system32\VBAJET32.DLL
    0x5ad70000 - 0x5ada8000      C:\WINDOWS\system32\uxtheme.dll
    VM Arguments:
    java_command: NewUSCHOLiveUpdate
    Environment Variables:
    JAVA_HOME=C:\jdk1.5.0_04
    CLASSPATH=C:\jdk1.5.0_04\bin\NewLiveUpdate;C:\jdk1.5.0_04\bin\NewLiveUpdate\StatisticalItems;C:\jdk1.5.0_04\bin\NewLiveUpdate\Exceptions;C:\jdk1.5.0_04\bin\NewLiveUpdate\Helper;
    PATH=C:\jdk1.5.0_04\bin;C:\JavaTools\ant\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;;c:\program files\devstudio\sharedide\bin\ide;c:\program files\devstudio\sharedide\bin;c:\program files\devstudio\vc\bin
    USERNAME=Kevin Yetman
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht
    Memory: 4k page, physical 1047020k(627436k free), swap 2518436k(2161900k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_04-b05) for windows-x86, built on Jun 3 2005 02:10:41 by "java_re" with MS VC++ 6.0
    The code that is causing the problem is in the class shown below. It is in the method getBoxScoreFromDB. When it attempts to run the first select statement, it causes the crash that I showed above.
    The connection is set up by the calling class. The calling class constructs a LUDatabaseWorker, sets the necessary parameters (dbURL, driver class, username and password), and calls the openDBConnection().
    // LUDatabaseWorker.java
    import StatisticalItems.*;
    import java.sql.*;
    import java.util.*;
    public class LUDatabaseWorker
       private StatisticalItems.BoxScore m_CurrentBoxScoreInDB;
       private Connection                m_Connection;
       private String                    m_dbURL;
       private String                    m_dbUsername;
       private String                    m_dbPassword;
       private String                    m_dbDriverClass;
       public LUDatabaseWorker()
       public StatisticalItems.BoxScore getCurrentBoxScoreInDB()
       {  return m_CurrentBoxScoreInDB;
       public void setDBURL(String dbURL)
       {  m_dbURL=new String(dbURL);
       public void setDBUsername(String dbUsername)
       {  m_dbUsername=new String(dbUsername);
       public void setDBPassword(String dbPassword)
       {  m_dbPassword=new String(dbPassword);
       public void setDBDriverClass(String dbDriverClass)
       {  m_dbDriverClass=new String(dbDriverClass);
       public void openDBConnection()
          throws SQLException, ClassNotFoundException
          Class.forName(m_dbDriverClass);
          m_Connection=DriverManager.getConnection(m_dbURL, m_dbUsername, m_dbPassword);
       public void closeDBConnection()
          throws SQLException
          m_Connection.close();
       public Hashtable<String, Integer> getUSCHOCodeToMyTeamIndexMap()
          throws SQLException
          Hashtable<String, Integer> ht=new Hashtable<String, Integer>();
          String sqlQuery="SELECT TeamIndex, TeamCode FROM TeamLiveUpdateUSCHO";
          Statement st=m_Connection.createStatement();
          ResultSet rs=st.executeQuery(sqlQuery);
          while(rs.next())
             String uschoCode=new String(rs.getString(2));
             Integer myTeamIndex=new Integer(rs.getInt(1));
             ht.put(uschoCode, myTeamIndex);
          rs.close();
          st.close();
          return ht;
       public StatisticalItems.BoxScore getBoxScoreFromDB(StatisticalItems.BoxScore luBoxScore)
          throws SQLException
          StatisticalItems.BoxScore  boxScoreFromDB=new StatisticalItems.BoxScore();
          // get the basic game info from the live update box score.
          StatisticalItems.Game    luBasicGameData=luBoxScore.getBasicGameData();
          // get the basic game data.
          String sqlQuery="SELECT * FROM Game WHERE (Year=" + luBasicGameData.getYear() + ") AND (Month='";
          if( luBasicGameData.getMonth() < 10 )
          {  sqlQuery+="0";
          sqlQuery+=luBasicGameData.getMonth() + "') AND (Day='";
          if( luBasicGameData.getDay() < 10 )
          {  sqlQuery+="0";
          sqlQuery+=luBasicGameData.getDay() + "') AND (HomeTeamIndex=" + luBasicGameData.getHomeTeamIndex();
          sqlQuery+=") AND (VisitorTeamIndex=" + luBasicGameData.getVisitorTeamIndex() + ")";
          System.out.println(sqlQuery);
          Statement st=m_Connection.createStatement();
          ResultSet rs=st.executeQuery(sqlQuery);
          if( rs.next() )
             StatisticalItems.Game  dbGame=boxScoreFromDB.getBasicGameData();
             dbGame.setGameIndex(rs.getInt("GameIndex"));
             dbGame.setHomeTeamIndex(rs.getInt("HomeTeamIndex"));
             dbGame.setVisitorTeamIndex(rs.getInt("VisitorTeamIndex"));
             dbGame.setHomeTeamGoals(rs.getInt("HomeTeamGoals"));
             dbGame.setVisitorTeamGoals(rs.getInt("VisitorTeamGoals"));
             dbGame.setHomeTeamScoredFirst(rs.getString("HomeTeamScoredFirst"));
             dbGame.setYear(rs.getInt("Year"));
             dbGame.setMonth(rs.getInt("Month"));
             dbGame.setDay(rs.getInt("Day"));
             dbGame.setLeagueGame(rs.getBoolean("LeagueGame"));
             dbGame.setNeutralSiteGame(rs.getBoolean("NeutralSiteGame"));
             dbGame.setForfeitHome(rs.getBoolean("ForfeitHome"));
             dbGame.setForfeitVisitor(rs.getBoolean("ForfeitVisitor"));
             dbGame.setPlayoffGame(rs.getBoolean("PlayoffGame"));
             boxScoreFromDB.setBasicGameData(dbGame);
          StatisticalItems.Game  dbGame=boxScoreFromDB.getBasicGameData();
          // get the home team goals per period.
          sqlQuery="SELECT * FROM GameDetailGoalsPerPeriod WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
          sqlQuery+="(TeamIndex=" + dbGame.getHomeTeamIndex() + ")";
          rs=st.executeQuery(sqlQuery);
          if( rs.next() )
             StatisticalItems.GameDetailGoalsPerPeriod dbHomeGPP=boxScoreFromDB.getHomeTeamGoalsPerPeriod();
             dbHomeGPP.setGameDetailGoalsPerPeriodIndex(rs.getInt("GameDetailGoalsPerPeriodIndex"));
             dbHomeGPP.setGameIndex(rs.getInt("GameIndex"));
             dbHomeGPP.setTeamIndex(rs.getInt("TeamIndex"));
             dbHomeGPP.setPeriod1(new Integer(rs.getInt("GoalsFirstPeriod")));
             dbHomeGPP.setPeriod2(new Integer(rs.getInt("GoalsSecondPeriod")));
             dbHomeGPP.setPeriod3(new Integer(rs.getInt("GoalsThidPeriod")));
             dbHomeGPP.setOvertime(new Integer(rs.getInt("GoalsOvertime")));
             dbHomeGPP.setEmptyNetGoals(rs.getInt("EmptyNetGoals"));
             dbHomeGPP.setFoundInDatabase(true);
             boxScoreFromDB.setHomeTeamGoalsPerPeriod(dbHomeGPP);
          // get the visitor team goals per period. 
          sqlQuery="SELECT * FROM GameDetailGoalsPerPeriod WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
          sqlQuery+="(TeamIndex=" + dbGame.getVisitorTeamIndex() + ")";
          rs=st.executeQuery(sqlQuery);
          if( rs.next() )
             StatisticalItems.GameDetailGoalsPerPeriod dbVisitorGPP=boxScoreFromDB.getVisitorTeamGoalsPerPeriod();
             dbVisitorGPP.setGameDetailGoalsPerPeriodIndex(rs.getInt("GameDetailGoalsPerPeriodIndex"));
             dbVisitorGPP.setGameIndex(rs.getInt("GameIndex"));
             dbVisitorGPP.setTeamIndex(rs.getInt("TeamIndex"));
             dbVisitorGPP.setPeriod1(new Integer(rs.getInt("GoalsFirstPeriod")));
             dbVisitorGPP.setPeriod2(new Integer(rs.getInt("GoalsSecondPeriod")));
             dbVisitorGPP.setPeriod3(new Integer(rs.getInt("GoalsThidPeriod")));
             dbVisitorGPP.setOvertime(new Integer(rs.getInt("GoalsOvertime")));
             dbVisitorGPP.setEmptyNetGoals(rs.getInt("EmptyNetGoals"));
             dbVisitorGPP.setFoundInDatabase(true);
             boxScoreFromDB.setVisitorTeamGoalsPerPeriod(dbVisitorGPP);
          // get the home team shots per period.
          sqlQuery="SELECT * FROM GameDetailShotsPerPeriod WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
          sqlQuery+="(TeamIndex=" + dbGame.getHomeTeamIndex() + ")";
          rs=st.executeQuery(sqlQuery);
          if( rs.next() )
             StatisticalItems.GameDetailShotsPerPeriod dbHomeSPP=boxScoreFromDB.getHomeTeamShotsPerPeriod();
             dbHomeSPP.setGameDetailShotsPerPeriodIndex(rs.getInt("GameDetailShotsPerPeriodIndex"));
             dbHomeSPP.setGameIndex(rs.getInt("GameIndex"));
             dbHomeSPP.setTeamIndex(rs.getInt("TeamIndex"));
             dbHomeSPP.setPeriod1(new Integer(rs.getInt("ShotsFirstPeriod")));
             dbHomeSPP.setPeriod2(new Integer(rs.getInt("ShotsSecondPeriod")));
             dbHomeSPP.setPeriod3(new Integer(rs.getInt("ShotsThidPeriod")));
             dbHomeSPP.setOvertime(new Integer(rs.getInt("ShotsOvertime")));
             dbHomeSPP.setFoundInDatabase(true);
             boxScoreFromDB.setHomeTeamShotsPerPeriod(dbHomeSPP);
          // get the visitor team shots per period. 
          sqlQuery="SELECT * FROM GameDetailShotsPerPeriod WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
          sqlQuery+="(TeamIndex=" + dbGame.getVisitorTeamIndex() + ")";
          rs=st.executeQuery(sqlQuery);
          if( rs.next() )
             StatisticalItems.GameDetailShotsPerPeriod dbVisitorSPP=boxScoreFromDB.getVisitorTeamShotsPerPeriod();
             dbVisitorSPP.setGameDetailShotsPerPeriodIndex(rs.getInt("GameDetailShotsPerPeriodIndex"));
             dbVisitorSPP.setGameIndex(rs.getInt("GameIndex"));
             dbVisitorSPP.setTeamIndex(rs.getInt("TeamIndex"));
             dbVisitorSPP.setPeriod1(new Integer(rs.getInt("ShotsFirstPeriod")));
             dbVisitorSPP.setPeriod2(new Integer(rs.getInt("ShotsSecondPeriod")));
             dbVisitorSPP.setPeriod3(new Integer(rs.getInt("ShotsThidPeriod")));
             dbVisitorSPP.setOvertime(new Integer(rs.getInt("ShotsOvertime")));
             dbVisitorSPP.setFoundInDatabase(true);
             boxScoreFromDB.setVisitorTeamShotsPerPeriod(dbVisitorSPP);
          // get the home team special teams.
          sqlQuery="SELECT * FROM GameDetailSpecialTeams WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
          sqlQuery+="(TeamIndex=" + dbGame.getHomeTeamIndex() + ")";
          rs=st.executeQuery(sqlQuery);
          if( rs.next() )
             StatisticalItems.GameDetailSpecialTeams dbHomeST=boxScoreFromDB.getHomeTeamSpecialTeams();
             dbHomeST.setGameDetailSpecialTeamsIndex(rs.getInt("GameDetailSpecialTeamsIndex"));
             dbHomeST.setGameIndex(rs.getInt("GameIndex"));
             dbHomeST.setTeamIndex(rs.getInt("TeamIndex"));
             dbHomeST.setPowerplayGoals(rs.getInt("PowerPlayGoals"));
             dbHomeST.setShorthandedGoals(rs.getInt("ShortHandedGoals"));
             dbHomeST.setPowerplayOps(rs.getInt("PowerPlayOps"));
             dbHomeST.setShorthandedOps(rs.getInt("ShortHandedOps"));
             dbHomeST.setPenalties(rs.getInt("Penalties"));
             dbHomeST.setPenaltyMinutes(rs.getInt("PenaltyMinutes"));
             dbHomeST.setFoundInDatabase(true);
             boxScoreFromDB.setHomeTeamSpecialTeams(dbHomeST);
          // get the home team special teams.
          sqlQuery="SELECT * FROM GameDetailSpecialTeams WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
          sqlQuery+="(TeamIndex=" + dbGame.getVisitorTeamIndex() + ")";
          rs=st.executeQuery(sqlQuery);
          if( rs.next() )
             StatisticalItems.GameDetailSpecialTeams dbVisitorST=boxScoreFromDB.getVisitorTeamSpecialTeams();
             dbVisitorST.setGameDetailSpecialTeamsIndex(rs.getInt("GameDetailSpecialTeamsIndex"));
             dbVisitorST.setGameIndex(rs.getInt("GameIndex"));
             dbVisitorST.setTeamIndex(rs.getInt("TeamIndex"));
             dbVisitorST.setPowerplayGoals(rs.getInt("PowerPlayGoals"));
             dbVisitorST.setShorthandedGoals(rs.getInt("ShortHandedGoals"));
             dbVisitorST.setPowerplayOps(rs.getInt("PowerPlayOps"));
             dbVisitorST.setShorthandedOps(rs.getInt("ShortHandedOps"));
             dbVisitorST.setPenalties(rs.getInt("Penalties"));
             dbVisitorST.setPenaltyMinutes(rs.getInt("PenaltyMinutes"));
             dbVisitorST.setFoundInDatabase(true);
             boxScoreFromDB.setVisitorTeamSpecialTeams(dbVisitorST);
          rs.close();
          st.close();
          return boxScoreFromDB;    
       public void updateBoxScoreInDB(StatisticalItems.BoxScore  dbBoxScore,
                                      StatisticalItems.BoxScore  luBoxScore,
                                      LUBoxScoreComparator       bsc)
          throws SQLException
          if( bsc.getGameChanged() )
             updateGameInDB(dbBoxScore, luBoxScore);
          if( bsc.getHomeGoalsPerPeriodChanged() )
             updateHomeGoalsPerPeriod(dbBoxScore, luBoxScore);
          if( bsc.getVisitorGoalsPerPeriodChanged() )
             updateVisitorGoalsPerPeriod(dbBoxScore, luBoxScore);
          if( bsc.getHomeShotsPerPeriodChanged() )
             updateHomeShotsPerPeriod(dbBoxScore, luBoxScore);
          if( bsc.getVisitorShotsPerPeriodChanged() )
             updateVisitorShotsPerPeriod(dbBoxScore, luBoxScore);
          if( bsc.getHomeSpecialTeamsChanged() )
             updateHomeSpecialTeams(dbBoxScore, luBoxScore);
          if( bsc.getVisitorSpecialTeamsChanged() )
             updateVisitorSpecialTeams(dbBoxScore, luBoxScore);
       protected void updateGameInDB(StatisticalItems.BoxScore dbBoxScore,
                                     StatisticalItems.BoxScore luBoxScore)
          throws SQLException
          // the only fields that NEED to be updated are HomeTeamGoals, VisitorTeamGoals, HomeTeamScoredFirst,
          // and LeagueGame.  You can't determine from the LU box Score:
          // Forfeits, NeutralSite, or Playoff.
          // the GameIndex, Both team indexes, and the game date will NEVER change from the database.
          Statement st=m_Connection.createStatement();
          String sqlStmt="UPDATE Game SET ";
          sqlStmt+="HomeTeamGoals=" + luBoxScore.getBasicGameData().getHomeTeamGoals() + ", ";
          sqlStmt+="VisitorTeamGoals=" + luBoxScore.getBasicGameData().getVisitorTeamGoals() + ", ";
          sqlStmt+="HomeTeamScoredFirst='" + luBoxScore.getBasicGameData().getHomeTeamScoredFirst() + "', ";
          sqlStmt+="LeagueGame=" + luBoxScore.getBasicGameData().getLeagueGame() + " ";
          sqlStmt+="WHERE GameIndex=" + dbBoxScore.getBasicGameData().getGameIndex();
          st.executeUpdate(sqlStmt);
          st.close();
       protected void updateHomeGoalsPerPeriod(StatisticalItems.BoxScore dbBoxScore,
                                               StatisticalItems.BoxScore luBoxScore)
          throws SQLException
          Statement st=m_Connection.createStatement();
          String sqlStmt="";
          if( dbBoxScore.getHomeTeamGoalsPerPeriod().getFoundInDatabase() )
             sqlStmt="UPDATE GameDetailGoalsPerPeriod SET ";
             sqlStmt+="GameIndex=" + dbBoxScore.getHomeTeamGoalsPerPeriod().getGameIndex() + ", ";
             sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamGoalsPerPeriod().getTeamIndex() + ", ";
             sqlStmt+="GoalsFirstPeriod=" + luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod1() + ", ";
             sqlStmt+="GoalsSecondPeriod=" + luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod2() + ", ";
             sqlStmt+="GoalsThirdPeriod=" + luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod3() + ", ";
             sqlStmt+="GoalsOvertime=" + luBoxScore.getHomeTeamGoalsPerPeriod().getOvertime() + ", ";
             sqlStmt+="EmptyNetGoals=" + luBoxScore.getHomeTeamGoalsPerPeriod().getEmptyNetGoals() + " ";
             sqlStmt+="WHERE GameIndex=" + dbBoxScore.getHomeTeamGoalsPerPeriod().getGameIndex() + " AND ";
             sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamGoalsPerPeriod().getTeamIndex();
          else
             sqlStmt="INSERT INTO GameDetailGoalsPerPeriod ";
             sqlStmt+="(GameIndex, TeamIndex, GoalsFirstPeriod, GoalsSecondPeriod, GoalsThirdPeriod, ";
             sqlStmt+="GoalsOvertime, EmptyNetGoals) VALUES(";
             sqlStmt+=dbBoxScore.getBasicGameData().getGameIndex() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getTeamIndex() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod1() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod2() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod3() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getOvertime() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getEmptyNetGoals() + ")";
          st.executeUpdate(sqlStmt);
          st.close();
       protected void updateVisitorGoalsPerPeriod(StatisticalItems.BoxScore dbBoxScore,
                                                  StatisticalItems.BoxScore luBoxScore)
          throws SQLException
          Statement st=m_Connection.createStatement();
          String sqlStmt="";
          if( dbBoxScore.getVisitorTeamGoalsPerPeriod().getFoundInDatabase() )
             sqlStmt="UPDATE GameDetailGoalsPerPeriod SET ";
             sqlStmt+="GameIndex=" + dbBoxScore.getVisitorTeamGoalsPerPeriod().getGameIndex() + ", ";
             sqlStmt+="TeamIndex=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getTeamIndex() + ", ";
             sqlStmt+="GoalsFirstPeriod=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod1() + ", ";
             sqlStmt+="GoalsSecondPeriod=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod2() + ", ";
             sqlStmt+="GoalsThirdPeriod=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod3() + ", ";
             sqlStmt+="GoalsOvertime=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getOvertime() + ", ";
             sqlStmt+="EmptyNetGoals=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getEmptyNetGoals() + " ";
             sqlStmt+="WHERE GameIndex=" + dbBoxScore.getVisitorTeamGoalsPerPeriod().getGameIndex() + " AND ";
             sqlStmt+="TeamIndex=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getTeamIndex();
          else
             sqlStmt="INSERT INTO GameDetailGoalsPerPeriod ";
             sqlStmt+="(GameIndex, TeamIndex, GoalsFirstPeriod, GoalsSecondPeriod, GoalsThirdPeriod, ";
             sqlStmt+="GoalsOvertime, EmptyNetGoals) VALUES(";
             sqlStmt+=dbBoxScore.getBasicGameData().getGameIndex() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getTeamIndex() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod1() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod2() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod3() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getOvertime() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getEmptyNetGoals() + ")";
          st.executeUpdate(sqlStmt);
          st.close();
       protected void updateHomeShotsPerPeriod(StatisticalItems.BoxScore dbBoxScore,
                                               StatisticalItems.BoxScore luBoxScore)
          throws SQLException
          Statement st=m_Connection.createStatement();
          String sqlStmt="";
          if( dbBoxScore.getHomeTeamShotsPerPeriod().getFoundInDatabase() )
             sqlStmt="UPDATE GameDetailShotsPerPeriod SET ";
             sqlStmt+="GameIndex=" + dbBoxScore.getHomeTeamShotsPerPeriod().getGameIndex() + ", ";
             sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamShotsPerPeriod().getTeamIndex() + ", ";
             sqlStmt+="ShotsFirstPeriod=" + luBoxScore.getHomeTeamShotsPerPeriod().getPeriod1() + ", ";
             sqlStmt+="ShotsSecondPeriod=" + luBoxScore.getHomeTeamShotsPerPeriod().getPeriod2() + ", ";
             sqlStmt+="ShotsThirdPeriod=" + luBoxScore.getHomeTeamShotsPerPeriod().getPeriod3() + ", ";
             sqlStmt+="ShotsOvertime=" + luBoxScore.getHomeTeamShotsPerPeriod().getOvertime() + " ";
             sqlStmt+="WHERE GameIndex=" + dbBoxScore.getHomeTeamShotsPerPeriod().getGameIndex() + " AND ";
             sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamShotsPerPeriod().getTeamIndex();
          else
             sqlStmt="INSERT INTO GameDetailShotsPerPeriod ";
             sqlStmt+="(GameIndex, TeamIndex, ShotsFirstPeriod, ShotsSecondPeriod, ShotsThirdPeriod, ";
             sqlStmt+="ShotsOvertime) VALUES(";
             sqlStmt+=dbBoxScore.getBasicGameData().getGameIndex() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getTeamIndex() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getPeriod1() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getPeriod2() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getPeriod3() + ", ";
             sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getOvertime() + ")";
          st.executeUpdate(sqlStmt);
          st.close();
       protected void updateVisitorShotsPerPeriod(StatisticalItems.BoxScore dbBoxScore,
                                                  StatisticalItems.BoxScore luBoxScore)
          throws SQLException
          Statement st=m_Connection.createStatement();
          String sqlStmt="";
          if( dbBoxScore.getVisitorTeamShotsPerPeriod().getFoundInDatabase() )
             sqlStmt="UPDATE GameDetailShotsPerPeriod SET ";
             sqlStmt+="GameIndex=" + dbBoxScore.getVisitorTeamShotsPerPeriod().getGameIndex() + ", ";
             sqlStmt+="TeamIndex=" + luBoxScore.getVisitorTeamShotsPerPeriod().getTeamIndex() + ", ";
             sqlStmt+="ShotsFirstPeriod=" + luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod1() + ", ";
             sqlStmt+="ShotsSecondPeriod=" + luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod2() + ", ";
             sqlStmt+="ShotsThirdPeriod=" + luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod3() + ", ";
             sqlStmt+="ShotsOvertime=" + luBoxScore.getVisitorTeamShotsPerPeriod().getOvertime() + " ";
             sqlStmt+="WHERE GameIndex=" + dbBoxScore.getVisitorTeamShotsPerPeriod().getGameIndex() + " AND ";
             sqlStmt+="TeamIndex=" + luBoxScore.getVisitorTeamShotsPerPeriod().getTeamIndex();
          else
             sqlStmt="INSERT INTO GameDetailShotsPerPeriod ";
             sqlStmt+="(GameIndex, TeamIndex, ShotsFirstPeriod, ShotsSecondPeriod, ShotsThirdPeriod, ";
             sqlStmt+="ShotsOvertime) VALUES(";
             sqlStmt+=dbBoxScore.getBasicGameData().getGameIndex() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getTeamIndex() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod1() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod2() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod3() + ", ";
             sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getOvertime() + ")";
          st.executeUpdate(sqlStmt);
          st.close();
       protected void updateHomeSpecialTeams(StatisticalItems.BoxScore dbBoxScore,
                                             StatisticalItems.BoxScore luBoxScore)
          throws SQLException
          Statement st=m_Connection.createStatement();
          String sqlStmt="";
          if( dbBoxScore.getHomeTeamSpecialTeams().getFoundInDatabase() )
             sqlStmt="UPDATE GameDetailSpecialTeams SET ";
             sqlStmt+="GameIndex=" + dbBoxScore.getHomeTeamSpecialTeams().getGameIndex() + ", ";
             sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamSpecialTeams().getTeamIndex() + ", ";
             sqlStmt+="PowerplayGoals=" + luBoxScore.getHomeTeamSpecialTeams().getPowerplayGoals() + ", ";
             sqlStmt+="PowerplayOps=" + luBoxScore.getHomeTeamSpecialTeams().getPowerplayOps() + ", ";
             sqlStmt+="ShorthandedGoals=" + luBoxScore.getHomeTeamSpecialTeams().getShorthandedGoals() + ", ";
             sqlStmt+="ShorthandedOps=" + luBoxScore.getHomeTeamSpecialTeams().getShorthande                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    its because you use hungarian notation - that was the hollywood squares answer.
    It looks like a bug in either the ntdll or the JdbcOdbc dll, so I'd see if you can't isolate the problem (like using a smaller bit of code) and file a bug report. Find out exacty what your sql statement is which causes this to crash - hint : line 215

  • Need to create a transaction for multiple select statements?

    Hello,
    I am a newbie and have a question about database transaction, e.g. whether/not to enclose multiple select statements (and select statements only) into a transaction.
    My database is set to transaction isolation level 2: REPEATABLE READ, where dirty read & non-repeatable read are not allowed, only phantom read is allowed.
    Now, in my code I have a number of methods that only contain select statements only. Since they are merely select statements, which don't do any modifications to the data, I am not sure if I am supposed to enclose them into a transaction.
    However, if I don't put them into a transaction will the transaction isolation level takes into effect automatically when another user is modifying the data that I am reading? In other words, I need to make sure the select statements will never do either dirty read or non-repeatable read. But I am not sure if it is necessary to enclose multiple select statements in a transaction, since I believe putting the select statements into a transaction will put some locks to the data being read which may reduce the concurrency of my application.
    Any help/advice would be very much appreciated.
    Duane

    You might want to try asking this on a forum that specific to your database. I suspect the answer can vary depending on the database and probably requires in depth knowledge of what the database does.

  • Change the default select statement in the execute_query function

    I want to list all records where c1 like '%ABD%'. So I set the following in the 'when_button_pressed' tigger:
    set_block_property ('block_name',DEFAULT_WHERE,'upper(c1) like '''||'%'||:block_name.blk_col_name||'%'||'''');
    execute_query;
    When I click on the button the :system.last_query holds the following select statement:
    select c1, c2, .. cn from t_n where upper(c1) like '%ABD%' and (upper(c1) = 'ABD' and (c1 like 'ab%' or c1 like 'aB%' or c1 like 'Ab%' or c1 like 'AB%')) order by c1
    Since the condition upper(c1) = 'ABD' is not satisfied oracle does not return any rows.
    My question is how to overcome this or is it possible to change the built-in select statement of execute_query.

    Have you tried this :
    'upper(c1) like upper('''||'%'||:block_name.blk_col_name||'%'||''''));

  • Urgent help on difficult programming  required -remove select statement

    loop at zt_wbs.
      clear   zt_cobrb.
      refresh zt_cobrb.
    Select settlement rules
      select distinct anln1 anln2 from cobrb
             into corresponding fields of table zt_cobrb
             where objnr = zt_wbs-objnr and
                   perbz = 'GES'        and
                   konty = 'AN'.
        if sy-subrc = 0.
          describe table zt_cobrb lines i.
          if i = 1.
        unique settlement rule
            read table zt_cobrb index 1.
            zt_changes-equnr = zt_wbs-equnr.
            zt_changes-anln1 = zt_cobrb-anln1.
            zt_changes-anln2 = zt_cobrb-anln2.
            collect zt_changes.
          endif.
        endif.
    endloop.
    hii...i can modify the structure of table zt_cobrb  if required. please tell me a code in which i can carry my select statements outside the loop.and do the same thing.
    remember there is a distinct keyword after select statement and i have to loop at zt_wbs having one of the fields objnr.

    loop at zt_wbs.
      clear   zt_cobrb.
      refresh zt_cobrb.
    Select settlement rules
      select distinct anln1 anln2 from cobrb
             into corresponding fields of table zt_cobrb
             where objnr = zt_wbs-objnr and
                   perbz = 'GES'        and
                   konty = 'AN'.
        if sy-subrc = 0.
          describe table zt_cobrb lines i.
          if i = 1.
        unique settlement rule
            read table zt_cobrb index 1.
            zt_changes-equnr = zt_wbs-equnr.
            zt_changes-anln1 = zt_cobrb-anln1.
            zt_changes-anln2 = zt_cobrb-anln2.
            collect zt_changes.
          endif.
        endif.
    endloop.
    hii...i can modify the structure of table zt_cobrb  if required. please tell me a code in which i can carry my select statements outside the loop.and do the same thing.
    remember there is a distinct keyword after select statement and i have to loop at zt_wbs having one of the fields objnr.

Maybe you are looking for