How to get Nested table function

Hi friends,

In a package, I created a nested table type name Varchar2 EmployeeCodeList.

Then, I created a function whose return type is EmployeeCodeList. But I don't get how to get the values of this function?

TYPE EmployeeCodeList IS TABLE OF THE VARCHAR2 (30);

FUNCTION GenerateRandomEcF (Ec_length NUMBER, NumberOfEmp NUMBER)

< < the function code > >

RETURN v_RandomEmpCodes;

END GenerateRandomEcF;

PROCEDURE GenerateEmpFile (NumberOfEmp NUMBER, Start_SN NUMBER, EmpValue NUMBER, VARCHAR2, VARCHAR2, Ec_length NUMBER EmpGroup HireDate) IS

v_Filename VARCHAR2 (40);

v_EmployeeCodes EmployeeCodeList;

v_EmpBatchF UTL_FILE. TYPE_DE_FICHIER;

BEGIN

v_Filename: = 'EMPLOYEE_BATCH_ ' | TO_CHAR (SYSTIMESTAMP, 'YYYYMMDD_HHMISS'): '. DAT';

v_EmployeeCodes: = EmployeeCodeList (NumberOfEmp);

v_EmployeeCodes: = SELECT * FROM TABLE (GenerateRandomAcF (Ac_length, NumberOfVoucher));

v_EmpBatchF: = UTL_FILE. FOPEN ('EXT_VOUCHER_DIR', v_Filename, 'W');

IF UTL_FILE.IS_OPEN (v_EmpBatchF) THEN

FOR i IN 1.NumberOfVoucher LOOP

UTL_FILE. Put_line (v_EmpBatchF, v_EmployeeCodes (i) |) ',' || Start_SN + (i-1). «, » || EmpValue | «, » || HireDate. «, » || EmpGroup);

END LOOP;

END IF;

END GenerateEmpFile;

How the line highlighted code above must be written so that I can get value of function in a variable of the same type of nested table.

If you use the second approach, I mean

56 v_EmployeeCodes: = GenerateRandomAcF (Ac_length, NumberOfEmployee);

then the collection must be initialized using the constructor method. Change line 33.48 as number below

33 v_RandomEmployeeCodes EmployeeCodeList: = EmployeeCodeList();

48 v_EmployeeCodes EmployeeCodeList: = EmployeeCodeList();

This is because when you use BULK COLLECT, Oracle automatically populates the collection without initialization. But if you do not COLLECT in BULK, then the collection must be initialized before filling / extending. Otherwise, you will get error of REFERENCE to the COLLECTION that is not INITIALIZED. So this should be the code, you should use. When you do not select... INTO, you might well declare the function is private and it is not necessary to declare in the package specification.

SQL > CREATE OR REPLACE PACKAGE BODY GenerateEmployeePackage AS

2 PROCEDURE Get_AC_Range (Ac_length NUMBER, Range_Start SERIES, certain Range_End NUMBER)

3 EAST

4 BEGIN

5 If Ac_length = 8 THEN

6 Range_Start: = 10000000;

7 Range_End: = 99999999;

8 Ac_length ELSIF = 9 THEN

9 Range_Start: = 100000000;

10 Range_End: = 999999999;

11 Ac_length ELSIF = 10 THEN

12 Range_Start: = 1000000000;

13 Range_End: = 9999999999;

14 Ac_length ELSIF = 11 THEN

15 Range_Start: = 10000000000;

16 Range_End: = 99999999999;

17 ELSIF Ac_length = 12 THEN

18 Range_Start: = 100000000000;

19 Range_End: = 999999999999;

20 Ac_length ELSIF = 13 THEN

21 Range_Start: = 1000000000000;

22 Range_End: = 9999999999999;

23 Ac_length ELSIF = 14 THEN

24 Range_Start: = 10000000000000;

25 Range_End: = 99999999999999;

26 END IF;

27 END Get_AC_Range;

28

GenerateRandomAcF FUNCTION 29 (Ac_length NUMBER, NumberOfEmployee NUMBER)

30 BACK IS EmployeeCodeList

31 NUMBER Range_Start;

32 Range_End NUMBER;

33 v_RandomEmployeeCodes EmployeeCodeList: = EmployeeCodeList ();

BEGIN 34

35 Get_AC_Range (Ac_length, Range_Start, Range_End);

36 v_RandomEmployeeCodes.extend (NumberOfEmployee);

37

38 FOR I IN 1.NumberOfEmployee LOOP

39 v_RandomEmployeeCodes (i): = TRUNC (DBMS_RANDOM.value (down-online Range_Start, high-online Range_End));

40 END LOOP;

41

42 v_RandomEmployeeCodes RETURN;

43

END 44 GenerateRandomAcF;

45

GenerateEmployeeFile PROCEDURE 46 (NumberOfEmployee NUMBER of Start_SN NUMBER, EmployeeValue NUMBER, displayed EmployeeGroup VARCHAR2, VARCHAR2, Ac_length NUMBER) IS

47 v_Filename VARCHAR2 (40);

48 v_EmployeeCodes EmployeeCodeList: = EmployeeCodeList ();

49 v_EmployeeBatchF UTL_FILE. TYPE_DE_FICHIER;

BEGIN 50

51 v_Filename: = 'Employee_BATCH_ ' | TO_CHAR (SYSTIMESTAMP, 'YYYYMMDD_HHMISS'): '. DAT';

52 v_EmployeeCodes: = EmployeeCodeList();

53

54 get nested table function

55 - SELECT * COLLECT in BULK IN TABLE v_EmployeeCodes (GenerateRandomAcF (Ac_length, NumberOfEmployee));

56 v_EmployeeCodes: = GenerateRandomAcF (Ac_length, NumberOfEmployee);

57 v_EmployeeBatchF: = UTL_FILE. FOPEN ('EXT_Employee_DIR', v_Filename, 'W');

58

59 if UTL_FILE.IS_OPEN (v_EmployeeBatchF) THEN

60. FOR i IN v_EmployeeCodes.FIRST... v_EmployeeCodes.Last LOOP

UTL_FILE 61. Put_line (v_EmployeeBatchF, v_EmployeeCodes (i) |) ',' || (Start_SN + (i-1)). «, » || EmployeeValue | «, » || Posted | «, » || EmployeeGroup);

LOOP END 62;

63 END IF;

64

END 65 GenerateEmployeeFile;

66

END 67 GenerateEmployeePackage;

68.

Tags: Database

Similar Questions

  • I have more endurance, remove or insert the option pages after upgrade to Adobe DC. How to get back these functions?

    I have more endurance, remove or insert the option pages after upgrade to Adobe DC. How to get back these functions?

    Looks like you may have updated to misapplication. Probably, you have Adobe Acrobat (the full version) and installed Adobe Acrobat Reader instead. If you had "improved" Adobe Acrobat, it would have cost you money. Acrobat Reader is free.

  • How to represent Nested table as variable/object in OIC

    Hi all

    I'm new to the BEAK.

    I now have the nested in my database table.
    Nested table:
    Create the type type1 as an object (name varchar2 (20));
    Create the type type2 as type1 table;
    create table table1 (varchar2 (20) col1, col2 type2) store col2 table nested as table2;

    Can someone help me to col2 as C structure/typedef to use it with OCIDefineObject?

    You can take a look at Chapter 11 of the Guide to the programmer of the OIC. Look at the Collections inside section. You can represent the nested as OCITable table *. In addition, you can generate a representation of the structure of your object using OTT type. Please let us know if that answers your question. In the case where you are not able to proceed please let us know.

    Thank you
    Sumit

  • Can someone explain please how to get autodial to function properly in a book?

    We cannot get the automatic numbering to work. We put the first page of each document/chapter for the automatic numbering of the pages, but the book begins each chapter with page number 1 instead of the whole book of sequential numbering.

    I read this thread http://forums.adobe.com/message/1319110#1319110 , which indicates that we need to replace our preferences. It refers to http://help.adobe.com/en_US/InDesign/6.0/WSa285fff53dea4f8617383751001ea8cb3f-6d 21a.html for the replacement of the preferences, but once on this page, what should we do?

    Peter said 'you must be VERY fast by pressing the keys after clicking on the shortcut. "It might work for them and hold and click a shortcut on the desktop while they are in hurry. What shortcut and what keys?

    Peter said ' try just rename the two files, InDesign Defaults and InDesign SavedData.» How can we find our user profile to find these files?

    He has also advised, "the simplest method will be a search, including hidden files."   Do a search where and for what?

    Thank you.

    Both the individual documents and the numbering of the pages of book options must be defined. Make sure you open the numbering options in the book panel menu e.

    Adobe InDesign CS4 * setting preferencesis the same page referenced in the other thread. If you scroll down you will see directions for repalcing the keyboard preferences. You must close InDesign and press the combination of keys for your platform after the restart of ID (the shortcut is a shortcut that lanuches the program).

    If you want to delete or rename the files manually instead, use the operating system file search to find them. Default InDesingn must be:

    Windows XP
    The documents and Settings\ [username] \Application Data\Adobe\InDesign\ [Version]-[language]
    Windows Vista
    \AppData\Roaming\Adobe\InDesign\ directory Users\ [user_name] [version]-[language]
    Mac OS
    [user name] / Library/Preferences/Adobe/InDesign / [version] / [language]

    InDesign SavedData wiil be in another (Settings\Application data\) branch of the XP user profile, but I am not sure of the paths for Vista or Mac, that's why I recommend to leave the computer to find. Do a file search is pretty basic stuff. You say you don't know how to do this? Tell us about the OS and maybe we can help you.

  • How to get the same functionality for string as java in oracle 10g

    Example:

    In java, if I use
    -> > >
    String.format ("% 03d", 11) then he will give me the result 011
    String.format ("% 03d", 1111) then he will give me the result 1111

    I need also same result in Oracle for a stored procedure. I used to_char() and lpad() function but could not get the desirable.

    I'm new on this. Please forgive for this silly question and help me.

    Or with the prefix "FM", which makes the FILLING for us:

    to_char(col1, 'fm9999099')
    
  • How to get the table without segment tablespace

    Hello

    I have a few tables in 11.2, which were created with creation of deferred segment and did so no segment/measure not yet. They already appear in dba_tables thus identical to the tab$, but do not have a defined tablespace.

    However, using dbms_metadata.get_ddl () the DOF resulting has the correct tablespace name. But what a view or table that I must query for this information with SQL?

    Thank you

    Robert

    Hello

    No, none of these tables is temporary, but it turns out that all the affected tables are ITO and so I have to check dba_indexes for the tablespace and the dba_indexes index_name when looking for a segment.

    Thank you

    Robert

  • How to get the use of database tables/columns in the table of edge/analysis?


    Hi all

    Anyone has an idea on how to get the tables in DB/colomns usaged in edge/analysis table in OBIEE 11 G?

    Thanks in advance!

    Anne

    You can try to generate a report of Catalog Manager for analysis / SA want to create the line and your RPD you can go to utilities > documentation of the repository and get the domain you want to and get all the mappings in Excel format.

    I hope this helps.

    SVS

  • Returns the Nested table Max length

    Hello

    I want to create a function that accepts a nested table / array as I / p and return the maximum length of the elements in the array.

    As if I was passing the table as arr('India','Mumbai','Kolkata','Pune'), this function should return the length max 7 (Kolkata).

    Can apply us the aggregation on the nested table function or is there an alternative?

    Kind regards
    Rakesh

    Hello

    Here's a possible solution:

    
    create or replace type tCharArray is table of varchar2(1000);
    
    create or replace function get_max_size(p_array tCharArray) return number
    is
      l_result number;
    begin
      select max(length(column_value))
      into l_result
      from table(p_array);
      return l_result;
    end;;  
    
    select get_max_size(tCharArray('abc', 'aaaaa')) from dual;
    

    Best regards
    Nikolai

  • How to get table name in EBS

    Hello friends,

    I use the EBS R12.2.4 application that is installed on the virtual machine.

    How to get the name of the table, front end or by connecting to sqlplus.

    This is the insert location API in EBS

    csi_hz_locations_pvt.create_location(
          p_api_version => 1.0 ,
          p_commit           => 'T',--fnd_api.g_true,
          p_init_msg_list    => 'F',--fnd_api.g_false,
            p_validation_level => 100,--fnd_api.g_valid_level_full,
          p_country         => :hz_locations.country,
          p_address1         => :hz_locations.address1,
          p_address2         => :hz_locations.address2,
          p_address3         => :hz_locations.address3,
          p_address4         => :hz_locations.address4,
          p_city             => :hz_locations.city,
          p_postal_code      => :hz_locations.postal_code,
          p_state            => :hz_locations.state,
          p_province         => :hz_locations.province,
          p_county           => :hz_locations.county,
                                         p_description      => :hz_locations.description,
          p_clli_code        => :hz_locations.clli_code,
                                         p_last_update_date => :hz_locations.last_update_date,
                                         p_last_updated_by  => :hz_locations.last_updated_by,
                                         p_creation_date    => :hz_locations.creation_date,
                                         p_created_by       => :hz_locations.created_by,
                                         p_created_by_module => l_created_by_module,
          x_location_id      => l_location_id,
          x_return_status    => l_return_status,
          x_msg_count        => l_msg_count,
          x_msg_data         => l_msg_data
                                        );
         if l_return_status = 'S' Then
            :hz_locations.location_id := l_location_id;
         Else
             IF ( FND_MSG_PUB.Count_Msg > 0) Then
                FOR i in 1..FND_MSG_PUB.Count_Msg LOOP
                         FND_MSG_PUB.Get( p_msg_index     => i,
                                          p_encoded       => 'F',
                                          p_data          => l_msg_data,
                                          p_msg_index_out => l_msg_index_out
                               );
                FND_MESSAGE.Set_String(l_msg_data);
                FND_MESSAGE.ERROR;
              End LOOP;
            End IF;
            Raise Form_Trigger_Failure;
          End IF;
    
    

    I want to find out in what table records inserted.

    EBS my application is on the server and I connected sqlplus using the System/Manager through PuTTY. I asked since

    all_objects
    
    

    table sqlplus but above all function does not exist.

    Help, please.

    Thank you

    Hello

    There are two methods to achieve this.

    1. you need to refer document eTRM oracle.

    2. open API in a tool like toad and get the details.

    Kind regards

    Jonathan

    Note: If response useful/correct, mark as such to make it easier for members of the community find answers that could help in a similar situation.

  • How to get the text formatting in the tables

    Dear experts and aid

    For my project, I import an RTF file and then read the data into 3 tables. It works fine when just using the contents of the string of paragraphs. However, the final script should be able to read and to replace the text formatted...
    Why use intermediate tables? Because otherwise I need to swap between two fm-documents (and you can be a part of the book).

    The imported file starts with a certain number of lines separated into two parts by a TAB ("designates a TAB in \x08 FM)
    [[Garneau, 1990 #12]]    »   [9]
    The good article can also be locally as text, e.g. [9]
    Then follow the same (or smaller) number of paragraphs with text formatted like this:
    [9]"D. Garneau, ed., National Language Support Reference Manual (national language Information Design Guide. Toronto, CDN: IBM National Language technical Centre, 1990.

    Is it possible to replace in the body of the function below the next song

      while(pgf.ObjectValid()) {
        pgfText = GetText (pgf, newDoc);
        gaBibliography.push(pgfText);
        pgf = pgf.NextPgfInFlow;
      }
    

    with this

      while(pgf.ObjectValid()) { 
        gaBibliography.push(pgf);
        pgf = pgf.NextPgfInFlow;
      }
    

    Do I need a special statement of the gaBibliography range?
    And how to get the right part of the lines as formatted intro thingy in table gaFmtCitsFmt ?

    Currently, I read in the tables as "strings" (function GetText not shown):

    var gaFmtCitsRaw  = [];                           // left column in processed RTF
    var gaFmtCitsFmt  = [];                           // right column in processed RTF
    var gaBibliography= [];                           // bibliography lines from processed RTF
    // filename is something like E:\_DDDprojects\FM+EN-escript\FM-testfiles\BibFM-collected-IEEE.rtf 
    
    function ReadFileRTF (fileName) {
      var nCits=0, nBib = 0, openParams, openReturnParams, newDoc, pgf, pgfText ;
      var TAB = String.fromCharCode(8);               // FM has wrong ASCI for TAB
      var parts = [];
      
      openParams = GetOpenDefaultParams();
      openReturnParams =  new PropVals();  
      newDoc = Open (fileName, openParams, openReturnParams);  
      pgf = newDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;  // get first pgf in flow
    
    // --- read the temp/formatted citations  
      while(pgf.ObjectValid()) {
        pgfText = GetText (pgf, newDoc);
        if (pgfText.substring (0,2) == "[[") {        // citation lines start with [[
          parts = pgfText.split(TAB);                 // get the two parts of the line
          gaFmtCitsRaw.push (parts[0]);               // Push the result onto the global array
          gaFmtCitsFmt.push (parts[1]);
          pgf = pgf.NextPgfInFlow;
        } else { break }
      }
    
    // --- read the bibliography
      while(pgf.ObjectValid()) {                      // until end of doc
        pgfText = GetText (pgf, newDoc);
        gaBibliography.push(pgfText);
        pgf = pgf.NextPgfInFlow;
      }
      newDoc.Close (Constants.FF_CLOSE_MODIFIED);
    } // --- end ReadFileRTF
    

    The following questions will then be how to change the script of FindAndReplace of Ian Proudfoot for managing text formatted as replacement. I will need to use the copy and paste IMHO...

    Klaus, okay, before pasting, you must assign the TextSelection object at your insertion point.

    // Add a new paragraph after the current paragraph.
    var newPgf = oDoc.NewSeriesPgf (lastPgf);
    var textRange = new TextRange (new TextLoc (newPgf, 0), new TextLoc (newPgf, 0));
    
    oDoc.TextSelection = textRange;
    oDoc.Paste ();
    

    -Rick

  • How can I call a function table in pipeline via DB link?

    I am using a function table in pipeline defined in a remote DB (DB_A) of my DB in local (DB_B) via a link DB (DB_A_REMOTE).

    The function table in pipeline is defined in a package with all the specifications of type he needs and works very well when she is called locally but when called it remotely fails

    Here is an example configuration in DB_A:
    connect scott/tiger
    create or replace
    package pkg as
      type rec is record (
        dte date
      );
      type rec_set is table of rec;
      
      function dts(p_eff_date date) return rec_set pipelined;
      function dt(p_eff_date date) return date;
    end;
    /
    create or replace
    PACKAGE BODY pkg AS
    
      function dts(p_eff_date date) return rec_set pipelined AS
        r rec;
      BEGIN
        r.dte := p_eff_date;
        pipe row(r);
        r.dte := r.dte+1;
        pipe row(r);
        RETURN;
      END dts;
    
      function dt(p_eff_date date) return date as
      begin
        return p_eff_date;
      end;
    
    END pkg;
    /
    In DB_B, I have the following configuration:
    create database link DB_A_REMOTE connect to Scott identified by tiger using 'DB_A';
    create or replace synonym RPKG for PKG@DB_A_REMOTE;
    In DB_A, I can access the two PKG functions very well
    SQL> select pkg.dt(sysdate) from dual
    DJ.DT(SYSDATE)       
    ----------------------
    21-SEP-2012 11:26:31   
    
    SQL> select * from table(pkg.dts(sysdate))
    DTE                  
    ----------------------
    21-SEP-2012 11:26:31   
    22-SEP-2012 11:26:31   
    23-SEP-2012 11:26:31   
    24-SEP-2012 11:26:31   
    However, in DB_B the I get the following:
    SQL> select rpkg.dt(sysdate) from dual
    RPKG.DT(SYSDATE)     
    ----------------------
    21-SEP-2012 11:29:05   
    
    SQL> select * from table(rpkg.dts(sysdate))
    
    Error starting at line 2 in command:
    select * from table(rpkg.dts(sysdate))
    Error at Command Line:2 Column:20
    Error report:
    SQL Error: ORA-06553: PLS-752: Table function DTS is in an inconsistent state.
    06553. 00000 -  "PLS-%s: %s"
    *Cause:    
    *Action:
    selection rpkg.dt shows I can get to the remote package and run functions in it, but the second line is where my problem.

    Why the function table in an inconsistent state and how can I fix this problem so that it will work in all of the linlk database?

    Published by: Sentinel on September 21, 2012 11:35

    Go! You have posted more than 1,000 times and know that you must provide your Oracle version 4-digit.
    >
    Why the function table in an inconsistent state and how can I fix this problem so that it will work in all of the linlk database?
    >
    You can't - it is not supported.

    See the note under the PIPELINED clause in the declaration section of the definition of the doc of PL/SQL and function
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25519/function.htm
    >
    Note:

    You cannot run a function table in pipeline over a database link. The reason is that the return type of a function table in pipeline is a SQL type defined by the user, which can be used in a single database (as explained in the Guide of the Oracle object-relational database developer). Although the return type of a function table in pipeline may appear as a PL/SQL type, the database actually converts this PL/SQL type to a type defined by the corresponding SQL user.
    >
    Your code using PL/SQL types for these types are implicitly converted to the SQL type needed to access the service using SQL. But the SQL types have an OID (object ID) which is not recognized on the other server so that the other server is unable to create the appropriate type.

    If you click on the link provided to the other doc in this note, you will see that even though you can create a type and specify an OID you still won't be able to use it as you wish.
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e11822/adobjbas.htm#ADOBJ7083
    >
    Restriction on the use of Types defined by the user with a remote database

    Objects or user-defined types (specifically, types declared with a SQL CREATE TYPE statement, as opposed to types declared in a PL/SQL package) are currently only useful in a single database. Oracle database limits the use of a link of database as follows:

    Unable to connect to a remote database for select, insert, or update a type defined by the user or a REF object on a remote table.

    You can use the CREATE TYPE statement with the Optional keyword OID to create an object identifier specified by the user (OID) that allows an object type for use in multiple databases. See the discussion on the attribution of an OID for a type of object in Oracle Database Data Cartridge Developer's Guide.

    You cannot use the links from the database of the PL/SQL code to declare a local variable of a type defined by the remote user.

    You cannot pass an argument value or return of type user defined in a PL/SQL remote procedure call.

  • How to get the names of the table columns in the quick dashboard

    How to get the names of the table columns in the quick dashboard


    Thanks and greetings
    ------------------------
    Kishore P

    Make a prompt like:

    SELECT case when 1 = 0 then 'D0 time. " "" T02 by month name "other" 'D2 market' '. "" M04 region' ' the end 'Sample Sales' UNION ALL SELECT case when 1 = 0 then 'D0 Time. " "" T02 by month name ' else ' 'Time D0. "" T02 by month name ' ' the end 'Sample Sales.

    Put the name of column in single quotes.

    Make your rank as a function:
    Rank ('F1 income'. "" Recipes 1-01 (after all) "by @{pColumn} {'D0 time'. ({"" T05 annually name '})

    It works fine for me

    concerning

    John

    http://obiee101.blogspot.com

  • How can you add item (object) complex "nested table"?

    Hello I did some reading on * "Associative" * and * "Nested Table" * and I would like to enumerate the collection using the later version (http://www.devshed.com/c/a/Oracle/Database-Interaction-with-PLSQL-Nested-Tables/2/)
    -know list "Nested Table"

    However, encountered problem try to * 'EXTEND' * my nested table (add items to the complex type or OBJECT I defined, namely 'TmpHierarchyMapObjType' below) - detail as follows:

    -NOTE 1: Here's how to create the type object (be well if I just say "CREATE or REPLACE TYPE TmpHierarchyMapObjType AS OBJECT (_TMP_HIERACHICAL. ROWTYPE_)"instead of having to duplicate the column definition.
    CREATE OR REPLACE TYPE TmpHierarchyMapObjType AS OBJECT
    (
    ID numeric (19.0),.
    ParentId numeric (19.0),.
    ChildId numeric (19.0),.
    ...
    TmpUID varchar2 (32),
    ReferencedId numeric (19.0),.
    ...
    );

    -NOTE 2: I can't put 'TmpHierarchyMapObjType' inside the package, but it's not crucial, I guess.
    Types of CREATE or REPLACE PACKAGE
    AS
    TYPE cursorType IS REF CURSOR;
    TYPE TmpHiearchyMapTableType IS TABLE OF THE TmpHierarchyMapObjType; / * Use 'Nested Table' instead of an associative array * /.
    / * TYPE TmpHiearchyMapTableType IS TABLE OF THE TMP_HIERARCHYMAP % ROWTYPE INDEX DIRECTORY. */
    END;

    -NOTE 3: Here is my FUNCTION TABLE that now returns a "Nested Table" as assumed to 'Associative' (with a syntax different enumeration)
    FUNCTION to CREATE or REPLACE spGetParentsTable
    (
    Number to the ObjectId,
    ObjectClassifier varchar2
    )
    RETURN types . TmpHiearchyMapTableType -now a 'Nested Table', not 'voluntary '.
    IS
    Types of TmpHierarchyMap. TmpHiearchyMapTableType;
    ThisTempId varchar2 (32);
    CURSOR spGetParents_cursor IS
    SELECT
    ReferencedId Id,
    ParentId,
    ChildId,
    ...
    OF TMP_HIERARCHYMAP
    WHERE TmpUID = ThisTempId;
    BEGIN
    SELECT sys_guid() IN the double ThisTempId;

    spRecursiveGetParents (ObjectId, ObjectClassifier, ThisTempId);

    -(Commentary) TmpHierarchyMapMAX: = 0;
    FOR oMap in spGetParents_cursor LOOP
    -(Commented out) TmpHierarchyMapMAX: = TmpHierarchyMapMAX + 1;

    -QUESTION: FAILED here! How can I add/elements of complex types?
    TmpHierarchyMap.EXTEND (cast (oMap as TmpHierarchyMapObjType));

    /*
    NOTE: (In the comment) use is not "Associative", now using "nested table" instead.
    TmpHierarchyMap (TmpHierarchyMapMAX). ID: = oMap.Id;
    TmpHierarchyMap (TmpHierarchyMapMAX). ParentId: = oMap.ParentId;
    TmpHierarchyMap (TmpHierarchyMapMAX). ChildId: = oMap.ChildId;
    ...
    */
    END LOOP;

    DELETE FROM TMP_HIERARCHYMAP WHERE TmpUID = ThisTempId;

    RETURN TmpHierarchyMap;

    END spGetParentsTable;

    -Finally, I would like to enumerate the nested table.
    DECLARE
    types of oMappingTable. TmpHiearchyMapTableType;
    BEGIN

    oMappingTable: = spGetParentsTable(2,'ThinkFundamentals.Util.Security.SystemUser');

    -NOTE 4: this is my final goal!
    Select * from table (cast (oMappingtable as types.) TmpHiearchyMapTableType));

    dbms_output.put_line ('done!');
    END;


    REF:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/Collections.htm#LNPLS005
    http://www.DevShed.com/c/a/Oracle/associative-arrays-in-Oracle-PLSQL-introduction/2/
    http://www.DevShed.com/c/a/Oracle/database-interaction-with-PLSQL-nested-tables/2/

    Hello

    Try this,

    TmpHierarchyMap.Extend();
    TmpHierarchyMap(TmpHierarchyMap.Count) := TmpHierarchyMapObjType( oMap.Id
                                                                    , oMap.ParentId
                                                                    , ... );
    

    Kind regards

    Christian Balz

  • I no longer get suggested words when composing a message text on my iphone 5.  How to get back to get this function works

    I no longer get suggested words when composing a message text on my iphone 5.  How to get back to get this function works

    Make sure that the text is on. You can do this on the keyboard (if you have several) by pressing and holding down the button to change between them.

    Alternatively you can go to settings > general > keyboard and make sure predictive is turned on (the switch must be green).

    If you see the image below, press the small white bar above the buttons T and Y and slide upward slightly.

  • How to get an auto update table

    Hey there;

    Im trying to get a table automatic update from one sheet to the other.

    I have four sheets.

    The main displays the list of all competitors and the total points.

    The other three are the divisions and competitors in this division.

    For example, the first sheet is the League table

    Then division 1 and their competitors

    Division 2 and their competitors

    and Division 3 with their competitors

    On each page there is a single table of ranking based on points, wins and loses ect.

    I want to put all the competitors on the main sheet and the ranks show their, however, when the sheets are updated with wins and loses the update of the numbers, but the rankings remain the same.

    I was wondering if there was a way to automatically update without having to re - sort the column.

    Thank you in advance.

    -KK

    Yes.  There's a rank() function call that allows you to select a value from a list by his rank in this list.

    In this example, enter the data in columns F and G.

    column E contains the rank of the team in the line

    E2 = RANK (G2, G, 1)

    It's shorthand dethrone select cell E2, and type (or copy and paste it here) the formula:

    = RANK (G2, G, 1)

    Select cell E2, copy

    Select cells E2 at the end of the column (or), paste

    Now you can create a 'list sorted automatically' in columns B and C

    Account in the B column numbers is not really necessary, but they make the list more readable (in my opinion)

    C2 IS EQUAL TO VLOOKUP (B2, E:G, 2, 0)

    Select cell C2, copy

    Select cells C2 at the end of the C column, paste

Maybe you are looking for