Problem with a declare statement

Hello

I don't get the right output by using the code below. Can you please help?

declare
number of v_aer1;
number of v_var1;
number of v_var2;
cursor c1 is
Select a.aer_id, a.seq_text in v_aer1, aer_text v_var1 an a.FIELD_ID WHERE the = 101506 and aer_id group 103000005274 by a.seq_text, a.aer_id, rowid = rowid in
(select min (rowid) in the aer_text where FIELD_ID = 101506 and aer_id = a.aer_id);
Start
I'm in c1
loop
For J in (select min (seq_text) in the v_var2 of aer_text where FIELD_ID = 101506 and aer_id = 103000005274)
loop
If v_var1! = v_var2 then
insert into test_today values (v_aer1, v_var1);
end if;
end loop;
end loop;
Exception when others then
Dbms_Output.put_line (' error ' |) SQLERRM);
End;


If you have any questions please let me know.

Thank you

Pravin.

Published by: BSM on December 8, 2011 23:34

Published by: BSM on December 8, 2011 23:38

Leaving aside the intent of the code, which could certainly be done with a single INSERT statement, if I understand what you're doing, the variables you declare and use in cursor statements are not actually met.

SQL> declare
  2     l_v number;
  3     cursor c1 is
  4        select 1 col into l_v from dual;
  5  begin
  6     for i in c1 loop
  7        dbms_output.put_line('Col is: '||l_v);
  8     end loop;
  9  end;
 10  /
Col is:

PL/SQL procedure successfully completed.

When you use a loop of implicit cursor like this, you need to refer to the record of cursor that is created for you. So, your code should look similar to this point is syntactically correct and at least semi-utile.

declare
   cursor c1 is
      select a.aer_id, a.seq_text
      from aer_text a
      WHERE a.FIELD_ID = 101506 and
            aer_id = 103000005274
      group by a.seq_text, a.aer_id, rowid
      having rowid in (select min(rowid) from aer_text
                       where FIELD_ID = 101506 and
                             aer_id = a.aer_id);
begin
   for i in c1 loop
      For J In (select min(seq_text)
                from aer_text
                where FIELD_ID = 101506 and aer_id = 103000005274) loop
         if i.seq_text != j.seq_text then
            insert into test_today values(i.aer_id, i.seq_text);
         end if;
      end loop;
   end loop;
End;

I was really very surprised to find that the in the variable bits in your cursor definitions do not throw an error in compiling.

John

Tags: Database

Similar Questions

  • Problem with variable declaration

    I'm developing a multiuser Flash application, using the smartfox Server 2.0, but I'll have a problem with defining/declaration of a variable/object/table and then access. I am trying to set the "curMap" (be it a variable, the matrix, the object, everything that works) within the following function, like the array returned by the server, "resObj". It works fine as long as I only call 'curMap' within this function (see you in line: r_txt.text = curMap ;)) However whenever I try to call the "curMap" on the coding of the image outside the function, it returns under the indefinite form or usually nothing.  Any ideas on how to properly / attribute this? I tried various things (such as _root, _global or setting the var "curMap" outside of the function) with no luck.

    Here is my Code:

    smartfox.onExtensionResponse = function (resObj:Object, type: String)
    {
    If (type is 'xml')
    {
    If (resObj._cmd is "getMap")
    {
    curMap = resObj.db [0];
    r_txt. Text = curMap;
    } Else if (resObj._cmd == "getSurr") {}
    surrMap = resObj.db;
    b_txt. Text = surrMap [0];
    }
    }
    }

    Thank you

    Make sure that you are trying to access this variable before it is defined.  That is to say, which resembles an asynchronous function for the code of this function will probably run AFTER the code that appears in the lines that follow the body of the function.

  • What is the problem with this WHERE statement?

    What is the problem with this WHERE statement?

    < cfquery datasource = "manna_premier" name = "kit_report" >
    SELECT SaleDate,
    TerritoryManager,
    Distributor,
    DealerID,
    Variable,
    US_Dealers.ID,
    DealerName,
    DealerAddress,
    DealerCity,
    DealerState,
    DealerZIPCode
    Orders, US_Dealers
    WHERE US_Dealers.ID EQ DealerID AND SaleDate BETWEEN #CreateODBCDate (FORM. Implementation) # AND #CreateODBCDate (FORM. End) #.
    ORDER BY SaleDate
    < / cfquery >

    It's driving me crazy!

    Syntax error (missing operator) in query expression ' US_Dealers.ID EQ DealerID

    You accidentally use the CF equals operator: "EQ".

    Instead of MS Access: «=»

    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver]...

    in a query expression. AND SaleDate BETWEEN #10/1/2009 #-October 18, 2009 #'.

    I don't see how CreateODBCDate() would produce these values.  But maybe it's just a quirk of the error message?

  • Problems with the declarations of Type in Oracle 9i

    Create OR replace Type Ty is object
    (
    attr1 varchar2 (30),
    attr2 Varchar2 (30),
    attr3 Varchar2 (30),
    Manufacturer Ty function return AS a result,
    Ty (p_attr1 IN Varchar2) constructor function
    Return self as RESULT,
    Constructor Function ty (p_attr1 IN Varchar2,
    p_attr2 IN Varchar2)
    Return to SELF, RESULT,
    Constructor Function Ty (P_attr1 IN Varchar2,
    P_attr2 IN Varchar2,
    P_attr3 IN Varchar2)
    Return self as RESULT
    );
    /
    Create OR replace Type body Ty like
    Ty function constructor return self as result that
    Start
    RETURN;
    End;
    Constructor function Ty(p_attr1 IN Varchar2) return
    SELF as RESULT that
    Begin
    COTTAGES. Attr1: = p_attr1;
    RETURN;
    End;
    Constructor Function Ty (p_attr1 IN Varchar2,
    P_attr2 IN Varchar2)
    Return self as RESULT that
    Begin
    COTTAGES. Attr1: = p_attr1;
    COTTAGES. Attr2: = P_attr2;
    RETURN;
    End;
    Constructor Function Ty (P_attr1 IN Varchar2,
    P_attr2 IN Varchar2,
    P_attr3 IN Varchar2)
    Return self as RESULT that
    Start
    COTTAGES. Attr1: = P_attr1;
    COTTAGES. Attr2: = P_attr2;
    COTTAGES. Attr3: = P_attr3;
    RETURN;
    End;
    End;
    /
    Declare
    T1 Ty: = Ty();
    Ty T2: = Ty ('A');
    T3 Ty: = Ty('B','C');
    T4 Ty: = Ty('D','E','F');
    Begin
    dbms_output.put_line (t1. Attr1);
    dbms_output.put_line (t2.attr1);
    dbms_output.put_line (t3. Attr1);
    dbms_output.put_line (t4. Attr1);
    End;
    T4 Ty: = Ty('D','E','F');
    *
    ERROR on line 5:
    ORA-06550: line 5, column 12:
    PLS-00307: too many statements of "TY" corresponds to this call
    ORA-06550: line 5, column 6:
    PL/SQL: Ignored Element
    ORA-06550: line 10, column 25:
    PLS-00320: the declaration of the type of the expression is incomplete or
    Malformed
    ORA-06550: line 10, column 3:
    PL/SQL: Statement ignored

    Please help me what is the problem with me? I use Oracle 9i release 2.

    You don't need to declare a constructor for "all" attributes - you get one automatically. Remove the declaration of the complete constructor function on all 3 attributes, and you will find your block works fine dbms_outputs.

  • Specific problem with pimples and States

    Hello

    I firstly apologize for use Google Translate :-(

    I have a problem with InDesign does not resolve. That's a digital publication.

    My goal is:

    A 'Gallery' button and the image of the ball appears with three buttons: "Previous Image", "Next Image" and "narrow Gallery.

    I don't want the Gallery either visible, or buttons that control, until the 'Gallery' button, so I think that all the buttons except 'Gallery' by selecting the option 'hidden until this active'.

    I want the gallery and the buttons that control, disappears when I press the "Close Gallery" button.

    What I call 'Gallery' is an image that fills the screen.

    After you have placed the image on your site have become the button property "Hidden until this that active."

    Then convert this key in order to several States (what I will call 'button States') and by successive Governments with the pictures I want to show in the gallery.

    I think that the interactions between the buttons.

    When the 'Gallery' button I attribute the following "I click on the '.

    -"Go to the State."

    -Hide the "Gallery".

    -Show 'narrow Gallery.

    -Show "previous image".

    -Show "next image".

    -Show "States of the button.

    "Previous Image" and "Next Image" buttons are assigned, respectively, to go to the previous state and go to the next State.

    When "Close Gallery" button I attribute the following "I click on the '.

    -Show "Gallery."

    -Hide 'narrow Gallery.

    -Hide "previous image".

    -Hide "next image".

    -Show "States of the button.

    "Previous Image" and "Next Image" buttons are assigned, respectively, to go to the previous state and go to the next State.

    When "Close Gallery" button I attribute the following "I click on the '.

    -Show "Gallery."

    -Hide 'narrow Gallery.

    -Hide "previous image".

    -Hide "next image".

    -Hide the "States of the button.

    I put it to the top and works correctly until I press "close". Then I hide buttons "Close Gallery", "previous image" and "next image" but it keeps me visible "Button States" showing the last image that was shown.

    Don't know how to solve this problem, and I'm going crazy!

    Please can someone help me?

    Maybe the solution is another approach, but without using "Folio overlays.

    Thank you very much.

    I moved your post to the DPS forum.

    I'm afraid of how you do this will not work with DPS.

    This should all be done with a multi state object. The first State would contain anything other than a button to access the first State. After that, set up each State with the appropriate buttons. Without seeing the file, it's a little hard for me to imagine exactly what you want to do.

  • Problem with 'if - ElseIf' statement with the mouse, click.

    I'm having a problem with the code IF ELSE use with a mouse click. I want whenever a user 'clicks' I want to run a particular block of code, up to 3 clicks, then nothing. I tried var meter click local and global but can't seem to cross the first '' if. '' That's what I have now (I use console.log () to keep track.

    Ready model I create a global var...

    Enter the code to run when the composition is fully charged here
    sym.getComposition () .getStage () .setVariable ('clickcnt', 1); //Set 1 meter

    var i = sym.getComposition () .getStage () .getVariable ('clickcnt');

    Console.log ("count starts at"+ i ");


    on the stage, I create an event 'click '...

    Insert the code for the mouse, click here
    var i = (sym.getComposition () .getStage () .getVariable ('clickcnt');)
    If (i = 1) {}
    Console.log ("counter is =" + i);
    c code
    sym.getComposition () .getStage () .setVariable ('clickcnt', 2); //Set against 2
    }
    ElseIf (i = 2) {}
    Console.log ("counter is =" + i);
    c code
    sym.getComposition () .getStage () .setVariable ('clickcnt', 3);
    //Set against 3
    }
    ElseIf (i = 3) {}
    Console.log ("counter is =" + i);
    c code
    sym.getComposition () .getStage () .setVariable ('clickcnt', 4);
    //Set against 4 to take away
    SYM. Play (100); //play scenario animation
    }
    else { //I'm using it to deny any additional clicks.} I don't know there is a good way to do this. I don't know him
    SYM. Stop (1000);
    Console.log ("End");
    }
    ;

    I when I run this it never happened the first if it's like the 'clickcnt' var is not getting updated or read correctly.

    Thank you

    Joel H

    try if (I == 1) double equal.

  • Problems with my timed State machien

    Hi all

    The project

    I'm trying to create a timed state machine that can scroll through a series of cooling-then-heating cycles, where every cold or heat function occurs during a specific period of time.
    For example, if I set the number of cycles to 20 cycles 'cool-then-heat', with a cool cycle lasts 10 seconds and a cycle of prolonged heat of 10 seconds, the program will run for 400 seconds and then stops.

    After initialization, a clock will start. In the cool loop, there will be a cool clock which is compared to all of the cool cycle time. If they are equal, continuous cooling, noto, if they are equal the progresses of program in a heat cycle.

    The cycle has estrogen to a clock of heat that will be compared to the heat set duration of the cycle. If hot clocks are not equal, heating continues, if they are equal the cycle estrogen is complete and the product is finished or running in another round of cool.

    Another round of cool is selected if the elapsed time (since the State apparatus has been initialized) matches both total managed program (i.e. the total length = 400 seconds).

    (I've also attached a drawing that explains the process I want schematically the state machine).

    The problem

    I have a few, but the first is I think I use the block of bad timing - in my VI, the clock of the tick is not starting from scratch when I press run. It is included in a while loop as I have reason to think it will be easier to run (for the computer) if I put a delay (without delay the state machine functions). Rather than from

    I have a small calculator that determines how long will be the run time in total (this value is compared to the length of time since the entry into force).

    If anyone no matter what other tasks that help sadjusting need me know - I'm very new to labview and want to pick up good practices on the way!

    There is also the express VI "out of time", you could use.

  • Problem with insert/update statements on the MS Access database

    Hi all

    Before posting this question, I did a search and found this thread.

    I have the same problem as pawel had (in this thread), i.e. cannot insert or update data in the Access database. However, the reason is not that I am using some keywords in my domain name - it has been several years using SQL, some things are 'unwritten' rules But this is the first time I try something in LV

    However, after losing all day for work that I expect to do the same morning in 1 hour, try many different options and debugging until the level low in the Toolbox of data base screw (building or higher), I saw some weird SQL statement being trained in-house - so I tried what Troy has tried.

    "password" is a reserved word in the Jet.  I just looked at MOManagers_M, but by changing the field "password" to 'passworda', it does the job.

  • Problems with the switch statement

    There everyone,

    I tried to build a page with 4 buttons. Each button is a symbol that contains 2 png´2 who are the drawings of the key. If you click on the button 1, he has to move on the screen. If you click it again it should back off. and if you click on another button button1 is active then button1 should return to the starting position and button 2 should come on the screen.

    I use a switch statement and a variable.

    composition ready, I used

    sym.setVariable("current","");

    to set the Variable

    each button (one of the png within the symbols), I used:

    var = sym.getComposition.getStage.getVariable ("current") courses;

    switch (current)

    {

    case ' ':

    SYM. Play ("in");

    break;

    case button1:

    SYM. Play ("out");

    break;

    by default:

    sym.getComposition.getStage.getSymbol (current) ("out") .play;

    SYM. Play ("in");

    break;

    }

    announcement each animation buttons are labels for the entrance and animation. There are also triggers that change the current variable on the stage

    sym.getComposition.getStage.setVariable ("current", "button1");

    If I test inside a browser and click the button nothing happens.

    I m what do not know my mistake.

    can someone help me?

    concerning

    Mr.Monsen

    Hello

    Some errors of syntax in red:

    class var = sym.getComposition () .getStage () .getVariable ("current");

    switch (current)

    {

    case ' ':

    SYM. Play ("in");

    break;

    case "button1":

    SYM. Play ("out");

    break;

    by default:

    sym.getComposition () .getStage () .getSymbol (current) ("out") .play;

    SYM. Play ("in");

    }

    sym.getComposition () .getStage () .setVariable ("current", "button1");

  • Problem with analysis - union statement

    Hi all

    I have an analysis where I use the union statement. I have 4 columns in the result and 4 columns in select statements.
    Each select statement is a single equipped with filters.
    The results are presented in two rows. In my understanding it #of of columns and type paired in the union statement, I should get 1 row of results (summary of the two).

    How can I check in BI which is the cause two appear in two lines instead of 1?

    Thank you.

    Published by: user8461308 on April 13, 2012 03:13

    Set property of a measure to pivot as SUM aggregation. If all the attributes displayed in 'Row' are exactly the same, OBIEE apply group by making the data.

    See you soon...

    Patrick
    [http://obieetipsandconcepts.blogspot.com/]

  • problem with sql default_where statement

    Hello gurus


    I use forms 6i, shaped with blocks of data AREA and the area euro1, their sources of data are derived from a table of unique 'space '.

    right side of the form displays the list of all the domain names (one attribute in a table) inserted before the trigger of when_new_form instance (i.e. Grenier1 block).

    by clicking on: AREA1.NAME I want to execute the details of corner table block area...

    to do this, I specified trigger on_mouse_click
       go_block('area');
       execute_query;
    and I call it a procedure on prior request

    Matching(:Area1.Name);


    Code of procedure of correspondence is

    PROCEDURE matching(c_name in varchar2) IS
    sql_state varchar2(100);
    BEGIN
      
      
      
       ----- if not null then
            
            if c_name is not null then 
            sql_state := 'UPPER(name)  like ''%'''||UPPER(c_name)||'''%'''; 
                     set_block_property('area',default_where,sql_state);     
            else
                  message('feild is empty');
                  end if;
             exception when others then
                  display_error;
      
      
    END; 
    It works only 2 or 3 times, but now it gives me the error FRM-40505 unable to execute the query
    There is no any element non-base of data on two blocks of

    What can be the problem, please


    Thank you
    like ''%' ||UPPER(c_name)|| '%''';
    
  • Problem with button 'Over' State

    I am just learning flash. I created a rectagle and converted to a button symbol. I got it so that it changes color when someone will find their mouse over it. However, I need the text there, too. My problem is that the symbol comes back to its original color when the mouse is over the text. I tried to make the text in the symbol, and I also tried to put above the symbol on the stage.

    I need the rectangel to stay in his "Over" State even when the mouse is over the text. Is this possible?

    Ian

    In the properties panel, make sure that the TextField is not defined to be selectable.  There is an icon it for this property activation or deactivation.

  • Problem with the MERGE statement

    Hi all

    We'll cover the following:

    create table xx_test1 (invoice_id number, line_group_number number, LINE_TYPE_LOOKUP_CODE          VARCHAR2(25) ,LINE_NUMBER                    NUMBER(15)  );
    

    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,1,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,1,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,2,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,2,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,3,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,3,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,4,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,4,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,5,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,5,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,12,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,12,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,7,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,7,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,8,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,8,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,9,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,9,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,10,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,10,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,11,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,11,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,12,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,12,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,13,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,13,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,14,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,14,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,15,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,15,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,16,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,16,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,17,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,17,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,18,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,18,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,19,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,19,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,20,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,20,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,21,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,21,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,22,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,22,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,23,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,23,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,24,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,24,'TAX',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,25,'ITEM',null);
    Insert into XX_TEST1 (INVOICE_ID,LINE_GROUP_NUMBER,LINE_TYPE_LOOKUP_CODE,LINE_NUMBER) values (131549,25,'TAX',null);
    

    So, if we want to MERGE this table and update the lines with below:

    merge into xx_test1 DST
             USING (SELECT  LINE_GROUP_NUMBER,
                  LINE_TYPE_LOOKUP_CODE,
                  ROW_NUMBER() over(order by LINE_TYPE_LOOKUP_CODE, LINE_GROUP_NUMBER) as LINE_NUM
             from xx_test1
            where INVOICE_ID = 131549
           
                 ) SRC
          ON (DST.LINE_GROUP_NUMBER = SRC.LINE_GROUP_NUMBER AND dst.LINE_TYPE_LOOKUP_CODE = src.LINE_TYPE_LOOKUP_CODE AND dst.invoice_id = 131549 )
          WHEN MATCHED THEN
             update
                set DST.LINE_NUMBER = SRC.LINE_NUM
                ;
    


    I get an error message:

    SQL error: ORA-30926: failed to get a stable set of rows in the source tables

    30926 00000 - "impossible to get a stable set of rows in the source tables.

    * Cause: A stable set of rows could not be achieved due to the large dml

    activity or one not deterministic where clause.

    * Action: Remove any non deterministic of the clauses and reissue of the dml.

    I don't know why I'm getting this. Any ideas?

    Version: 11g

    Kind regards

    Alex

    whenever I have this error I convert my fusion in a select to see what is duplication

    select dst.LINE_GROUP_NUMBER, dst.LINE_TYPE_LOOKUP_CODE, count(*)
    from xx_test1 DST
    join (SELECT  LINE_GROUP_NUMBER,
                  LINE_TYPE_LOOKUP_CODE,
                  ROW_NUMBER() over(order by LINE_TYPE_LOOKUP_CODE, LINE_GROUP_NUMBER) as LINE_NUM
             from xx_test1
            where INVOICE_ID = 131549
         ) SRC
     ON (DST.LINE_GROUP_NUMBER = SRC.LINE_GROUP_NUMBER AND dst.LINE_TYPE_LOOKUP_CODE = src.LINE_TYPE_LOOKUP_CODE AND dst.invoice_id = 131549 )
    group by dst.LINE_GROUP_NUMBER, dst.LINE_TYPE_LOOKUP_CODE
    having count(*) > 1
    

    you have 2 dst. LINE_GROUP_NUMBER, summer time. Combination of LINE_TYPE_LOOKUP_CODE this duplication.

  • Problem with a prepared statement

    Hi all

    I'm trying to insert a row in a database using a statement prepared as follows

                    String [] test = tester; for(int i = 0; i < employ.length; i++){ System.out.println(test);
    }
    String query = "insert into testing values(?,?,?,?,?,?,?,?,?,?,?,?)";
    PreparedStatement ps = null;
    try{
    ps = con.prepareStatement(query);
    if(connected){
    for(int i = 0; i < test.length; i++){
    String val = test[i];
    ps.setString(1, val);
    ps.executeUpdate();
    }
    }
    }catch(SQLException se){
    displayErrors(se);
    }
    Yet when I try to insert using this code I get a SQL exception SQL Exception: No value specified for parameter 2 I am not entering null's as that first for loop is to check and print out the contents of the array to the console to check for that. All the information is in the array, so I guess my question is how is there no value for parameter 2 when the array is full?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    801330 wrote:

    ps.setString(1, val);
    ps.executeUpdate();
    

    Yet, when I try to insert using this code, I get an SQL exception

    The SQL Exception: No value specified for parameter 2

    I am not entered null value because this first loop must check and print the content of the table on the console to verify that. All the information is in the table, so I guess my question is how is there no value for parameter 2 when the table is full?

    Because (1) you never set just the first parameter (2) don't you really want to run the PS each time through the loop? Isn't it? I have not guessed not.

    DB

  • problems with an if statement

    well, here it is guys: function popLoop (popArray, tracerArray) {}
    for (n = 0; n < popArray.length; n ++) {}
    trace (popArray.Length);
    trace (n);
    If (n = popArray.length) {}
    trace("sure");
    }
    }
    }

    popArray.length = 3 FYI

    So whats happening is I want the statement to execute via "popArray.length" [3] times.
    the loop contains commands to duplicate movies, but the thing is it stops after the end if statement.

    Anyone know why the if statement stops the loop for?

    use the double equal (==) to test for equality.

Maybe you are looking for

  • Satellite A20-S103: no internet - no media not connected when typing ipconfig

    Hello A few days ago I installed windows xp on my Toshiba (SA20-S103).I installed all the drivers, but the internet does not work. It telling me 'no media not connected' when you type Ipconfig. Anyone know if the problem has to do with the drivers fo

  • Update keeps failing

    I keep getting an icon indicating that the updates are ready to install, but every time I try to install an update always fails - microsoft SQL server 2005 express edition service pack 3 (KB955). Please explain why and tell me what I can do to instal

  • Touchpad on/off function is inactive + a few options

    Hello I have problem with my touchpad, some options are not active! But the others are ok. I take a capture of my problem... Please help me... also, I can't choose the feature edgemotion... but the option is available and it is active... + I can not

  • Update blackBerry Smartphones Blackberry Storm 9530?

    I discovered how to check up-to-date through updates wireless on my phone, but when I check to see if there is a sound telling me that there is not. I have the 4.7.0.148 version... I thought it was supposed to be version 5 help please?

  • Cisco VPN Client 2801 router

    Hello I installed a router cisco 2801 to accept vpn connections, I use the cisco vpn client and the tunnel is created and is being created of the its. However, I cannot ping my vlan (only those who have a nat inside the ACL, those who have not said I