Need help in Cursor exception

Hi,
I have a small code with implicit cursor to fetch rows from table unreadable_cards and then for each value fetched I lookup another table card_acnt for some values and update data in unreadable cards table. The code is as below
declare
v1 number;
begin
for v1 in (select engravedid from unreadable_cards where case_resolved=1)
loop
update unreadable_cards set serial_number = (select serial_number from card_account
where ticketid = v1.engravedid)
where engravedid = v1.engravedid;
update unreadable_cards set case_resolved=2
where case_resolved=1
and serial_number is not null;
end loop;
exception
when no_data_found then
update unreadable_cards set case_resolved=22
where ticketid = v1.engravedid;
when too_many_rows then
update unreadable_cards set case_resolved=23
where ticketid = v1.engravedid;
when others then
update unreadable_cards set case_resolved=24
where ticketid = v1.engravedid;
end;
Here I have problem writing values to the table as this error pops up for every reference to V1 in exception
PLS-00487: Invalid reference to variable 'V1'
I need to be able to raise all three exceptions within the loop so that v1 can be referenced and loop does not exit on encountering the exception and completes for every row fetched by cursor, so that I can track the status of each record on the basis of case_resolved value.
Any help would be highly appreciated
Thanks
Saurabh

Let me get that out of me.. I don't like your code
First thing you need to know is, you are not going to hit NO_DATA_FOUND exception in a UPDATE statement. If a update did not modify any row it will not raise NO_DATA_FOUND exception. Check this out
SQL> begin
  2    update emp set sal = sal+ 10 where 1=2;
  3  end;
  4  /
PL/SQL procedure successfully completed.
No exception there. So that is one thing you need to look at.
Second thing I don't like the way you have used WHEN OTHERS exception. What are the exception you are looking at? You should not be having a when others without RAISE. It a bug in the code. You need to fix that.
Assuming your logic behind assigning CASE_RESOLVED is like this.
CASE_RESOLVED = 2   means you have found an exact match for your UNREADABLE_CARDS.ENGRAVEDID in CARD_ACCOUNT.TICKETID
CASE_RESOLVED = 22 means you don't have a match for your UNREADABLE_CARDS.ENGRAVEDID in CARD_ACCOUNT.TICKETID
CASE_RESOLVED = 23 means you have multiple match for your UNREADABLE_CARDS.ENGRAVEDID in CARD_ACCOUNT.TICKETID
CASE_RESOLVED = 24 This does not make any sense. You need to drop this part.
You can do this, You don't need all that PL/SQL. Just a simple SQL like this will do.
merge into unreadable_cards x
using (
        select a.engravedid
             , max(b.serial_number) serial_number
             , case when count(b.serial_number) = 1 then 2
                    when count(b.serial_number) = 0 then 22
                    when count(b.serial_number) > 1 then 23
               end case_resolved
          from unreadable_cards a
          left
          join card_account b
            on a.engravedid = b.eticketid
         where a.case_resolved = 1
         group
            by a.engravedid
      ) y
   on (
        x.engravedid = y.engravedid
when matched then
update set x.serial_number = nvl(y.serial_number, x.serial_number)
          , x.case_resolved = y.case_resolved;
Above is a untested code. But should work. If any minor error fix it and you should be good to go.

Similar Messages

  • Need help in cursor.....!

    hi,
    I am working in oracle 8i. I am creating cursor in my pl/sql block for the following requirement.
    I need to update the ex_duty_cb amt and simultaneously i need to assign the ex_duty_cb amt
    for the opening_amt column.
    For ex..
    Below is the actual record
    ENTRY_NO OPENING_AMT EXCISE_DUTY EXCISE_DUTY_CB
    1626 2000 50 2200
    1627 3000 250 3300
    1628 4000 200 4400
    1629 5000 100 5500
    This is my requirement
    ENTRY_NO OPENING_AMT EXCISE_DUTY EXCISE_DUTY_CB
    1626 2000 50 2050
    1627 2050 250 2300
    1628 2300 200 2500
    1629 2500 100 2600
    Please help me.........!
    Below is the query....Please guide me....?
    declare
    cursor cur
    is select entry_no,excise_duty_ob + cess_on_ed_ob + hecess_on_ed_ob as
    opening_amt, excise_duty_cb
    from cenvat_trans
    where transaction_type = 'I'
    and to_date(to_char(bill_date,'MON'),'MON') = '01-jul-2007';
    begin
    open cur;
    for fr in cur loop
    update cenvat_trans
    set excise_duty_cb = fr.opening_amt;
    exit when cur%notfound;
    end loop;
    close cur;
    end;
    regards,
    jame

    SQL> select * from cenvat_trans;
      ENTRY_NO OPENING_AMT EXCISE_DUTY EXCISE_DUTY_CB
          1626        2000          50           2200
          1627        3000         250           3300
          1628        4000         200           4400
          1629        5000         100           5500
    SQL> merge into cenvat_trans c
      2  using (select entry_no,
      3         first_value(opening_amt) over(order by entry_no)+
      4         sum(prev_ex) over(order by entry_no) sm1,
      5         first_value(opening_amt) over(order by entry_no)+
      6         sum(excise_duty) over(order by entry_no) sm2
      7         from(
      8          select rowid,entry_no,opening_amt,
      9            excise_duty,excise_duty_cb,
    10            lag(excise_duty,1,0) over(order by entry_no) prev_ex
    11          from cenvat_trans)) v
    12  on (c.entry_no=v.entry_no)
    13  when matched then
    14  update set c.opening_amt = v.sm1,
    15      c.excise_duty_cb = v.sm2;
    4 rows merged.
    SQL> select * from cenvat_trans;
      ENTRY_NO OPENING_AMT EXCISE_DUTY EXCISE_DUTY_CB
          1626        2000          50           2050
          1627        2050         250           2300
          1628        2300         200           2500
          1629        2500         100           2600
    Message was edited by:
            jeneesh
    Oh..!
    Its too late..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need help: Got SO Exception when connecting to oracle

    I am using with oracle 9.2.0.1.0 on Linux, and java 1.3.1.
    I copied the classes12.jar file provided by oracle 9.2.0.1 to /usr/lib/java/jre/lib/ext directory.
    I did not have any problem compiling the program. However,
    I got the following error when running my program.
    Io exception: SO Exception was generated.
    Here is how I connect to the database.
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection (
    "jdbc.oracle.thin:user/password//@192.168.0.150/myDb");
    When I changed the following code I got a different error
    Connection con = DriverManager.getConnection (
    "jdbc.oracle.thin:user/[email protected]:1521:myDb");
    Io exception: Network Adapter could not establish the connection.
    Which code should I use, and what are these error
    messages mean ? Please help.

    Never mind. I found out what I did wrong. I need to start the listener
    lsnrctl

  • Need help with cursor selection in control panels

    I can't get my cursor to work in the control panel at the top of the screen, for example, when I select text and want to change the font size, etc.  It won't even select to change from font to paragraph mode.  Other issues are trying to choose the selection tool, which I can only do with the "V" shortcut tool--escape doesn't work, nor does the cursor choose the  icons.  Help!

    Windows? see InDesign tools and panels don't respond to mouse clicks (Windows 7/Vista)

  • Need help on cursors

    Hi,
    I am having issue with my cursor.
    My cursor declartion looks like below:
    Declare
    cursor c1 is
    select job_id,delayed_time
    from mail_test;
    Begin
    open c1;
    Loop
    Fetch c1 into m_job_id, m_delayed_time;
    IF c1%FOUND THEN
    --Exit when c1%NOTFOUND;
    dbms_output.put_line('hai');
    dbms_output.put_line(' Job '||m_job_id||' is delayed by '||m_delayed_time||' minutes, ');
    EXIT;
    END IF;
    END LOOP;
    close c1;
    End;
    In mail_test table only one row is there for job 1151, but the above code snippet is displaying 3 rows. Any problem with my looping because I want to display only one row.
    O/p
    hai
    Job 1151 is delayed by 184 minutes,
    hai
    Job 1151 is delayed by 184 minutes,
    hai
    Job 1151 is delayed by 184 minutes,
    Desired o/p:
    hai
    Job 1151 is delayed by 184 minutes,
    Please help me on this. Thanks

    I dont want to use any predicate for job_id bcoz I want to select all the records from that table.Strange, that sounds contradictionary: do you want to select all records or just one?
    Anyway:
    Your other options are changing the query to either:
    select distinct job_id
                   ,      delayed_time
                   from   mail_testor (dirty one)
    select job_id
                   ,      delayed_time
                   from   mail_test
                   where  rownum=1Or, if you just want the output once, but loop through all records, you can do something like:
    declare
      prev_id number;
    begin
      for rec in ( select job_id
                   ,      delayed_time
                   from   mail_test
      loop
        if prev_id != rec.job_id
        then
          dbms_output.put_line('hai');
          dbms_output.put_line(' Job '||rec.job_id||' is delayed by '||rec.delayed_time||' minutes ');
        end if;
        prev_id := rec.job_id;
      end loop;
    end; 

  • Need help with cursor def

    Hi I have seen some where in the code
    .what I could not understand is
    1.what does the e with clause in this code will do? where it is used frequently and what is the advantage?
    2.the temp_holding is a table with only one column.So is it like we can use with caluse in the cursor with only one columned tables?
    3.why is the AS keyword used in this?
    4.If I want to write a select staement for a cursor like this and see what is the data contained in the cursor ,how to write it ?
    thanks in adavnce for your help..
    OPEN lv_refcur FOR
    WITH TEMP_HOLDINGS AS
    SELECT A1.VENDOR_INSTRUMENT_ID,A1.DATA_SOURCE_CD FROM FI_IDX_BENCHMARK_HOLDINGS A1, FI_IDX_BENCHMARK B1, FI_IDX_SOURCE C1
    WHERE
    A1.PRICING_DT = pv_in_dt AND A1.DATA_SOURCE_CD = pv_in_data_src_cd AND A1.INDEX_CD = B1.INDEX_CD
    AND B1.INDEX_CD = C1.INDEX_CD AND C1.DATA_SOURCE_CD = A1.DATA_SOURCE_CD AND B1.IS_PA_REQUIRED = 'Y'
    UNION
    SELECT A2.VENDOR_INSTRUMENT_ID,A2.DATA_SOURCE_CD FROM FI_IDX_FORWARD_HOLDINGS A2, FI_IDX_BENCHMARK B2, FI_IDX_SOURCE C2
    WHERE
    A2.PRICING_DT = pv_in_dt AND A2.DATA_SOURCE_CD = pv_in_data_src_cd AND A2.INDEX_CD = B2.INDEX_CD
    AND B2.INDEX_CD = C2.INDEX_CD AND C2.DATA_SOURCE_CD = A2.DATA_SOURCE_CD AND B2.IS_PA_REQUIRED = 'Y'
    -- MDR START MC IGAR Disclosure change
    UNION
    SELECT
    A1.VENDOR_INSTRUMENT_ID,
    A1.DATA_SOURCE_CD
    FROM
    FI_IDX_BENCHMARK_HOLDINGS A1,
    FI_IDX_BENCHMARK B1,
    FI_IDX_SOURCE C1,
    fi_group_member GM
    WHERE
    A1.PRICING_DT = pv_in_dt
    AND GM.group_cd = 'BCGLBIDXPA'
    AND GM.purpose_cd = 'GLOBALIDX'
    AND A1.DATA_SOURCE_CD = GM.character_val
    AND A1.INDEX_CD = B1.INDEX_CD
    AND B1.INDEX_CD = C1.INDEX_CD
    AND C1.DATA_SOURCE_CD = pv_in_data_src_cd
    AND B1.IS_PA_REQUIRED = 'N'
    UNION
    SELECT
    A2.VENDOR_INSTRUMENT_ID,
    A2.DATA_SOURCE_CD
    FROM
    FI_IDX_FORWARD_HOLDINGS A2,
    FI_IDX_BENCHMARK B2,
    FI_IDX_SOURCE C2,
    fi_group_member GM
    WHERE
    A2.PRICING_DT = pv_in_dt
    AND GM.group_cd = 'BCGLBIDXPA'
    AND GM.purpose_cd = 'GLOBALIDX'
    AND A2.DATA_SOURCE_CD = GM.character_val
    AND A2.INDEX_CD = B2.INDEX_CD
    AND B2.INDEX_CD = C2.INDEX_CD
    AND C2.DATA_SOURCE_CD = pv_in_data_src_cd
    AND B2.IS_PA_REQUIRED = 'N'
    -- MDR END
    SELECT
    INSTRUMENT_ID,
    FUND_OR_INDEX_CD,
    PRICING_DT,
    FI_INSTRUMENT_ID,
    ISSUE_DESCRIPTION,
    TICKER,
    ISSUE_DT,
    STATED_MATURITY_DT,
    COUPON,
    STATE_CD,
    COUNTRY_CD,
    CURRENCY_CD,
    CALLABLE_FLAG,
    PUTABLE_FLAG,
    INSURED_FLAG,
    AMT_CD,
    REVENUE_SOURCE_CD,
    ISSUER_ID,
    NON_2A7_DIVER_ISSUER_ID,
    BLOOMBERG_MBS_TYPE,
    MBS_AGENCY_CD,
    ORIGINAL_TERM,
    DS_CLASS1_CD,
    DS_CLASS2_CD,
    DS_CLASS3_CD,
    MAX(LB_CLASS1_CD) LB_CLASS1_CD,
    MAX(LB_CLASS2_CD) LB_CLASS2_CD,
    MAX(LB_CLASS3_CD) LB_CLASS3_CD,
    MAX(LB_CLASS4_CD) LB_CLASS4_CD,
    GENERIC_INSTRUMENT_ID,
    MAX(SC_CLASS1_CD) SC_CLASS1_CD,
    MAX(SC_CLASS2_CD) SC_CLASS2_CD,
    MAX(SC_CLASS3_CD) SC_CLASS3_CD,
    MAX(SC_CLASS4_CD) SC_CLASS4_CD
    FROM (
    SELECT
    DISTINCT
    PV_FND_IDX_CD AS FUND_OR_INDEX_CD,
    IAI.FI_INSTRUMENT_ID AS FI_INSTRUMENT_ID,
    -- MC IGAR Disclosure
    decode( pv_in_data_src_cd, 'LBG', decode (I.INSTRUMENT_DOMAIN_CD, 'MBS', I.cusip, IAI.ALTERNATE_ID), IAI.ALTERNATE_ID) AS INSTRUMENT_ID,
    -- MC IGAR Disclosure
    pv_in_dt AS PRICING_DT,
    I.ISSUE_DESC AS ISSUE_DESCRIPTION,
    I.BLOOMBERG_TICKER AS TICKER,
    DECODE(pv_in_data_src_cd,'LBG',I.ISSUE_DT,NULL) AS ISSUE_DT,
    I.STATED_MATURITY_DT AS STATED_MATURITY_DT,
    I.COUPON AS COUPON,
    I.STATE_CD AS STATE_CD,
    I.COUNTRY_CD AS COUNTRY_CD,
    I.CURRENCY_CD AS CURRENCY_CD,
    I.CALLABLE_IND AS CALLABLE_FLAG,
    I.PUTABLE_IND AS PUTABLE_FLAG,
    DECODE(pv_in_data_src_cd,'LBG',I.INSURED_IND,NULL) AS INSURED_FLAG,
    I.AMT_CD AS AMT_CD,
    I.REVENUE_SOURCE_CD AS REVENUE_SOURCE_CD,
    I.MASTER_ISSUER_ID AS ISSUER_ID,
    I.NON_2A7_DIVER_ISSUER_ID AS NON_2A7_DIVER_ISSUER_ID,
    MBS.BLOOMBERG_MBS_TYPE AS BLOOMBERG_MBS_TYPE,
    MBS.MBS_AGENCY_CD AS MBS_AGENCY_CD,
    MBS.ORIGINAL_TERM AS ORIGINAL_TERM,
    NULL AS DS_CLASS1_CD,
    NULL AS DS_CLASS2_CD,
    NULL AS DS_CLASS3_CD,
    DECODE (S.CLASSIFICATION_SCHEME_CD, 'LBCC', S.CLASSIFICATION_LEVEL1_CD)
    AS LB_CLASS1_CD,
    DECODE (S.CLASSIFICATION_SCHEME_CD, 'LBCC', S.CLASSIFICATION_LEVEL2_CD)
    AS LB_CLASS2_CD,
    DECODE (S.CLASSIFICATION_SCHEME_CD, 'LBCC', S.CLASSIFICATION_LEVEL3_CD)
    AS LB_CLASS3_CD,
    DECODE (S.CLASSIFICATION_SCHEME_CD, 'LBCC', S.CLASSIFICATION_LEVEL4_CD)
    AS LB_CLASS4_CD,
    NULL AS GENERIC_INSTRUMENT_ID,
    DECODE (S.CLASSIFICATION_SCHEME_CD, 'SCIS', S.CLASSIFICATION_LEVEL1_CD)
    AS SC_CLASS1_CD,
    DECODE (S.CLASSIFICATION_SCHEME_CD, 'SCIS', S.CLASSIFICATION_LEVEL2_CD)
    AS SC_CLASS2_CD,
    DECODE (S.CLASSIFICATION_SCHEME_CD, 'SCIS', S.CLASSIFICATION_LEVEL3_CD)
    AS SC_CLASS3_CD,
    DECODE (S.CLASSIFICATION_SCHEME_CD, 'SCIS', S.CLASSIFICATION_LEVEL4_CD)
    AS SC_CLASS4_CD
    FROM
    INSTRUMENT I,
    INSTRUMENT_SECTOR S,
    TEMP_HOLDINGS H,
    INSTRUMENT_ALTERNATE_ID IAI,
    INSTRUMENT_MBS MBS,
    FI_IDX_INSTRUMENT FII
    WHERE
    H.DATA_SOURCE_CD = FII.DATA_SOURCE_CD
    AND H.VENDOR_INSTRUMENT_ID = FII.VENDOR_INSTRUMENT_ID
    AND FII.FMR_CUSIP = IAI.ALTERNATE_ID
    AND IAI.FI_INSTRUMENT_ID = I.FI_INSTRUMENT_ID
    AND IAI.FI_INSTRUMENT_ID = S.FI_INSTRUMENT_ID(+)
    AND IAI.FI_INSTRUMENT_ID = MBS.FI_INSTRUMENT_ID(+)
    AND IAI.ALTERNATE_ID_TYPE_CODE = 'FMR_CUSIP'
    GROUP BY INSTRUMENT_ID, FUND_OR_INDEX_CD, PRICING_DT, FI_INSTRUMENT_ID,
    ISSUE_DESCRIPTION, TICKER, ISSUE_DT, STATED_MATURITY_DT, COUPON, STATE_CD,
    COUNTRY_CD, CURRENCY_CD, CALLABLE_FLAG, PUTABLE_FLAG, INSURED_FLAG, AMT_CD,
    REVENUE_SOURCE_CD, ISSUER_ID, NON_2A7_DIVER_ISSUER_ID, BLOOMBERG_MBS_TYPE,
    MBS_AGENCY_CD, ORIGINAL_TERM, DS_CLASS1_CD, DS_CLASS2_CD, DS_CLASS3_CD,
    GENERIC_INSTRUMENT_ID;
    Edited by: 953115 on Dec 5, 2012 2:04 AM

    953115 wrote:
    1.what does the e with clause in this code will do? where it is used frequently and what is the advantage?The WITH clause is called subquery factoring, not easy to find in the manual if you don't know that
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#i2161315
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#i2077142
    >
    subquery_factoring_clause
    The WITH query_name clause lets you assign a name to a subquery block. You can then reference the subquery block multiple places in the query by specifying query_name. Oracle Database optimizes the query by treating the query name as either an inline view or as a temporary table.
    >
    Simply, it is like creating a view local to the query that can be used one or more times in the rest of the query. It has added benefits such as the potential to materialize the results, explicitly push predicates into the subquery, and perform hierarchical queries using the recursive feature.
    >
    2.the temp_holding is a table with only one column.So is it like we can use with caluse in the cursor with only one columned tables?No you can put any query in the WITH clause
    >
    3.why is the AS keyword used in this?Developer preference? It is optional when specifying a column alias, it seems many of the aliases in your query are unnecessary since they just duplicate the existing column name.
    4.If I want to write a select staement for a cursor like this and see what is the data contained in the cursor ,how to write it ?You can view the results from the cursor the same way as any select query, e.g.
    SQL> var c refcursor
    SQL> begin
      2    open :c for
      3      with test_data as
      4      (
      5      select 1 n, 'a' s from dual union all
      6      select 2 n, 'b' s from dual union all
      7      select 5 n, 'x' s from dual
      8      )
      9      select n, s, case when n > 2 then 'High' else 'Low' end y
    10      from test_data;
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SQL> print c
             N S Y
             1 a Low
             2 b Low
             5 x High

  • Need help for cursor

    Hi
    I have a pl/sql block..which is having one cursor with a select statement. This select statement will return values when proper values passed..sometimes it will return null. When it return null, I have to insert "invalid code " value into a table. Please find below pl/sql ..
    Please let me know any syntax errors....!!
    Begin
    v_sqlstmt:= ' select  distinct (oip.item_number) from
    ODM_ITEM_PARTS_PRDLINE_MAP map, ITEM_PRODU_292_D dim, odm_item_parts oip, listentry le
    where map.entry_id = dim.entry_id
    and le.entryid = dim.entry_id
    and map.object_id = oip.id
    and oip.subclass_id = 267726
    and le.entryvalue = '''|| v_pa||'''' ;
    dbms_output.put_line('v_sqlstmt' || v_sqlstmt);
    OPEN P_OUT_RESULT for v_sqlstmt ;
    v_out:=NULL;
                   LOOP
                    BEGIN
                     FETCH P_OUT_RESULT INTO v_item_number; --  already declared
                     exit when p_out_result%notfound;
                        IF  v_item_number is null then
                     insert into AIC_PPA_INFO (ITEM_NO,PPA_VAL,model_name) Values('Invalid Code',v_pa,v_modelname);
                      Commit;
                    END if;
                           end loop;
               close cursor;
    end ;
                  Thanks & Regards
    SA

    Wrong.
    Wrong using dynamic SQL (there's nothing dynamic about it).
    Wrong using literals and not bind variables.
    Wrong using a ref cursor.
    Wrong using an insert in a cursor fetch loop and not a single INSERT..SELECT cursor.
    There's nothing right about this code.

  • Need help on a exception error

    here s my program my problem is i keep getting a index out of bounds error and have no clue why heres the error followed by the code
    thanks in advance for any help
    java.lang.ArrayIndexOutOfBoundsException
         at graphics_class2.init(graphics_class2.java:37)
         at sun.applet.AppletPanel.run(AppletPanel.java:344)
         at java.lang.Thread.run(Thread.java:484)
    Exit code: 0
    No Errors
    public class graphics_class2 extends Applet {
    int dumyvarX = 150 ;
    int dumyvarY = 150 ;
    int n= 0;
    int j = 0;
    int i = 0;
    int[] nx ;
    int[] ny ;
    int[] x ;
    int[] y ;
    int polygonpositionX = 100;
    int polygonpositionY = 100;
    int centerpointX = 100;
    int centerpointY = 100;
    int adjusted_centerpointX = 0;
    int adjusted_centerpointY = 0;
    int maximum_vertices = 3;
    public void init() {
    nx = new int[maximum_vertices] ;
    ny = new int[maximum_vertices] ;
    x = new int[ maximum_vertices] ;
    y = new int[ maximum_vertices] ;
    nx[0]= 20; nx[1]=40; nx[2]=60; nx[3]=110;
    ny[0]= 170; ny[1]=100; ny[2]=170; ny[3]=220;
    adjusted_centerpointX = centerpointX + polygonpositionX;
    adjusted_centerpointY = centerpointY + polygonpositionY;
    for(i = 0; i < maximum_vertices; i++) {
    x[i] = nx[v ]+polygonpositionX ; // v is i just to lazy to retype it all out
    y[i] = ny[v ]+polygonpositionY ;
    public void paint(Graphics g) {
    g.setColor(Color.black);
    g.setColor(Color.cyan);
    for(i = 1; i <= 359; i++){
    for(n = 1; n <= maximum_vertices; n++){
    dumyvarX = nx[n]+polygonpositionX ;
    dumyvarY = ny[n]+polygonpositionY ;
    x[n] = (int)(dumyvarX * Math.cos(i)) ; // float or int?
    x[n] = (int)(dumyvarY * Math.sin(i)) ;
    g.drawPolygon(x,y,maximum_vertices) ;
    repaint();
    // g.setColor(Color.cyan);
    // g.drawPolygon(x,y,maximum_vertices) ;
    // g.fillPolygon(x,y,4);
    // g.drawLine(centerpointX+polygonpositionX,centerpointY + polygonpositionY,(int)(dumyvarX +(j) * Math.cos(i)), (int)(dumyvarY +(j ) * Math.sin(i)));
    // repaint();

    Your code:
    nx = new int[maximum_vertices] ;
    ny = new int[maximum_vertices] ;
    x = new int[ maximum_vertices] ;
    y = new int[ maximum_vertices] ;
    nx[0]= 20; nx[1]=40; nx[2]=60; nx[3]=110;
    ny[0]= 170; ny[1]=100; ny[2]=170; ny[3]=220;maximum_vertices is 3 and therefore space for 3 ints is allocated. You try to access 4 (0 -> 3) but there are only 3 (0 -> 2).

  • Need help moving cursor from MacBook to iBook G4 together...

    using my mouse. I bought a new MacBook, but still use my old iBook G4 and it works great too.
    I just can't figure out how to have the cursor go from one to another. I tried Synergy, but it became confusing when I tried to install and have now given up.
    Anyone have any solutions to this?
    Thanks.
    MacBook   Mac OS X (10.6.4)    

    I use Teleport between 3 Macs (similar to synergy)
    <http://www.versiontracker.com/dyn/moreinfo/macosx/22339>
    In my case I use my iMac's keyboard and mouse to tell my PowerMac G5 and my MacBook what to do.
    The PowerMac G5 and MacBook Teleports are configured to share, and the iMac is setup to control the other 2. It works very well for me. At worse, when I move my MacBook out of the office and back, I sometimes have to tell the iMac to stop using Teleport and then start again to re-acquire the MacBook. Otherwise it is great.

  • Need Help with cursor features

    I just got my first job at a media buying place in NYC, and I'm loving it! my daily tasks include entering data, creating tons and tons of spreadsheets, and interpreting data. I know, sounds boring, but I like it.
    Only problem I've been having deals with Excel. I have a type of dyslexia that makes it difficult to see the white space between lines. Contrary to the norm, I have no problem following left to right- or vice versa- however it is difficult to distinguish
    one line from the next because of it's vertical proximity. 
    For example when I read, I often re-read the line I just finished because I lose my spot when I shift my eyes.
    I was wondering if anyone knew of cursor features on excel that follows my cursor using dotted lines- sort of an X,Y coordinate feature- from the top and side tab. It'd make my life a whole lot easier especially if the dotted lines are a different color
    from the background.
    Any input would be great. I'm sure there's a feature, I just cant find it.
    Greatly Appreciated,
    -JS

    Unfortunately there is no feature in Excel to do what you describe, not sure if Windows provides something like that as a general utility.
    However it should be possible to develop an Excel macro to draw a line that follows the cursor. I have in mind something like press and keep depressed a key (say F9),and if/as the cursor moves a trail will follow, release the key and the macro terminates.
    Optionally the trail could be cleared when the key is released, or cleared next time the key is depressed. That's all subject to developing and testing but would something along those lines be useful? If so explain anything else that's relevant or would be
    useful.

  • Need help with cursor ...

    Hi there,
    I don't know what I did wrong, but the cursor in my project became an horizontal arrow with which I can't no longer highlight clips ...
    I can't point anything...
    The cursor still looks fine on the top of the TL
    How can I go back ?
    Many thanks
    Ivan

    It sounds like you activated the Select Track Forward Tool. If you pressed t while editing, it turns this on. Simply press a or click on the normal pointer in the Tool Palette on the right.

  • Need help about ref cursor using like table

    Hi Guys...
    I am devloping package function And i need help about cursor
    One of my function return sys_refcursor. And the return cursor need to be
    join another table in database . I don't have to fetch all rows in cursor
    All i need to join ref cursor and another table in sql clause
    like below
    select a.aa , b.cc form ( ref_cursor ) A, table B
    where A.dd = B.dd
    I appeciate it in advance

    My understanding is that you have a function that returns a refcursor and is called by a java app.
    Because this is a commonly used bit of code, you also want to reuse this cursor in other bits of sql and so you want to include it like table in a bit of sql and join that refcursor to other tables.
    It's not as easy as you might hope but you can probably achieve this with pipelined functions.
    Is it a direction that code should be going down? yes, eventually. I like the idea of pulling commonly used bits of code into a SQL statement especially into the WITH section, provided it could be used efficiently by the CBO.
    Is it worth the effort given what you have to do currently to implement it? possibly not.
    what else could you do? construct the sql statement independently of the thing that used it and reuse that sql statement rather than the refcursor it returns?
    Message was edited by:
    dombrooks

  • Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset pref

    Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset preferences and still have problem. Slow to open and in force quit "Photoshop not responding" At this point should I uninstall and start over.

    What are the performance Preferences?

  • Need help ASAP : Exception with EJB 3.0 while session.xml

    Hi,
    Kindly help on below exception, which i am getting the exception while changing the mine EJB 2.1 to 3.0.
    Exception raised while loading the session.xml, which is reffering to map file which is used by Toplink.
    **Mine EJB:**
    public class CaseSessionEJBBean implements CaseSessionEJB {
    String inBean="[CaseSessionEJBBean] ";
    private SessionFactory sessionFactory;
    public CaseSessionEJBBean() {
    this.sessionFactory =new SessionFactory("META-INF/sessions.xml", "moj");
    *private SessionFactory getSessionFactory() {*
    return this.sessionFactory;
    *}* public PagedResultList<CasedetailsDTO> searchPayment(SearchCriteriaDTO searchCriteriaDTO,Integer startIndex,Integer endIndex) throws MOJException{
    String inMethod="[searchPayment] ";
    PagedResultList pagedCaseDetailsDTOList=null;
    try{
    System.out.println("[CaseSessionEJBBean] !!!! ENTERED !!!!!");
    Session session = getSessionFactory().acquireSession();
    CaseFacade caseFacade = new CaseFacade();
    pagedCaseDetailsDTOList=caseFacade.searchPayment(session, searchCriteriaDTO,startIndex,endIndex);
    System.out.println("pagedCaseDetailsDTOList.size()="+pagedCaseDetailsDTOList.size());
    }catch(Exception e){
    e.printStackTrace();
    System.out.println("[Exception] While getting payment details:"+e);
    throw new MOJException("1001", e.getMessage(),
    "Exception occured",
    "Exception in searchPayment()",
    "searchPayment", "CaseSessionEJBBean",
    "searchPayment", e);
    return pagedCaseDetailsDTOList;
    Exception:
    Exception Description: Several [1] SessionLoaderExceptions were thrown:
    Exception [TOPLINK-9005] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.SessionLoaderException
    Exception Description: *An exception was thrown while loading the <project-xml> file [META-INF/MOJMap.xml].*
    Internal Exception: oracle.classloader.util.AnnotatedLinkageError: duplicate class definition: oracle/toplink/indirection/IndirectList
    Invalid class: oracle.toplink.indirection.IndirectList
    Loader: current-workspace-app.root:0.0.0
    Code-Source: /D:/MOJ_SVN/Lib/toplink.jar
    Configuration: <library> in /D:/Temp/MOJ_EJB_3.0/CMS-oc4j-app.xml
    Dependent class: oracle.toplink.internal.helper.ConversionManager
    Loader: oracle.toplink:10.1.3
    Code-Source: /D:/jdevstudio/toplink/jlib/toplink.jar
    Configuration: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in D:\jdevstudio\j2ee\home\oc4j.jar
    The original class instance was also defined in oracle.toplink:10.1.3.
    Thanks in Advance:
    Need in urgent
    Edited by: user636100 on Feb 6, 2009 7:44 AM

    You have two copies of toplink.jar visible to the application classloader - D:/MOJ_SVN/Lib/toplink.jar should be removed.
    For compilation of the application use toplink.jar provided by the server: D:/jdevstudio/toplink/jlib/toplink.jar

  • Need help to find photo's on my backup drive,since installing Mountain Lion cannot find where they are stored.The backups after ML install are greyed out except in Applications, MyFiles and Devices really welcome a hand with this please.

    I need help to find my photo's please (2500) on my backup drive.Lost them after doing a clean install of Mountan Lion I have tried to find them but had no luck.  I use Time Machine with a 1TB Western Digital usb drive. Thanking anyone in anticipation of a solution.

    -Reece,
    We only have 1 single domain, 1 domain forest, no subdomains, only alias. I had replied to the other post as well. But I am happy to paste it here in case anyone want to read it.
    So, after a few months of testing, capture and sending logs back and forth to Apple Engineers, we found out there is a setting in AD, under User Account that prevent us to log into AD from Mountain Lion. If you would go to your AD server, open up a user account properties, then go to Account tab, the "Do not require Kerberos preauthentication" option is checked. As soon as I uncheck that option, immediately I was able to log into AD on the Mac client. Apple engineers copied all my AD settings and setup a test environment on their end and match exact mine AD environment. They was able to reproduce this issue.
    The bad part about this is... our environment required the "Do not require Kerberos preauthentication" is checked in AD, in order for our users to login into some of our Unix and Linux services. Which mean that it is impossible for us to remove that check mark because most, if not all of them some way or another require to login into applications that run on Unix and Linux. Apple is working to see if they can come up with a fix. Apparently, no one has report this issue except us. I believe most of you out there don't have that check mark checked in your environment... Anyone out there have any suggestion to by pass or have a work around for this?

Maybe you are looking for

  • Opening a web page progresses the module

    Captivate 2.0 We entered a link to open a webpage containing a related lesson. The lesson opens just fine in a new window. However, the lesson itself progresses as if the user clicked on a continue button or text box. Is there a workaround for this?

  • How to receive podcast in Mail

    Howdy I have been receiving a podcast in my Mail program for years-after I bought a new iMac w/ML, it no longer shows up. I would like to get the podcast back in my mail account, haven't found anythng here or on the net that will help-will appreciate

  • Lightroom 3 keeps crashing in "Develop"?

    I have recently installed Lightroom 3 and have been copying transparances. When attempting to improve images in "Develop", Lightroom 3 regularly crashes before reappearing and then continues to crash. Can anyone please advise? I use XP and there is p

  • How to building a multi-channels analog output task in visual c++ 6.0 (without Measurement Studio)?

    Hello!  I have a PCI 6251 card, and using DAQmx C function to generate a wavwform. (single channel ). But, how to creating a multi-channels analog output task, and had a different frequence in each channels? Thanks.

  • Removing 3750 from stack

    I have a 3750-12S-S which was the third switch in a stack of 3 3750. We want to run it as a seperate switch in a different location so I removed it from the stack by powering it off, unplugging the stack cables and then powering it up again. When the