Type of custom with the attribute of the collection object

Hello

I am a beginner in PL/SQL, although I have a lot of experience in MSSQL.  I try to get a stored procedure to return a type of complex object in .NET code that runs it.  This object contains 3 standard attributes and a varchar2 data collection (12).  I've seen several examples of creating tables that have a complex data type, but none on what I want to do. I tried several variations on what follows, without success so far:

CREATE OR REPLACE TYPE BoxNumberTable AS TABLE OF THE VARCHAR2 (12);

create or replace TYPE GETBOXNUMBER_RESULT AS OBJECT

(/ * TODO enter statements attribute and the method here * /)

Success of char (1),

BoxNumber VARCHAR2 (12),

ErrorMessage, VARCHAR2 (4000).

DuplicateBoxNumbers BoxNumberTable

);

Keep syntax errors. Any help would be greatly appreciated.

Thank you

David

Example:

SQL > set serverout on
SQL > ed
A written file afiedt.buf

1 create or replace FUNCTION GETBOXNUMBER return (currentlocation varchar2) is GETBOXNUMBER_RESULT
2. PRAGMA AUTONOMOUS_TRANSACTION; -WHY USE IT?  IT IS RARELY NECESSARY, AND USUALLY ONLY FOR THE CONTROL/MONITORING
3 BoxNum_Result GETBOXNUMBER_RESULT: = new GETBOXNUMBER_RESULT (null, null, null, null);
4 Begin
5. SELECT deptno
In BULK 6 GATHER IN BoxNum_Result.DuplicateBoxNumbers
7 FROM emp;
8 return BoxNum_Result;
9 * end;
SQL > /.

The function is created.

SQL > ed
A written file afiedt.buf

1 declare
2 BoxNum_Result GETBOXNUMBER_RESULT;
3. start
4 BoxNum_Result: = GETBOXNUMBER ('DUMMY');
5 because I in 1... BoxNum_Result.DuplicateBoxNumbers.Count
6 loop
7 dbms_output.put_line (' value: ' |) BoxNum_Result.DuplicateBoxNumbers (i));
8 end of loop;
9 * end;
SQL > /.
Value: 20
Value: 30
Value: 30
Value: 20
Value: 30
Value: 30
Value: 10
Value: 20
Value: 10
Value: 30
Value: 20
Value: 30
Value: 20
Value: 10

PL/SQL procedure successfully completed.

Although in bulk, collection of data in collections in memory is not usually a good idea as PGA memory is expensive, and you would not do that just to process the data and re - write to the database.

What are you actually trying to achieve in the end?

Tags: Database

Similar Questions

  • What is the most trouble free Mac OS to use with the collection master CS6? (not CC)

    What is the most trouble free Mac OS to use with the collection master CS6? (not CC)

    Unless 10.10 has features you really need, a restore is logical. It's a pain, but if you can't do the job, this is what is needed.

    Roll back MacOS is outside these forums, but I don't know that apple Support you can get to the right help. That's all I can say.

    Gene

  • Clear the cache in connection with the collection

    Hello

    I create a report by using the .one problem collection has to happen when I hide any column in the report.
    Enter the value in the report and press Add button line to add the new line to insert the new record, and the previous value is to clear the cache.

    How can I remove this problem.

    and another question

    could you send me a link or sample report where the collection is used with multiple cascading select list more then select three list.



    Thank you
    Maury

    Maury,

    Have you written a PL/SQL process that updates the data in the collection, whenever any button is clicked? A collection is not updated by the SUBMIT button or add a LINE unless you write the code to make - table normal function tabular forms can use the MRU deals, but it can not be used when you use a collection, so you must write code to update the collection every time that the page is sent.

    I sent a link to an application that uses three LOVs cascading - as I said in my other thread, this is not based on a collection, but the LOV is nothing to do with the collections. In addition, even if it is based on 3 lists, you can extend that to 4, or more, lists easily enough as it is still used for each list after the first principle.

    Andy

  • How can I create custom with the Photosmart 6510 printers paper sizes

    I want to use paper sizes personalized with Word or Photoshop.

    I have a Photosmart 6510 printer all-in-one.

    While I can find the custom size tab layout in Word and can set this size, I don't seem to be able give the new size a name or save it.

    Is it possible with this printer, or is there a workaround to avoid the message 'paper mismatch '.

    Thanks for the ay help I can get.

    I'm sorry not to come back earlier.  I stumbled across a work around for this problem.  Use a different print driver for the printer.  I'll link the instructions below.  Again, sorry I don't come back with the workaround as soon as possible.

    How to assign other drivers to print in different Versions of Windows

  • The fonts using custom with the NDK

    Hello. I develop a simple game with the NDK and would like to know if anyone knows how I can load a police custom in the playbook in my game. I tried to copy it with the rest of the resources and charging from there, but when I try to load the font with the "FT_New_Face" function, I get an error and the error code returned is 1. I tried with different fonts (ttf and OTF) and the result is always the same. Anyone know how I can solve this problem, or even if it is possible? Thank you.

    I found the problem on my end, typo. The path must contain no attack "/":

    "app/native/BILLH___.TTF"
    

    Scott

  • Can we use type multiset and with the clause the two

    Please let me know how to use the multiset type and with the clause.

    You need more inlining, as for example in:

    SQL> select *
    from table (cast (multiset (select *
                                from (with t as (select deptno from dept)
                                      select * from t)) as sys.dbms_debug_vc2coll))
    /
    COLUMN_VALUE
    ----------------------------------------
    10
    20
    30
    40
    50                                      
    
    5 rows selected.
    
  • How to create a signature to emails customized with the fonts and colors that I select instead of the default values?

    create a snazzy to my e-mail signature

    Hi, I want to create a signature in my windows mail email... He will be only with the police, which is the standard... How do I create a jazzy, as have the font and the color I want? Thank you

    Note: The HTML Signatures must be less than 4 KB.

    Open a new Message window and create your signature. (Insert the graphic & text). Click on the Source tab (view |) Source Edit if not already checked). Highlight the complete source code and copy / paste into Notepad. File | Save under and in the file name field, save as htm, (i.e. Sig1.htm). It will be saved in My Documents by default. Go to tools | Options | Signatures. Click: File | Browse and insert your saved signature | Apply. You can now rename it if you wish.

    Of course, if the recipient reads in plain text, they don't see the it.

  • Problem with the collection xmltype column - tags endangered

    Hello

    Apex 4.0, I have a traditional relationship with this query:
    SELECT c.collection_name,
           c.seq_id,
           c.c001,
           c.c002,
           c.xmltype001.getclobval() xmltype001
    FROM   apex_collections c
    The xmltype001 column is set to display text (special escape characters). What I see on the page of this something column is:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
     <env:Header/>
     <env:Body>
     <m:tag1 xmlns:m="http://cosservices/COSServices.wsdl">
     <result xmlns:typ="http://cosservices/COSServices.wsdl/types/">
     <typ:tag2>
     <typ:subdepartmentCode>AUTO</typ:subdepartmentCode>
     <typ:subdepartmentName>Automotive</typ:subdepartmentName>
     <typ:itemNumber>0000610</typ:itemNumber>
    ...
    This column is filled by calling a web service using this package Apex web service utility, and this is the content for this column. However, when I export to CSV, what I see in the text file is the following:
      
      
        
          
            
              
              AUTO
              Automotive
         0000610
    ...
    In case you missed it: all tags have disappeared and that the actual data remained. If I change the type of column to Column Standard in the report, the same thing is happening on the page.

    My findings to date are:
    -Tags are present in the column, as it is sort of the column display in text type is smart enough to display the data correctly.
    -It seems that this has something to do with the character encoding, but I don't know how to fix it. I tried to use the convert() function but no luck.

    Any ideas?

    Thank you
    Luis

    Hi Luis,.

    It is not something as simple that the attribute "Strip HTML" report, is it?
    (ie - change no.)

    Scott

  • problem with the collection and refcursor

    I have the 'ServerDisconnect2' function below. It should return as 'ref_cursor' on the parameter that is a data container of deleted rows slider, Java developers insist on using this type of data/collection. I don't know how to code to return the values of ID removed as 'ref_cursor '. See commented "open pDeleteList" - sentence, it is commented as does not compile.
    CREATE OR REPLACE PACKAGE oe_ctx AS
      TYPE gIntegerTable IS TABLE OF INTEGER INDEX BY BINARY_INTEGER;
      TYPE cursor_type IS REF CURSOR;
    ....
    
      PROCEDURE ServerDisconnect2(pCasinoCode NUMERIC, pCasinoServerCode NUMERIC, pChannelServerCode CurrentLogins.ChannelServerCode%TYPE, pDeleteList OUT cursor_type) 
      IS
        vDeleteList oe_ctx.gIntegerTable;
      BEGIN
        DELETE FROM
        (
           SELECT cl.* FROM CurrentLogins cl, Accounts a
           WHERE cl.CasinoCode = pCasinoCode
           AND cl.CasinoServerCode = pCasinoServerCode
           AND cl.ChannelServerCode = pChannelServerCode
           AND cl.Code = a.code
           AND a.Type = 'lplayer'
           ORDER BY a.code
        ) RETURNING Code
          BULK COLLECT INTO vDeleteList;
          
    /*    OPEN pDeleteList FOR
          SELECT * FROM TABLE(vDeleteList);*/
          
        COMMIT;
      END ServerDisconnect2;
    Is it possible to convert the variable 'vDeleteList' in ref_cursor?
    So my only solution would be to open the ref_cursor BEFORE delete-clause with the same query delete clause has. But I'm afraid that then after opening the instant cursor after a milliseconds the deletion clause removes different lines and the procedure would be data incorrect in pDeleteList.

    Published by: CharlesRoos on August 26, 2010 06:10

    You need a collection of sql (created with CREATE TYPE...):

    I'll use the predefined collection sys.odcivarchar2list demonstation purposes:

    SQL> var cur refcursor
    
    SQL> declare
       ret_coll       sys.odcivarchar2list;
    begin
       delete from emp
         returning ename
              bulk collect into ret_coll;
    
       open :cur for select * from table (ret_coll);
    end;
    /
    PL/SQL procedure successfully completed.
    
    SQL> print
    
    COLUMN_VALUE
    -----------------------------------------------------------------------------------------------------------------------------
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER                                                                                                                       
    
    14 rows selected.
    
  • Trouble with the HTTPNFCLease object

    When you use the exportvm method, it returns an object 'ManagedObjectReference '.
    for a HttpNfcLease.

    However, I can't entirely to the subject of httpnfclease. It returns an object moref, and I can't do a get - view on it to get the httpnfclease object. I'm sure that there is something easy that miss me, but after playing with it for a few hours, I decided to get help.

    Help, please!

    This isn't really a true MoRef, it's a kind of XML node.

    Get the object in steps

    $vm = Get-VM MyVM $moref = $vm.ExtensionData.ExportVm()
    $nfc = Get-View $moref -Property Info
    

    The only reason why I know this is because I asked a similar question for a call to the ImportVApp method

    
    
  • Cannot group the text block with the linked object? (Advice, please!)

    6 inDesign doesn't let me a block of text with a related group object. (The block of text is aligned with the top of the object and the object is a placed .psd file).

    Perhaps my problem comes from the fact that ID doesn't let me choose both at the same time? It's one or the other, and the program refuses to do both. I inherited this program and the file I'm working on, in my work and I got a learning curve (frustration). It is perhaps an obvious question, because my skills are still pretty rough.

    Anyway, InDesign gurus... Please help! I've been working this for more than an hour, and it drives me crazy!

    Thanks in advance.

    Looks like the image is an anchored object. It's the only thing I can think of would select several items.

  • Problem with the Collection

    I have problems of filling of a collection.
    I created my collection on page load of the Page 7 for help
    BEGIN
    
    apex_collection.create_or_truncate_collection
      (p_collection_name => 'PEOPLE');
    
    END;
    The user then clicks on the "Copy" button that brings them to the Page 13.
    That's where I'm trying to complete my collection, by clicking on the link add to the report of the population.
    for x in (select * from gus_people_2 where id = :P13_ID)
    loop
      apex_collection.add_member(p_collection_name => 'PEOPLE', 
        p_c001 => x.id,
        p_c002 => x.rank,
        p_c003 => x.first_name,
        p_c004 => x.surname,
        p_c005 => x.dob,
        p_c006 => x.job,
        p_c007 => x.disp_seq);
    end loop;
    Once added, the Member of the collection should appear in the report of the full Collection.
    select c001, c002, c003, c004, c005, c006, c007, 'Remove' remove
    from apex_collections
    where collection_name = 'PEOPLE'
    I use Apex 4.1 on the Oracle website

    http://Apex.Oracle.com/pls/Apex/f?p=4550:1:0:

    Workspace: GUSCRIGHTON
    Username: ANGUS. [email protected]
    Password: terminator

    Application name: EXCEL_UPDATE_TEST

    Same username and password as described above.

    It's probably something really obvious, but I can't place it today.

    Any help appreciated.

    Gus

    Hi gUS,.
    Now, run your page, it will work.
    Thank you
    Loga

    Add the collection process
    Ask = exp1
    'ADD' - removed single quotes

    Remove the collection process

    Ask = exp1

    DEL - I gave this string.
    You will add later with link or a button.

    Published by: Logaa on May 18, 2012 06:04

  • Writable failing Volumes and Appstacks with "the device object parameter is not a valid object" at the launch of a .exe

    Previously, this error had been random between Appstacks and accessible volumes in writing, but became extremely coherent.   The full message is something like:

    C:\Program Files (x 86) \Mozilla Firefox\firefox.exe

    The device object parameter is not a valid object or is not attached to the volume specified by the file name.

    This accessible volume in writing will occur in a profile only (and UIA + profile) try to download and install the application, or what UIA only is only enabled when you try to run the installed applications.   It's almost as if the volume is not read/write permissions, but other information, such as the request for detailed information about the profiles are stored and used correctly.

    Running version 2.9

    Update - it seems that the question was of App - V Client being installed.

  • How to type a hyphen with the keyboard on my iPhone 6?

    I was on a call when they asked, for security reasons, to enter a code using my keyboard.  I didn't know how to do this? How can I type a hyphen by using my iPhone keyboard 6?

    You can not. There is no hyphens on the numeric keypad on an iPhone or any phone really. Only numbers or letters.

    Are you sure, that they asked a hyphen code?  If it were an IVR system it usually only accepts numbers and letters. no special characters. Some use either the * or the # as a placeholder for a special character. But that would be specific to the system that you have been interacting with that.

  • Can I still use Windows journal, if I have the handwriting recognition and just type my text with the default keyboard input?

    I have a Gateway laptop computer and I tried to use Windows journal without handwriting recognition.  So, he feels a bit lame that I can't understand how to enter text with my default keyboard or whatever it takes.  I think I'm pretty computer, so maybe I am an annomaly of persanal that seems to happen to me a lot!  Thus, any help I can get with this problem would be cool.  I type to fast however, just hunt and Peck, so please be patient.  Thanks in advance!

    Best regards, bryznet

    Hi bryznet

     

    Windows Journal is part of the Group of Tablet PC accessories. It is not a keyboard application.
    It is an application ink for taking notes of ink and writing to text conversion.
    If you want to simply type in the text, you can use a word such as Notepad or Microsoft Office Word application.

    If you want a combination of features of ink and/or the text of note taking, then watch Microsoft OneNote (think of it as Notepad Word, OneNote is)
    http://Office.Microsoft.com/en-us/OneNote/

    I hope this helps.

Maybe you are looking for

  • CPU frequency and bus on Satellite M30 is too low

    Hello The processor and my Satellite M30 bus seems to be significantly under speed. According to Windows XP Pro and Solaris Nevada, the processor is clocked at 600 MHz. The frequency of the BIOS, scaling parameter is set to "Still high", and I tried

  • The ICloud Q photo storage

    ICloud question: transferred photos off my iphone to icloud. You want to remove all of the iphone, but ensuring that they will remain on same icloud if deleted out of my phone. Thank you

  • Steam games crash computer bought in 2013

  • TextFormat text size does not

    Hello, I use this code to create a window that will be used for the settings dialog in my application. private function createSettings():void{ sw = new Sprite(); sw.visible = false; sw.graphics.beginFill(0xCCCCCC,0.9); var pos_x:Number = (stage.stage

  • "Next" page in Contribute

    I created a web page in Contribute, and to stay a bit handy, I want to have a second or third page added.  Ideally, users would be able to click "Next Page" or "Page 2" to access this page.  Is this possible in Contribute?  If so, how this is done?