Arrays are objects — really?

Dear experts and gurus,

More I read the more I am confused. Every now and then the talk is "JS arrays are objects and where they are passed by reference. However, simple experiences leave my perplexed: it is the same as for light (depending on the view, it behaves as waves or particles):

gaSomething = ["a","b", "c"];
Update (gaSomething);
alert (gaSomething.join("\n"));         // the global array has changed

DeleteItem (gaSomething, "7");
alert (gaSomething.join("\n"));         // the global array has not changed

function Update (array) {
  for (var j= 0; j < 9; j++) {
    array.push(j+1); 
  }
}

function DeleteItem (array, item) {
  var index = IsInArray (array, item);
  var lower = array.slice (0, index);   // lower part
  var upper = array.slice (index+1);    // upper part
  var locArray    = lower.concat(upper);
  array = locArray;                     // transfer data
alert ("in DeleteItem:\n" + array.join("\n"));
}


The only safe assumption is that JS arrays are not treated like objects and are therefore passed by value. It is so difficult to implement functions to remove items from several bays: for each table a separate function is necessary!

Any ideas for a general DeleteItem function?

Hi Klaus,

It's very dangerous!

1 array.length = array.length - 1 means: remove the last item in an array

Array.Length = array.length - 5 removes the last 5 items in a table

Delete array [index] Deletes only the VALUE of the element.

When you sort, it's the end of the array and so you have managed to delete.

My code in my last post IS WRONG:

It must be:

  1. for (var j = 9; > 5; j - j) {}
  2. Array.Slice (j, 1);
  3. }

However, I want to remove an item in the table. Unfortunately, there is no function of welding in'RE...

It's slice - do Splice not!

Need to remove reverse items.

Try this function. It removes 3 and 2 points

function DeleteItem (array, index)
{
 $.writeln(array);
 for (var j=3 ; j > 1; j --)
    {
    $.writeln("delete: " + array[j]);
    array.splice(j,1);
    $.writeln(array);
    }  

}

Tags: Adobe FrameMaker

Similar Questions

  • An array of objects with a filling loop. Noob PHP question.

    Hey guys,.

    You are all such a great help! Here's another one for you, the simple code below should create an array of objects of pizza (and it does) then display each item in the order. However... each object in the table seems to inherit the properties of everything what was the last item entered for a reason any.

    Copy the following code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <?php
    class pizza{
              public $price;
              public $description;
              public $name;
    }
    
    
    
    
    $menu2=fopen("pizzaMenu2.txt","r") or exit("System Error!");
    $pizzas = array();
    $arraypos=0;
    
    //This loop does all of the READING and populating of variables
    while(!feof($menu2))
      {
                //First get the array position
                                  $arraypos = (int)fgets($menu2);
    
              //Then Put in Title in title2 array
                                  $pizzas[$arraypos2] = new pizza(0,0,0);
                                  $pizzas[$arraypos2]->title = fgets($menu2);
                                  $pizzas[$arraypos2]->description = fgets($menu2);
                                  $pizzas[$arraypos2]->price = fgets($menu2);
      } //End of reading loop
    
    
    //begin writing data
    $arraypos=1;
    while ($arraypos <=3){
              echo "the array is in position: ".$arraypos;
              echo "<br />";
              echo $pizzas[$arraypos2]->title;
              echo "<br />";
              echo $pizzas[$arraypos2]->description;
              echo "<br />";
              echo $pizzas[$arraypos2]->price;
              echo "<br />";
              $arraypos++;
    }//end of writing data loop
    
    fclose($menu2);
    ?>
    <body>
    </body>
    </html>
    
    

    This returns:

    the array is in position: 1
    Test Pizza Two 
    The same as one with an extra one, yum! 
    22.99
    the array is in position: 2
    Test Pizza Two 
    The same as one with an extra one, yum! 
    22.99
    the array is in position: 3
    Test Pizza Two 
    The same as one with an extra one, yum! 
    22.99
    

    When it should return this:

    the array is in position: 1
    Test pizza One 
    Loaded with all that test pizza goodness! Lots and lots of ones 1111! 
    11.99 
    the array is in position: 2
    Test Pizza Two 
    The same as one with an extra one, yum! 
    22.99
    the array is in position: 3
    Test Threeza! 
    Do you see what I did there? I added a three to pizza, hahaha, I am so punny. 
    33.33 
    

    using the following text file pizzaMenu2.txt:

    1
    Test pizza One
    Loaded with all that test pizza goodness! Lots and lots of ones 1111!
    11.99
    3
    Test Threeza!
    Do you see what I did there? I added a three to pizza, hahaha, I am so punny.
    33.33
    2
    Test Pizza Two
    The same as one with an extra one, yum!
    22.99
    
    

    Now, I did line-by-line analysis and showed that the values are entered in the objects in the appropriate table, but everything that happens ultimately crushes all other objects, so ultimately, I have 3 objects in my table which are all the same. I don't know what I'm missing here.

    $pizzas [$arraypos2]

    must be:

    $pizzas [$arraypos]

  • indexOf() function for search object. &lt; property &gt; in an array of objects

    Hello world!
    OK, I know that the subject of this sounds a little awkward wire, with an example, it will be much clearer.
    I have a series of tables that contain strings, now named "label"; These tags can only produce only once in each table (which is therefore a 'set' of the mathematical definition of 'package', tags), but more than one table may contain a given tag (intersections of the sets are not always zero).
    I want to write a function that goes through all the tags in all tables and counties, which gives the result in a separate table called tag_counter that contains the objects of the tag. A tag object contains two fields: 'value', which is the tag itself, and 'events', which takes account of the time the tag was found.
    The function logic is simple: for each table, cycle all its labels. If the tag already exists in the tag_counter table, increment the counter 1; If not, add a new entry in the table with the given tag tag_counter. The line in bold-italics is exactly in the place of my question, because I don't know how to search within an array of objects by a property of such an object. Here is the code:

    private function harvest_tags(dt:DataTable):Array {
        var tag_counter:Array = new Array();
        
        for each(var site_feeds:Object in dt.data) {    //cycle through the Arrays
            for each(var tag:String in site_feeds.t) {  //cycle through the tags
                if(tag == '') continue;     //in case an empty tag is found, skip it
                tag = tag.replace(',', ''); //strip commas
                var i:int = tag_counter.indexOf(tag); //this needs fixing!
                if(i != -1) {
                    tag_counter[i].occurrences++;
                 }
                else {
                     tag_counter.push(new Tag(tag));
                 }
             }
         }
    
         tag_counter.sortOn("occurrences", Array.NUMERIC | Array.DESCENDING);
         return tag_counter;
    }
    

    and the class of tag definition:

    public class Tag {
            private var value:String;
            public var occurrences:Number;
            
            public function Tag(value:String) {
                this.value = value;
                this.occurrences = 1;
            }
    }
    

    Any help would be greatly appreciated.

    Andrea

    I think you want to use a hash table.  The object class is often used for this.  It is much faster than searching for an array of strings.

    private void harvest_tags(dt:DataTable):Array {}

    var tag_counter:Object = new Object();

    for each (var site_feeds:Object in dt.data) {//cycle through the berries

    for each (var: string tag in site_feeds.t) {//cycle by tags

    if(tag == '') continue;     where is an empty tag, pop it

    tag = tag.replace (',', "); Strip commas

    If (tag_counter [tag])

    tag_counter [tag] ++;

    on the other

    tag_counter [tag] = 1;

    }

    }

    var tag_array:Array = new Array();

    for {(var p:String in tag_counter)

    var tagObj:Tag = new Tag (p);

    tagObj.occurences = tag_counter [p];

    }

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • FGV VI within the class method called the array of objects in a for loop

    I have an array of objects connected to the loop for I call the VI method on the object in the loop for. If the method uses/calls some VI with state/memory (such as FGV) State is shared for each method call in a loop despite the called VI is reentrant preallocated. Someone knows how to fix this?

    NVM. I found an answer:

    https://lavag.org/topic/19014-dynamic-dispatch-shared-reentrancy/

  • [Q] can Vision track multiple objects in the same area - objects that might cross?

    Hello

    Sorry for this long title, but this is my question.

    Can Vision track multiple objects in the same area - objects that could cross?

    Because I'm able to do, extraction of XY, but it seems that "IMAQ County objects ' don't follow framework after but framework opposed, but extract the coordinates XY always in the same way, as for example from top and whenever he sees an object, it retrieves the XY, but if the objects pass through (then it will extract XY without worrying that the objects was the earlier but just based on"scan from top to bottom").

    That's why I open this topic in the forum of Vision no part: http://forums.ni.com/t5/LabVIEW/Sort-XY-by-closest/td-p/2440428

    Thank you

    Sébastien

    Thank you for your response.

    My problem is that we work with very small insects and the shape/color is the same for all.

    Then the solution is: Let's wait for "IMAQ County objects 3 ' then .

    Thank you

    Sébastien

  • Why peope post Questions that are not really questions and are locked from future responses?

    Why peope post Questions that are not really questions and are locked from future responses?

    These positions are known as sticky messages, Faustin - Sticky post' a sticky or sticky post is a type from which a topic in a forum online that is "pinned" near the top of the forum index, enhance its visibility and prevent it to be buried by newer messages. "  "

  • What is the best way to save an array of objects and then load it?

    Hi, what is the best way to save and load an array of objects?

    I hade a code like that, but it does not work:

    var test = new Array();
    test.push(new Foo("a"));
    for (var i = 0; i < test.length; i++) {
        console.log(test[i]);
    }
    // save and load, then show again
    localStorage.setItem("test", test);
    var test2 = localStorage("test");
    for (var i = 0; i < test2.length; i++) {
        console.log(test2[i]);
    }
    

    the problem is, the first newspaper that get the things I want. The second time I get:

    Uncaught TypeError: Property 'localStorage' of object [object Object] is not a function
    

    The work around this problem is to stringify before saving and then analyze before loading.

    http://StackOverflow.com/a/2010948/773263

    Although I said, it is better to use IndexDB.

  • How to upgrade an array of objects?

    Dear friends,

    I have a number of objects stored in a table.
    It seems that the table does not point to objects, but has copies.
    The element of the array is only updated with the notation table [index] prop, not with the object.prop notation.

    It would be possible to always use the prop table [index] notation for an update of the issues, but I want to understand why the other method does not work. And of course, there should be no copy...

    var objArray = [oObject0, oObject1, oObject2];    
    
    function oObjTpl (name, scheme, start, incr, current, decimals, items) { // 'prototype' definition
      this.Name =       name;
      this.Scheme =     scheme;                       // numermic | roman | ROMAN | text
      this.Start =      start;                        // start value
      this.Incr =       incr;                         // increment, may be a formula string
      this.Current =    current;                      // Last inserted value or item
      this.Decimals =   decimals;                     // relevant only for numeric scheme
      this.Items =      items;                        // array of list items, relevant only for text scheme
    }
    
    var items0 = ["one","two", "three", "four", "five", "six", "zz", "seven", "eight", "nine", "ten"]; 
    var oObject0 = new oObjTpl ('CountingEN', 'text',     1,  1, undefined, undefined, items0);
    var oObject1 = new oObjTpl ('oObject1',  'numeric', 17, -1, undefined,         0, undefined);
    var oObject2 = new oObjTpl ('oObject2',  'roman',    1,  1, undefined,         0, undefined);
    
    // replace the zz by soemething else
    oObject0.Items[6] = "AAAA";       // this does not update objArray
    $.writeln (objArray[0].Items);
    
    objArray[0].Items[6] = "BBBB";    // this updates objArray
    $.writeln (objArray[0].Items);
    
    oObject0.Items[6] = "CCCC";       // update of objArray effective in next run
    $.writeln (objArray[0].Items);
    

    When you run the script 3 times, I get this console output:

    one,two,three,four,five,six,zz,seven,eight,nine,ten
    one,two,three,four,five,six,BBBB,seven,eight,nine,ten
    one,two,three,four,five,six,BBBB,seven,eight,nine,ten
    Result: undefined
    one,two,three,four,five,six,CCCC,seven,eight,nine,ten
    one,two,three,four,five,six,BBBB,seven,eight,nine,ten
    one,two,three,four,five,six,BBBB,seven,eight,nine,ten
    Result: undefined
    one,two,three,four,five,six,CCCC,seven,eight,nine,ten
    one,two,three,four,five,six,BBBB,seven,eight,nine,ten
    one,two,three,four,five,six,BBBB,seven,eight,nine,ten
    Result: undefined
    

    Thank you Apollo, but this has not been around.

    But I found that the order of definitions is crucial here. The following works as it should:

    function oSeries (name, scheme, start, incr, current, decimals, items) { // 'prototype' definition
      this.Name =       name;
      this.Scheme =     scheme;                       // numermic | roman | ROMAN | text
      this.Start =      start;                        // start value
      this.Incr =       incr;                         // increment, may be a formula string
      this.Current =    current;                      // Last inserted value or item
      this.Decimals =   decimals;                     // relevant only for numeric scheme
      this.Items =      items;                        // array of list items, relevant only for text scheme
    //return this;      // ahs no effect
    }
    
    var items0 = ["one","two", "three", "four", "five", "six", "zz", "seven", "eight", "nine", "ten"];
    var oSeries_0 = new oSeries ('CountingEN', 'text',     1,  1, undefined, undefined, items0);
    var oSeries_1 = new oSeries ('oSeries_1',  'numeric', 17, -1, undefined,         0, undefined);
    var oSeries_2 = new oSeries ('oSeries_2',  'roman',    1,  1, undefined,         0, undefined);
    
    var aSeries = [oSeries_0, oSeries_1, oSeries_2];    
    
    var a1 = aSeries[2].Scheme;      // roman
    $.writeln (a1);
    
    // replace the zz by octogon
    oSeries_0.Items[6] = "AAAA";   // this does not update aSeries
    $.writeln (aSeries[0].Items);
    
    aSeries[0].Items[6] = "BBBB";  // this updates aSeries
    $.writeln (aSeries[0].Items);
    
    oSeries_0.Items[6] = "CCCC";   // update of aSeries effective in next run
    $.writeln (aSeries[0].Items);
    /*
    one,two,three,four,five,six,AAAA,seven,eight,nine,ten
    one,two,three,four,five,six,BBBB,seven,eight,nine,ten
    one,two,three,four,five,six,CCCC,seven,eight,nine,ten
    */
    

    The order is now: implement the objects and then set up the array of objects.

  • Power supply an array of objects returned by a remote object using AMFPHP remote procedure calls.

    Hi guys,.

    I'm working on an AIR Application that uses Flex Remoting AMFPHP, the data type returned is an array of objects that contains a shot of a url to an image on the server, how to link it to a tilelist component, so I have a list with images representing the icons and the string representing the Tilelist labels?

    We assume that the object has these fields:

    -label
    -image

    Thus, you can first pass the array to the dataProvider of the TileList and make an ItemRenderer (with a label and an image). Then, in the ItemRenderer, go to the fields with the data objects:

    ItemRenderer.mxml

  • Place an array of objects on stage

    I'm trying to place an array of objects to a scene where they fall vertically. I was able to do by placing the array objects in an object called 'bag' but have found that the object of the bag contains the object id last table I can not apply actions various one-dimensional array objects.

    Also my objects don't loop and appear only once.

    Here's the code to date.

    var tempArray:Array = new Array(); Values of randomized stores

    var bagArray:Array = new Array ("gslow_id", "gshigh_id", "glow_id", "ghigh_id", "gdiv_id",

    'gcall_id', 'gbust_id', 'gbull_id', 'gboom_id', 'gbear_id'); List of names of bag

    function createBags() {}

    if (tempArray.length == 0) {/ / check if the table is empty}

    for (var i: Number = 0; i < target; i ++) {/ / loop - creat variable bagName to the value of the target}

    var bagName: String = bagArray [i];

    var depthLevel:Number = this.getNextHighestDepth ();

    / / movies, set in the time line

    this.attachMovie (bagName, bagName, depthLevel, {_x:random (350) + 100, _y:random (0) + spacing});

    += 45 spacing;

    tempArray.push (bagName);

    / / trace (tempArray);

    bag = _root [bagName]; create an object of the bag containing the variable bagName

    trace (bag);

    bag.onEnterFrame = function() {}

    If (this ._x < 570 & & this ._y > 0) {}

    this ._y += speed * random (8);

              } else {

    this ._x = random (500);

    } / / end if (this ._x < 570 & & this ._y > 0)

    } / / end bag.onEnterFrame)

    bag.onPress = function() {}

    / / if the bag is pressed selection action

    //trace (bag);

    xPos = this ._x

    yPos = this ._y

    unloadMovie (this);

    score += 1000

    scoreText_txt.text = score;

    / / trace (score);

    checkScore();

    { } / / end bag.onPress)

    / / trace (targets);

    / / trace (bagName);

    { } / / end for (var i: Number = 0; i < target; i ++)

    { } / / end if (tempArray.length == 0)

    } / / End createBags()

    Try:

    var bagA:Array = [];

    var bagArray:Array = new Array ("gslow_id", "gshigh_id", "glow_id", "ghigh_id", "gdiv_id",

    'gcall_id', 'gbust_id', 'gbull_id', 'gboom_id', 'gbear_id'); List of names of bag

    function createBags() {}

    If (tempArray.length == 0) {/ / check if the table is empty}

    for (var i: Number = 0; i< targets;="" i++)="" {="" for="" loop="" -="" creat="" variable="" bagname="" to="" the="" value="" of="">

    var bagName: String = bagArray [i];

    var depthLevel:Number = this.getNextHighestDepth ();

    tie movies to the time line

    bag of the var: MovieClip = this.attachMovie (bagName, bagName, depthLevel, {_x:random (350) + 100, _y:random (0) + spacing});

    bagA.push (bag);

    spacing = 45;

    trace (bag);

    bag.onEnterFrame = function() {}

    If (this ._x < 570="" &&="" this._y=""> 0) {}

    This speed of += ._y * random (8);

    } else {}

    This ._x = random (500);

    } / / end if (this ._x < 570="" &&="" this._y=""> 0)

    } / / end bag.onEnterFrame)

    bag.onPress = function() {}

    If the bag is pressed selection action

    trace (bag);

    PosX = this ._x

    yPos = this ._y

    unloadMovie (this);

    score += 1000

    scoreText_txt.text = result;

    trace (score);

    checkScore();

    } / / end bag.onPress)

    trace (targets);

    trace (bagName);

    } / / end for (var i: Number = 0; i< targets;="">

    } / / end if (tempArray.length == 0)

    } / / End createBags()

  • Array of objects display BPM with JSP HOWTO

    Hello!

    Could someone please tell me, how to list the elements of an array of objects BPM with JSP? The object has attributes, and I do not know the length of the array in advance, so I would need some kinf of loop.

    I have not found any documentation or forum thread on this subject, and I'm out of ideas.

    Thanks for any help!

    Hello

    Please find the code below. Hope this code will help you

    <% int count = 0; %>

                        
         
         
         
         
         <% count++ ; %>

    Sidonie

  • Insert references VI in an empty array of objects

    Hi all

    I shopped, but I can't seem to find the answer to this particular question.

    Platform: TestStand 4.2.0 LabVEW 8.6.1.  Customer resists upgrade.

    I am trying to build a list of VI references to a variable of TestStand.  TS is an empty array of references to object called Step.VI_References.

    BT, I take the context of the sequence (from "ThisContext") and read it as an object of property.  I then take this reference and use it with search GetPropertyObject Step.VI_References.  I have a table of references VI (of type TS. PropertyObject) that I am an iteration more to extract each reference.  It is then to be inserted by using SetPropertyObjectByOffset.  See the attached picture for the relevant bit of code.

    My problem is I'm getting an error-17300 - essentially a "NULL pointer unexpected shipping reference" SetPropertyObjectByOffset call - even with just a reference to be inserted.

    It doesn't seem to be a mistake to place else, but whenever I try to access VI_References in table form (using any table API), it gives the same error.

    What obvious (or subtle) thing I'm missing?

    Thank you

    Geoff

    If these are references, you must use SetValInterfaceByOffset instead of SetPropertyObjectByOffset.

    Hope this helps,

    -Doug

  • Array of objects type

    Hi all

    I have a problem with my pl/sql code. I would refer to an array of types of objects as reference, not a copy.

    I send you my sample code.

    As you can see, mytype is the object, I use a "table with" to create a table. The function 'myfunc' illustrates the problem: I create an instance of the object named "mis1", I put one of its variable (date) and I create the table arrmytype and copy the mis1 as arrmytype (1)

    Now the question: if I change mis1 arrmytype (1) does not alter it. I think that arrmytype (1) is a copy of mis1 and not a reference.

    Am I wrong? How can I refer mis1 in a referenced table? Can I change the ' table a ' in something else...

    create or replace type mytype as object

    (

    LDate date,

    constructor function mytype self return as a result.

    Members procedure setDate (date of update)

    );

    /

    create or replace type body as mytype

    constructor function mytype

    return self as result that

    Start

    null;

    end;

    Members procedure setdate (date of update) as

    Start

    LDate: = pdate;

    end setdate;

    end;

    /

    create or replace type arrmytype in the table of mytype;

    /

    create or replace FUNCTION myfunc RETURN varchar2

    AS

    arrObj arrmytype: = arrmytype();

    MIS1 mytype;

    date of l_tmp1;

    VARCHAR2 (100) retval;

    BEGIN

    MIS1: = new mytype();

    MIS1. SetDate (sysdate);

    l_tmp1: = mis1.ldate;

    arrObj.EXTEND;

    arrObj (arrObj.COUNT): = mis1.

    MIS1. SetDate (sysdate);

    l_tmp1: = arrObj (arrObj.COUNT) .ldate;

    l_tmp1: = mis1.ldate;

    RETURN retval;

    MyFunc END;

    /

    Federico wrote:

    I would like to refer as:

    v_var1: = 9;

    v_var2: = &v_var1; -as a code c ++

    The PL/SQL language does not support pointers as a data type. Well, not exactly true because it supports locators that are pointers. But locators are limited to the type of LOB data.

    So unfortunately you can't assign a reference to a variable/object in an array to a variable of pointer for quick reference. It's too bad that there is no pointer in PL/SQL data type as it is in C/C++ and Pascal.

    But then on the other hand, just look at how programmers say substance completely upward using PL/SQL without pointers, to realize that PL/SQL programming to quality would have been much worse if the language supported for pointers. Not that this is a valid reason for PL/SQL not support pointers.

    At least he could support the Pascal WITH clause which allows to define the scope and then resolve the name references in this scope...

  • by passing the array of objects to the procedure

    Hi, I wrote a procedure to accept the array of input objects. It has worked well.

    This is the only setting of entry in my Interior.

    But now, I tried to add a off set the parameter of type varchar2 to my procedure to send a return value, but it gives me an error

    PLS-00410: fields in duplicate in the FOLDER list, TABLE or argument are not allowed.

    Please suggest cant I pass all other arguments when using an array of record or an object as a parameter?

    This is my code
    CREATE OR REPLACE TYPE PREF_OBJ_TYPE as object (
    
     PREF_CD  varchar2(20),
     USR_ID   VARCHAR2(20),
     PROD_CD  VARCHAR2(50),
     DFLT_PREF_VAL_TX VARCHAR2(250),
     USR_PREF_VAL_TX VARCHAR2(250),
     CRE_USR_ID VARCHAR2(20),
     UPDT_USR_ID VARCHAR2(20) );
    /
    
    
    
    
    CREATE OR REPLACE TYPE PREF_ARRAY is table of PREF_OBJ_TYPE;
    
    CREATE OR REPLACE procedure MMM(in_pref PREF_ARRAY,v_err out varchar2 )
    is
    
    v_prod_dim_nb NUMBER;
    v_usr_dim_nb  NUMBER;
    v_count NUMBER;
    v_err varchar2(50);
     
    
    begin
    
    for i in  in_pref.first.. in_pref.last
    
    LOOP
    
    /* Derive the product and user dim numbers */
    
    select prod_dim_nb into  v_prod_dim_nb from prod_dim where prod_cd=in_pref(i).prod_cd ;
    select usr_dim_nb into v_usr_dim_nb from usr_xref where usr_id=in_pref(i).usr_id and sys_id='ACCESS';
    
    
    /* check if the record already exist in usr_prod_pref corresponding to that  user,prod,pref */
    
    select count(1) into v_count from usr_prod_pref_test where prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    if v_count=0 then 
    
    BEGIN
    
    INSERT INTO USR_PROD_PREF_TEST values(v_usr_dim_nb,in_pref(i).pref_cd,v_prod_dim_nb,in_pref(i).DFLT_PREF_VAL_TX,in_pref(i).usr_PREF_VAL_TX,'Active',NULL,
    in_pref(i).cre_usr_id,sysdate,in_pref(i).updt_usr_id,NULL);
    
    
    
    END;
    
    else 
    
    
    
    update USR_PROD_PREF_TEST set USR_PREF_VAL_TX=in_pref(i).USR_PREF_VAL_TX,DFLT_PREF_VAL_TX=in_pref(i).DFLT_PREF_VAL_TX,UPDT_USR_ID=in_pref(i).updt_usr_id,updt_dt=sysdate,cre_usr_id=in_pref(i).cre_usr_id where 
    prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    
    end if;
    
    
    end loop;
    
    commit;
    
    v_err:='abc';
    
    end;
    /
    Published by: raj_fresher on October 9, 2009 06:56

    Why the 6001 number is assigned to the error code? Oracle generates error code right... Why the procedure does not use this number move like to help put
    r_v_errod_cde and r_v_error_msg?

    I don't know who wrote at the beginning of this procedure, but no doubt he wanted to use some 'custom error handling?
    Furthermore, I don't see anything happening with R_V_ERROR_CODE and R_V_ERROR_MSG, or did you leave this part out of your snippet?
    This way of using a WHEN of OTHER (not followed by a RAISE) is considered to be a 'bad practice' / a bug.

  • Satellite A60 - USB ports are not really high speed

    Hello
    It seems to me that the SATELLITE A60-197ITA USB ports aren't really high speed. They are very slow!
    Some diagnose program says that the BIOS supports USB Legacy...

    What is the problem?
    What can I do to have the best performance?

    Hello

    I put t know what external device you use, but in my view it is also the external device power function.

    Legacy support can be enabled in the HW of Toshiba installation tool. You can find it under control panel.

    Good bye

Maybe you are looking for

  • How can I get rid of a url unwanted that autocompletes when I start typing.

    I have a URL for my car: firsttechfed.com but when I type in the tree, the system automatically fills in with: firsttechfcu.com, an advertisement site. So, every time I want to go to my site CU that I have to type the full name. I want to get rid of

  • analysis - NOT!

    recently bought a photosmart 5520 all-in-one, after that my epson refused to work with my new computer. I'm not a tech geek but installed a new printer (wireless), following the instructions provided. It prints well but when I want to scan anything i

  • I need to scan documents and put it in a file how to do this

    I need to scan documents and then also add a file how to do this

  • Envy 17 3D primary HDD to SSD update

    I was wondering the steps I need to take in order to upgrade my current 640GO 7200 HARD for one SSD drive. I read this thread on compatibility, so I'm aware of some issues, I might. http://h30434.www3.HP.com/T5/hardware-upgrades-replacements/envy-17-

  • Application not found

    For all Microsoft office or anti-spyware Aiken the error message is "Application not found".  When we by clicking on them, a pop-up request what program do we want to open it with.  We have the XP operating system.  Tried to fix with Microsoft Office