Help to associate table

{code}

Declare

Type Sum_multiple is table of index by pls_integer pls_integer;

n plS_integer: = 2;

SN pls_integer: = 4;

m pls_integer: = 2;

FUNCTION get_sum_multiples)

L_val pls_integer,

L_val2 pls_integer

) Sum_multiple RETURN

IS

s sum_multiple;

BEGIN

FOR I IN 1.L_val2 LOOP

S (I): = (L_val * (I + 1) / 2);

END LOOP;

RETURN S;

END get_sum_multiples;

BEGIN

DBMS_OUTPUT. Put_line (to_char (get_sum_multiples (M, SN) (N)));

END; {code}

I try the function return an array... my understanding then was if there are three values in the table then exit 3 values should come

for example

When the first time loop will work then

s (1) = 2 * (1 + 1) / 2 = 2;

in the second round

(2) s = 2 * (2 + 1) / 2 = 3;

and so on...

and since I'm back from the table, then the output should be

2,

3,

4 and so on...

but I don't know for some reason any it returns a single value, i.e. 3, can someone please explain to me how it works?

It returns an associative array. Howvere your DBMS_OUTPUT poster one - n - th element. Replace it with a loop:

Declare

Type Sum_multiple is table of index by pls_integer pls_integer;

n plS_integer: = 2;

SN pls_integer: = 4;

m pls_integer: = 2;

v_res Sum_multiple;

v_ind pls_integer;

FUNCTION get_sum_multiples)

L_val pls_integer,

L_val2 pls_integer

) Sum_multiple RETURN

IS

s sum_multiple;

BEGIN

FOR I IN 1.L_val2 LOOP

S (I): = (L_val * (I + 1) / 2);

END LOOP;

RETURN S;

END get_sum_multiples;

BEGIN

v_res: = get_sum_multiples (M, SN);

v_ind: = v_res.first;

LOOP

OUTPUT WHEN v_ind IS NULL;

DBMS_OUTPUT. Put_line ('Item' | v_ind |) "value is". v_res (v_ind));

v_ind: = v_res.next (v_ind);

END LOOP;

END;

/

Value of the element 1 is 2
Value of the element 2 is 3
The 3 element value is 4
The 4 element value is 5

PL/SQL procedure successfully completed.

SQL >

SY.

PS I guess you are just practical. Your code does not much sense.

Tags: Database

Similar Questions

  • Paging query needed help for large table - force a different index

    I use a slight modification of the pagination to be completed request to ask Tom: [http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html]

    Mine looks like this to extract the first 100 lines of everyone whose last name Smith, ordered by join date:
    SELECT members.*
    FROM members,
    (
        SELECT RID, rownum rnum
        FROM
        (
            SELECT rowid as RID 
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate
        ) 
        WHERE rownum <= 100 
    ) 
    WHERE rnum >= 1 
             and RID = members.rowid
    The difference between this and ask Tom is my innermost query returns just the ROWID. Then, in the outermost query we associate him returned to the members table ROWID, after that we have cut the ROWID down to only the 100 piece we want. This makes it MUCH more (verifiable) fast on our large tables, because it is able to use the index on the innermost query (well... to read more).
    The problem I have is this:
    SELECT rowid as RID 
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindate
    It will use the index for the column predicate (last_name) rather than the unique index that I defined for the column joindate (joindate, sequence). (Verifiable with explain plan). It is much slower this way on a large table. So I can reference using one of the following methods:
    SELECT /*+ index(members, joindate_idx) */ rowid as RID 
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindate
    SELECT /*+ first_rows(100) */ rowid as RID 
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindate
    Whatever it is, it now uses the index of the column ORDER BY (joindate_idx), so now it's much faster there not to sort (remember, VERY large table, millions of records). If it sounds good. But now, on my outermost query, I join the rowid with the significant data in the members table columns, as commented below:
    SELECT members.*      -- Select all data from members table
    FROM members,           -- members table added to FROM clause 
    (
        SELECT RID, rownum rnum
        FROM
        (
            SELECT /*+ index(members, joindate_idx) */ rowid as RID   -- Hint is ignored now that I am joining in the outer query
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate
        ) 
        WHERE rownum <= 100 
    ) 
    WHERE rnum >= 1 
            and RID = members.rowid           -- Merge the members table on the rowid we pulled from the inner queries
    As soon as I did this join, this goes back to the use of the index of predicate (last_name) and perform the sort once he finds all the corresponding values (which can be a lot in this table, there is a cardinality high on some columns).

    My question therefore, in the query full above, is it possible that I can get to use the ORDER of indexing BY column to prevent having to sort? The join is what makes go back to using the predicate index, even with notes. Remove the join and just return the ROWID for these 100 records and it flies, even over 10 millions of documents.

    It would be great if there was some generic hint that could accomplish this, such as if we change the table/column/index, do not change the indicator (indicator FIRST_ROWS is a good example of this, while the INDEX indicator is the opposite), but any help would be appreciated. I can provide explain plans for the foregoing, if necessary.

    Thank you!
  • Need help with graph/table

    Heey everybody,

    I am currently using a Spider8 and Labview to get data from the sensors, after I use Labview to process the data in charts or graphs. Alltough I have 2 small problems using a table/chart:

    1: for some graphics I want to use 1 y axis (example: volts or current) and 1 x-axis, time. I want this time to be like clockwork that counts only the seconds (example: 0-100 sec), using absolute time or relative, for formatting is not an option because they rely much too strong/fast. There is an example of this type of charts in the Appendix: measurement of time current vs.

    2: for most of the other tables/graphs I want to use several axis y (example for a motor: current, RPM and torque) and I want to use a category axis that may go 'back' (example for a motor: rotations). There is an example of this type of charts in the Appendix: measurement of torque.

    I have no idea how to make good sense, so your help is welcome

    Thank you!

    Hi grasman,.

    have you read jcarmodys message on how to apply a trace on a scale there?

    See the attachment on how to draw 2 curves on a xy chart and attach each parcel on a scale. I strictly followed the message context help chart and jcarmodys...

    I would also say to stay away from express screws: they tend to make more problems than to provide aid. You are more involved in conversions of type (to/from DDT) - using simple son gives you simply more to control what's happening in your code!

  • Need help - multilevel nested table - create table problem

    Hello

    My version of oracle db: 11g

    I just created a table that contains a nested multi-level table.

    Here is the code:

    create or replace type sdef_t_nt_empNames21 is table of the varchar2 (50);

    create or replace type sdef_ot_SCmarks21 as an object (number of physics, chemistry number, number of Biology);

    create or replace type sdef_t_nt_SCmarks21 is table of the sdef_ot_SCmarks21;

    create or replace type sdef_ot_allsubmarks21 as an object (eid, eng, math, sc sdef_t_nt_SCmarks21 number number);

    create or replace type sdef_t_nt_dep_m_info21 is table of the sdef_ot_allsubmarks21;

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    store table nested like NT_c_sdef_t_nt_dep_m_info21; c_sdef_t_nt_dep_m_info21  <-I know that the problem is here.

    TRACE OF THE ERROR:

    Error at startup on line: 13 in the command.

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    Nested table c_sdef_t_nt_dep_m_info21 (sdef_t_nt_SCmarks21) store as NT_c_sdef_t_nt_dep_m_info21

    Error report-

    SQL error: ORA-00904: invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    PS: I'm just solve a problem given to me by some1, is not a practical implementation, I'm just trying to get through

    I'm sure that some1 could help me with this, I have searched a lot of this problem but could not find my answer, please help me.

    Concerning

    Rahul

    SQL > create table (nt_dep21)
    Did number 2,
    3 dname varchar2 (50).
    4 c_sdef_t_nt_empNames21 sdef_t_nt_empNames21,
    c_sdef_t_nt_dep_m_info21 5 sdef_t_nt_dep_m_info21
    6                       )
    store c_sdef_t_nt_empNames21 7 nested as NT_c_sdef_t_nt_empNames21 table
    store c_sdef_t_nt_dep_m_info21 8 table nested as NT_c_sdef_t_nt_dep_m_info21)
    9 table nested as NT_sc sc store
    10                                                                               )
    11.

    Table created.

    SQL >

    SY.

  • HELPS OPERATOR ON TABLE TYPE LESS

    Hi all

    I'm using Oracle Database 11 g.

    I want to perform a negative operation on a varray.

    In the code, I want to update based on the result of the operation LESS below. I tried, but it gives 06550 ORA. I think what I'm not looking for the right way to use the collection.

    Help, please

    declare

    TYPE array_tbl IS TABLE OF varchar (255);

    v_array array_tbl;

    Start;

    Select to bulk model_name fired into v_array from kit_car_dim where owner = 'KIT' and model_name like 'FORD ';

    because me in 1... loop v_array. Count;

    / * I want to do something like this * /.

    Select model_name in v_array

    less

    Select model_name from kit_car_dim where owner = 'KIT ';

    / * which can be used for the update statement below * /.

    Update kit_car_dim set modified_timestamp = sysdate, model_ident = '1'

    where model_name = (model_name of operation less);

    end loop;

    end;

    First, you declare a nested table, varray No. If you don't use a nested table, use MULTISET EXCEPT:

    Set serveroutput on

    declare

    TYPE array_tbl IS TABLE OF varchar (255);

    v_array array_tbl;

    Start

    Select dname

    Bulk collect

    in v_array

    of the Department;

    for v_i loop 1.v_array.count

    dbms_output.put_line (v_array (v_i));

    end loop;

    dbms_output.put_line('===');

    v_array: = multiset v_array except array_tbl ('ACCOUNTING');

    for v_i loop 1.v_array.count

    dbms_output.put_line (v_array (v_i));

    end loop;

    end;

    /

    ACCOUNTING
    SEARCH
    SALES
    OPERATIONS
    ========================
    SEARCH
    SALES
    OPERATIONS

    PL/SQL procedure successfully completed.

    SQL >

    SY.

  • help required on table transpose

    DATA IN THE TABLE:

    ST IC OC         

    I have 18 2

    20 4 K

    10 1 L

    where ST, IC and OC are names of columns and I want data from the table format below. Please help,

    I K L         

    IC 18 20 10

    OC       2    4      1

    Hello

    Visit these pages to learn how to rotate the data:

    http://forums.Oracle.com/forums/thread.jspa?MessageID=4347279�

    http://forums.Oracle.com/forums/thread.jspa?MessageID=3662005

    If you don't know not set an upper limit for the number of columns in the result, swing requires dynamic SQL and I recommend you rather use String aggregation , where the output is a column of the great string, format to watch as separate columns.

    If you get stuck, post your best attempt, as well as some examples of data (CREATE TABLE and only relevant columns, INSERT statements) and the desired results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the forum FAQ https://forums.oracle.com/message/9362002#9362002

  • Reg: With the help of several tables of facts in the RPD!

    Hi all

    Can I get help with the following scenario?

    We use OBIEE 11 g.
    We have a report that uses 1 single fact table to retrieve data and it must be hell a lot of time to display the data in the report.

    My question is is there a way to show the performance of the report if divide us the data in table 1 to 2 fact tables and the report uses them 2 made tables.
    Are there other ways of finalization of the report for better performance.

    Thanks for the help in advance!

    Ajay.

    Hi Ajay,

    Follow these steps for tuning;
    1. try to adjust the SQL query generated first by the report, and then make the necessary changes. (Put index on the column that is required so that your query is scanning the index instead of the whole table)

    2. you can try to create the agg fact table and use agg navigation to improve performance. (This is to reduce the data set on which sql is triggered)

    3. you can try to create partitions on the table of FACTS in the comic book, and so held the partitions are queried according to the filters.

    4. in the last if all the foregoing does not resolve your query, you can try to divide the FACT table in two or more depending on your decision and then use fragmentation content in the MDB of the RPD layer if it will strike appropriate tables depending on whether you declare.

    Mark Correct/utile so this can help.

    Good luck
    Kashi

  • Desperately need help - "the partition table on device sda was unreadable." Erase all data?

    I'm forced to install CentOs on my Macbook using a machine virtual (VMWare, which is what I downloaded my teacher recommended). It's for my first class of operating systems, so bare with me because I don't know anything about operating systems (except about how to use Windows and my Macbook). I am also a daughter, what makes my same technical knowledge that much more rare. However, I am eager to learn...

    In any case, I downloaded them both. When I launch Fusion, I choose the file> New> install Windows or another OS on a virtual machine> continue without disk> click on the button that says 'Operating system installation disc using image file'> then I select the appropriate iso CentOS (CentOS - 5.4 - i386-bin-1of6) file> continue> drop down lists, I choose LINUX as operating system and Red Hat Enterprise Linux 5 as my Version> continue-> finish (no customization settings). It appears the screen of CentOS and I am invited by a text asking me if I want to install in text or graphics mode. (Don't know what to do here, but I select the graph). A bunch of white text scroll a screen of black background, then a blue screen shows up saying: 'Welcome to CentOS' at the top and a gray screen that says "to start testing CD media before installation OK press. Choose Ignore to ignore the media test and launch the installation. "I click on the red button (even once, if it is incorrect, let me know). A few rows of white text on black background (from anaconda... something on a video card...) then a nice graphic display of CentOS which I click NEXT. I then select English as my tongue (twice) and I gives me the message:

    "The partition table on device sda (VMware, VMware Virtual S 20473 MB) was unreadable. To create new partitions, it must be initialized, cauing the loss of all DATA on this drive. This operation will replace all choice on what players to ignore previous installation. You would like to initialize this drive, erasing all THE DATA? »

    I have no idea what to do here. I googled the message and others have been too, but they can talk about some hard file (and I have no idea what it is, and I can't seem to find mine).

    I can't lose what's on my hard drive (my school, music, photos, applications, files etc.). Clicking YES will erase my HD? I'm terribly afraid. I need to get this thing installed so I can do my operating systems class work, but I don't know if I did the installation correctly so far and especially, what to click at this point. Can someone help me out please (I spent 4 hours on this one today. "I have no one else to ask)? Finally, the installation is almost done after this step?

    Any help at all would be so greatly appreciated.

    I do not use Fusion, but I have VMware Workstation on Windows. I went through the same process that you went through. The answer to your question is that when you choose the operating system you install and you choose the option for the installation disc, it creates a virtual hard drive for you, size 20 GB. When they ask you to erase the hard drive, it's clear that virtual you create, not your actual computer hard drive. You can check by looking at the properties of the hard drive on your computer. It's probably 250 GB or 500 GB or something big like this. The CentOS WARNING speaks of a 20 GB hard drive, which is the size of the disk that VMware Fusion (and Workstation) create for CentOS.

  • Help to associate the drop-down list on the price menu Options in another field

    Hello.  : (

    I'm not a programmer but I wrote the code before.

    (Certainly never written in JavaScript...)

    I work for some non-profit and they asked me to fix their PDF to associate the elements of price...

    I thought it would be relatively simple in LiveCycle... but not for me, anyway...

    I have a few fields called Description0, Description1, etc... who has a drop DOWN menu allows you to select an option.

    I want the ability to associate a price field and update according to the selected item in the menu dropdown.

    I'm totally lacking however, it would seem...

    Advice would be appreciated. : )

    I wrote something like this:

    function descriptionChange (newDescription) {}

    {Switch (newDescription)}

    case "Lifepak CR Plus Charge Pak (a set of electrodes and a battery):

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "80";

    break;

    case "Lifepak CR Plus Charge Pak (two sets of electrodes and a battery):

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "107".

    break;

    case "Lifepak CR Plus Pedi touch Starter Kit":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = '139 ';

    break;

    case "Pedi toppings Lifepak CR more than spare":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "99";

    break;

    case "Philips HeartStart FRx battery":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "153";

    break;

    case "Philips HeartStart FRx adult Pads (1 set):

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "50";

    break;

    case "Philips HeartStart FRx infant touch":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = '98 ';

    break;

    case "(10), Zoll Type 123 Lithium batteries lasts 5 years":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "75";

    break;

    case ' Zoll CPR - D Padz, five year duration of life ":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "169";

    break;

    case ' Zoll Stat Pads II, 2 two parts pads, 2 years shelf life:

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "59";

    break;

    case "Cardiac Science G3 Plus battery":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "395";

    break;

    case study ' science heart G # more Pads (1 set):

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "49.95;

    break;

    case "furniture":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "200";

    break;

    case 'AED wall sign-3D ":

    this.resolveNode("UnitPrice.UnitPrice").rawValue = "15";

    break;

    } //end switch

    } //end function

    and then for each Description0, 1... I put in like this:

    var newDescription = this.boundItem (xfa.event.newText);

    DescriptionChange.descriptionChange (newDescription);

    Help please? : )

    Sorry if my question is too simple... or I'm just too much of a failure...

    When you create your fall down, after putting in your list of items, select the link tab in your object palette. Check "specify the item values. For each item, change its numerical value (e.g. text: "Lifepak CR Plus Charge Pak (a set of electrodes and a battery)' value would be 80).

    In the case of calculation of your UnitPrice field select the FormCalc language and insert the script:

    Sum (Discription0, Description1)

    Add some drop downs you must be included in the total.

    Tip: Name all your drop-down menus, the same thing and all that you have to ask, because the script is: sum (Description) [*]

    Kyle

  • Help with floating table

    I help my father with a Web site and he wants the sidebar of table I need to float to the bottom of the page when the viewer of scrolls. I know almost nothing about the coding and could use assistance update to be a floating table.

    Something like this works:

    <------ put="" your="" menu="" here="" ------="">

    <------ put="" your="" content="" here="" ------="">

    And the CSS realted will look like this:

    {body

    margin: 0;

    padding: 0;

    }

    {#masthead}

    min-width: 600px;

    }

    #logo {}

    float: left;

    Width: 200px;

    }

    #header {}

    margin left: 200px;

    }

    #container {}

    Clear: both;

    min-width: 600px;

    }

    {#left_col}

    float: left;

    Width: 200px;

    }

    {#page_content}

    margin left: 200px;

    }

    #footer {}

    Clear: both;

    }

    I suggest first to create a test page and let us know if you need additional help to change.

    Good luck.

  • Help: Problem with table

    Hello. I would like to remove my table objects if they do not meet the condition. But I was not able to get the result I want. Please help, thank you very much.

    package

    {

    import flash.display.MovieClip;

    SerializableAttribute public class Test extends MovieClip

    {

    public var fixedObjects:Array;

    public void examineLevel()

    {

    var fixedObjects = new Array();

    for (var i: int = 0; i < gamelevel.numChildren; i ++)

    {

    MC var = gamelevel.getChildAt (i);

    If (mc is floor)

    {

    var floorObject:Object = new Object();

    floorObject.mc = mc;

    mc.x = floorObject.leftside;

    fixedObjects.push (floorObject);

    }

    }

    fixedObjects.sortOn ("left", Array.NUMERIC);

    for each {(floorObject to fixedObjects)

    trace (floorObject.Leftside);

    }

    for each {(floorObject to fixedObjects)

    If (floorObject.leftside < = 260) {}

    fixedObjects.splice(floorObject,1);

    }

    }

    trace();

    for each {(floorObject to fixedObjects)

    trace (floorObject.Leftside);

    }

    }

    }

    }

    Output:

    153.3

    233.3

    267,3

    233.3

    267,3

    Another way to walk across a table and remove objects is to make it back in a loop that counts down...  This way you are sure not to ignore something that you remove them.

    for (var i: uint = fixedObjects.length - 1; i > - 1; i--) {}

    If (fixedObjects [i] .leftside<>

    fixedObjects.splice (i, 1);

    }

    }

  • Helps the nested Table

    Hi all

    I have a task to insert data in a nested table. First, I'll explain the scenario.

    I have 2 table (of patients) and (tumors) that contain medical data on patients with cancer.
    CREATE TABLE "DSS2_MINING"."PATIENTS" 
       (     "PATIENT_ID" VARCHAR2(10 BYTE) NOT NULL ENABLE, 
         "REGISTRY_ID" NUMBER(10,0), 
         "RACE" VARCHAR2(2 BYTE), 
         "SEX" VARCHAR2(1 BYTE), 
         "BIRTHDATE_YEAR" NUMBER(4,0), 
         "NUMBER_OF_PRIMARIES" NUMBER(1,0), 
         "VITAL_STATUS_RECORD" VARCHAR2(1 BYTE), 
         "CAUSE_OF_DEATH" VARCHAR2(5 BYTE), 
         "SURVIVAL_TIME" VARCHAR2(4 BYTE), 
         "SURVIVAL_TIME_FINAL" NUMBER, 
         "SURVIVAL_VARIABLE" VARCHAR2(1 BYTE), 
          CONSTRAINT "PATIENTS_PK" PRIMARY KEY ("PATIENT_ID");
    
    
    
    CREATE TABLE "DSS2_MINING"."TUMORS" 
       (     "TUMOR_ID" NUMBER NOT NULL ENABLE, 
         "PATIENT_ID" VARCHAR2(10 BYTE),   -- FK
         "SEER_RECORD_NUMBER" NUMBER,       -- This column contain a sequance number of the records for each patients
         "MARITAL_STATUS" VARCHAR2(1 BYTE), 
         "AGE" NUMBER, 
         "DATE_OF_DIAGNOSIS" DATE, 
         "HISTOLOGY_GROUP" VARCHAR2(2 BYTE), 
         "BEHAVIOR" VARCHAR2(1 BYTE), 
         "GRADE" VARCHAR2(1 BYTE), 
         "DERIVED_AJCC_STAGE_GROUP" VARCHAR2(2 BYTE), 
         "STAGE_OF_CANCER" VARCHAR2(2 BYTE), 
         "RADIATION" VARCHAR2(1 BYTE), 
         "CS_SCHEMA" VARCHAR2(2 BYTE), 
         "FIRST_PRIMARY_IND" VARCHAR2(1 BYTE), 
         "TUMOR_SIZE" NUMBER(4,1), 
         "TUMOR_EXTENSION" VARCHAR2(2 BYTE), 
         "LYMPH_NODES" VARCHAR2(1 BYTE), 
         "NODES_POSITIVE" NUMBER, 
         "ESTROGEN" VARCHAR2(3 BYTE), 
         "PROGESTERONE" VARCHAR2(3 BYTE), 
         "SURGERY" VARCHAR2(2 BYTE), 
          CONSTRAINT "TUMORS_PK" PRIMARY KEY ("TUMOR_ID");
    The table (of patients) contain the basic information about patients. The table (tumors) contain information about the tumors. each record in the table (the patients) may have one or more records in the table (tumors) using the column (patient_id). I want to transfer data from (of patients) and (tumors) tables to a new table (cancer_patients) that contains a nested table column. so I did the following code
    create or replace type tumor_object AS
    object(
    tumor_id VARCHAR2(1),   
    marital_status VARCHAR2(1),   
    age NUMBER(3),   
    date_of_diagnosis DATE,  
    cs_schema VARCHAR2(2),   
    histology_group VARCHAR2(2),   
    behavior VARCHAR2(1),   
    grade VARCHAR2(1),   
    first_primary_ind VARCHAR2(1),   
    tumor_size NUMBER(4,   1),   
    tumor_extension VARCHAR2(2),   
    lymph_nodes VARCHAR2(1),   
    nodes_positive NUMBER(4),   
    surgery VARCHAR2(2),
    radiation VARCHAR2(1)
    );
    
    
    create or replace type tumor_table as table of tumor_object;
    
    
      CREATE TABLE "DSS2_MINING"."CANCER_PATIENTS" 
       (     "PATIENT_ID" VARCHAR2(10 BYTE) NOT NULL ENABLE, 
         "RACE" VARCHAR2(2 BYTE), 
         "SEX" VARCHAR2(1 BYTE), 
         "NUMBER_OF_PRIMARIES" NUMBER(1,0), 
         "TUMORS" "DSS2_MINING"."TUMOR_TABLE" , 
         "VITAL_STATUS_RECORD" VARCHAR2(1 BYTE), 
         "CAUSE_OF_DEATH" VARCHAR2(5 BYTE), 
         "SURVIVAL_TIME_FINAL" NUMBER, 
         "SURVIVAL_VARIABLE" VARCHAR2(1 BYTE), 
          CONSTRAINT "CANCER_PATIENTS_PK" PRIMARY KEY ("PATIENT_ID")
       NESTED TABLE "TUMORS" STORE AS "TUMORS_STOR_TABLE"
     
    So my problem on the transfer and inserts data, I tried to use the associative array to keep the rows in the table of tumors, but it didn't work. I think that the main problem is that each record in the patient table have multiple records in the table of tumors.

    I hope that if anyone can help in this case or I you know any reference on similar cases

    Thank you
    A.L

    Published by: user9003901 on November 26, 2010 02:48

    Something like:

    INSERT
      INTO CANCER_PATIENTS
      SELECT  PATIENT_ID,
              RACE,
              SEX,
              NUMBER_OF_PRIMARIES,
              (
               SELECT  CAST(
                            COLLECT(
                                    TUMOR_OBJECT(
                                                 TUMOR_ID,
                                                 MARITAL_STATUS,
                                                 AGE,
                                                 DATE_OF_DIAGNOSIS,
                                                 CS_SCHEMA,
                                                 HISTOLOGY_GROUP,
                                                 BEHAVIOR,
                                                 GRADE,
                                                 FIRST_PRIMARY_IND,
                                                 TUMOR_SIZE,
                                                 TUMOR_EXTENSION,
                                                 LYMPH_NODES,
                                                 NODES_POSITIVE,
                                                 SURGERY ,
                                                 RADIATION
                                                )
                                   )
                            AS TUMOR_TABLE
                           )
                 FROM  "TUMORS" T
                 WHERE T.PATIENT_ID = P.PATIENT_ID
              ),
              VITAL_STATUS_RECORD,
              CAUSE_OF_DEATH,
              SURVIVAL_TIME_FINAL,
              SURVIVAL_VARIABLE
        FROM  PATIENTS P
    /
    

    SY.
    P.S. This site has censorship. It replaces the word S E X with *, change it if during the test.

  • Need help with creating table that inserts the lines according to the amount of data

    Hello

    I try to create a table for supervisors to enter their subordinates of information and inserts lines for supervisors with several of his subordinates.  This form is not be connected to a data source, the supervisors will be simply fill out the form and print.  I want it sort of look like this:

    Name Position # Ranking Hours

    I really appreciate any help.  Thank you!

    Hi Laura,

    It's very strange. I downloaded a new version on the site and it works perfectly. The script is in the right place.

    I can sugggest you right click on the download link and select "save a copy as" the alternative menu. This should save the form locally and from there, you should be able to open it in Acrobat.

    If you are a Mac, make sure that the form opens in preview from Apple.

    Also make sure that Javascript is enabled in Acrobat (in the preferences window).

    Niall

  • Help at the table orders pleeease!

    Hello to you all...

    I am very new to actionscript, and I have a code that I use for an effect of 'snow' for a banner. It works very well!

    But, I can't turn it off!

    I would like to turn to scene 2, disable it in stage 3 and reset the whole clip loops.

    Can someone please help me to do this?

    Here, I've included the coding with comment tags to help out...

    Any help would be much appreciated...

    Take care...

    Coz...

    ------------------------------   coding..   --------------------------------------

    SNOWSTORM IN 15 MINUTES!

    Author: Seb Lee-Delisle

    Blog: www.sebleedelisle.com

    Company: www.pluginmedia.net

    //

    This work is under a Creative Commons 2.0 license.

    Details to the

    // http://creativecommons.org/licenses/by/2.0/UK/

    You can re - use this code as you wish, but a credit would be

    appreciated. And I'd love to see what you do with it!

    / / send me a mail: [email protected]

    import flash.events.Event;

    import flash.geom.Rectangle;

    first make a table to put all our snowflakes in

    snowflakes var: Array = new Array();

    and decide how many snowflakes maxium we want

    var numFlakes: uint = 500;

    and define a rectangle where you will store the dimensions of the screen in.

    var screenArea:Rectangle = new Rectangle (0,0,486,60);

    start listening to an event ENTER_FRAME (equivalent

    the AS2 onEnterFrame function)

    addEventListener (Event.ENTER_FRAME, frameLoop);

    and define the function that is called on an ENTER_FRAME event

    function frameLoop(e:Event)

    {

    var snowflake: snowflake;

    / / if we do not have the maximum number of snowflakes...

    if(snowFlakes.length<numFlakes)

    {

    / / can make a new one!

    snowflake = new SnowFlake (screenArea);

    / / add to the range of the snowflakes

    snowFlakes.push (snowflake);

    / / and add it to the stage

    addChild (snowflake);

    }

    / / now calculate the wind factor by looking at the position x

    / / the mouse to the center of the screen

    wind var: number = ((screenArea.width/2) - mouseX);

    / / and divide by 60 to reduce its size

    wind / = 60;

    / / now loop through each snowflake

    for (var i: uint = 0; i < snowFlakes.length; i ++)

    {

    = flakes snowflake snow [i];

    / / and update

    snowflake.update (wind);

    }

    }

    Copy and paste this function frame 1 of scene 1.

    then in the frame 1 scene 2 (and any other image where you want to disable the snow), copy and paste:

    removeSnowF();

  • Need help with a table, someone pls help8-)

    The problem I have right now is that I want to display variable myblock low 10 times and then test it for collison,.

    I use the variable to store the blocks, pls I apologize because I am new to this, if I put manally the variable i of lets say 1 and 2

    for collison, and then test it works, but when I use the loop for, it only detects that an object in the table, I think that there is something

    simple probably missing an additional variable, for example as you can see in the code that I am trying to use the 'i' to replace for example addChild(blockarray[1]);

    I put it manually to display two blocks in the code below, collison detection works, but when I want to use a loop to view and test the collison

    It takes only one of the blocks, don't know if it's because that variable i figure to 0 in the loop for, any help would be greatly appreciated, this is my first post here, as I'm new to Actionscript, ty for reading8-)

    var thehero:BlueBlock = new BlueBlock;
    Thehero.x = 20;
    Thehero.y = 20;
    addChild (thehero);


    var blockarray = new Array()

    for (var i: Number = 0; i < 10; i ++)

    This is where I place my blocks

    {

    var myblock:BlueBlock = new BlueBlock;
    [i] blockarray = myblock;


    blockarray [i] .x = Math.random () * 500;
    blockarray [i] there = Math.random () * 400;
    trace (blockarray [i]);
    blockarray.push (MyBlock);
    addChild (blockarray [i]);


    }
    addChild(blockarray[1]);
    addChild(blockarray[2]);

    Look for the keyboard events such as you pressed the arrow keys

    stage.addEventListener (KeyboardEvent.KEY_DOWN, myKeyDown);
    stage.addEventListener (Event.ENTER_FRAME, blockcollision);

    function myKeyDown (e:KeyboardEvent) {}

    If (e.keyCode == Keyboard.LEFT) {}
    Thehero.x-= 5;
    }

    If (e.keyCode == Keyboard.RIGHT) {}
    Thehero.x += 5;
    }

    If (e.keyCode == Keyboard.UP) {}
    Thehero.y-= 5;
    }

    If (e.keyCode == Keyboard.DOWN) {}
    Thehero.y += 5;
    }
    }
    function blockcollision(e:Event):void {}
    If (thehero.hitTestObject(blockarray[1]))
    {
    trace ("hit");

    }
    If (thehero.hitTestObject(blockarray[2]))
    {
    trace ("hit");

    }
    }

    Try this:

    function blockcollision(e:Event):void {
         for (var prop:String in blockarray) {
              if (thehero.hitTestObject(blockarray[prop]))
              {
                   trace("Hit", blockarray[prop]);
              }
         }
    }
    

Maybe you are looking for