Using Locator to Lob in the Collections

Hello
I'm using Oracle 11 g R2 11.2.0.2.0.

I use this procedure to get the images in the Collection, then LOB locator:
DECLARE
TYPE IMAGE_T IS TABLE OF IMAGE%ROWTYPE INDEX BY PLS_INTEGER;
t_img IMAGE_T;

TYPE BLOB_T IS TABLE OF IMAGE.CONTENT%TYPE INDEX BY PLS_INTEGER;
l_thumb    BLOB_T;
    
---
 
 BEGIN
 -- Get few images from IMAGE Table :

SELECT * BULK COLLECT INTO t_img from IMAGE  FOR UPDATE;

 for i in t_img.first .. t_img.last
loop
dbms_lob.createtemporary (l_thumb (i), true, dbms_lob.call) ;
dbms_output.put_line (i);
dbms_lob.freetemporary (l_thumb(i));
 END LOOP ;

 
 end;
 
But I get
ORA-01403: no data found
.
This to ensure that there is data in the table
SELECT * FROM IMAGE
[url https://lh6.googleusercontent.com/-0mMOXFfZ8pU/UawwBWIM3pI/AAAAAAAAAB0/lDAaOg5w9j8/s682/table.PNG] please click here to see the output
---------------------------------

Can you please help?

It is the Table of the IMAGE:
CREATE TABLE  "IMAGE" 
   (     "ID" NUMBER, 
     "UNIT_ID" NUMBER, 
     "CONTENT" BLOB, 
     "FILENAME" VARCHAR2(250), 
     "FLAG" VARCHAR2(1) DEFAULT 'O', 
     "MIMETYPE" VARCHAR2(100), 
     "FILESIZE" VARCHAR2(10), 
      PRIMARY KEY ("ID") ENABLE
   ) ;
 

CREATE UNIQUE INDEX  "SYS_IL0000102335C00003$$" ON  "IMAGE" (
  ;
 

CREATE OR REPLACE TRIGGER  "IMG_TRG" 
              before insert on IMAGE
              for each row
              begin
                  if :new.ID is null then
                      select dept_seq.nextval into :new.ID from dual;
                 end if;
              end;
/
Kind regards
Fateh

Published by: Fateh on 2 June 2013 22:53

Hello

Your clause to COLLECT BULK is totally OK - but you're in bulk in table 't_img '. Your loop so try

to pass from the first to the last item in this collection.

But in the loop, you try to make a temporary lob for the item 'i - th' in the table l_thumb (!) - and "l_thumb" is unintialized;

as a result, you get the 1403, ORA... If a solution might work like this...

DECLARE
TYPE IMAGE_T IS TABLE OF THE TAB_IMAGE_PROCESSING % ROWTYPE INDEX BY PLS_INTEGER;

t_img IMAGE_T;

TYPE BLOB_T IS TABLE OF THE TAB_IMAGE_PROCESSING. INDEX OF TYPE IMAGE % BY PLS_INTEGER;

l_thumb BLOB_T;

BEGIN

SELECT * COLLECT in BULK IN the t_img of TAB_IMAGE_PROCESSING for the UPDATE.

for me in t_img.first... loop of t_img. Last

l_thumb (i): = empty_blob();

DBMS_LOB.CREATETEMPORARY (l_thumb (i), true, dbms_lob.call);

dbms_output.put_line (i);

DBMS_LOB.freeTemporary (l_thumb (i));

END LOOP;

end;

/

This help...?

Carsten-

Tags: Database

Similar Questions

  • Can I use scan interface mode during the collection of the data of cRIO? How to view the data collected continuously on a waveform graph?

    Hello

    I intend to use cRIO as a standalone device to collect certain data off a tachometer House.  My goal is to store the data in the cRIO chassis, since it has its internal memory, but I can't even a cluster of data of the analog inputs of its devices.  I dragged and dropped the channel I collect data in a while loop, but it is only a point.  I want to see the data from the different time, what should I do?  Is this possible in Mode Interface Scan?  If Yes, could someone give me a simple example that shows streamed on a waveform data?  I would be very grateful!


  • I have five Airport extreme with their network of people names different location home.  I have a brighthouse router that I use to connect to all the extremes of the airport.  I experienced the problem of connection to the internet.

    I have five airport extreme, with their network of people of names in a different location in the House.  I have a brighthouse router that I use to connect to all the extremes of the airport.  I experienced the problem of connection to the internet.

    Are all connected to the Brighthouse router by Ethernet extremes? Are all of the extremes configured as bridges?

  • Where the log file is located (Win Vista) for the actions of OTHER USERS have taken to using the boxes in user account control?

    Where the log file is located (Win Vista) for the actions of OTHER USERS have taken to using the boxes in user account control?

    I use the version of Vista Home Premium.

    While I don't really like how the UAC area enters the information that tells it when to display the box tell me about your work of things on the UAC (I know an article exist on the web), is not how to answer this question.

    There is no log of UAC elevation file.

  • I have creative photography cloud I, m using Lightroom 4.5 for several months system crashed today I have no pictures in the Collection folder or anything. I need help, what do I do now? p

    I have creative photography of cloud, I use Lightroom 4.5 most of the time. When you edit photos two days ago 4.5 Lightroom crashed leaving me with no photos in the Collection, folders or anything. He continues to say yhat I have no pictures. What can I do to recover my thousands of photos and started using Lightroom CC 2015?

    To work properly, Lightroom needs three things:

    1. the program - Lightroom (you v4.5 and CC - both installed)?

    2. a file catalog (.) LRCAT)

    3. your original images. (If these are missing, you must restore backups)

    I suggest you open the Lightroom-CC program from creative application of Cloud, (OPEN the button appears after INSTALLATION)

    If LR - CC opens with no photos, go to Menu > file > catalog open (or press Ctrl + O)

    Find your file of catalog LR - 4.5 (the...) LRCAT) to open it.

    LR - CC will make a copy of the catalog file and convert the copy to work in LR - CC (LR can add "-2" at the end of the name)

    If it opens with your images everything is good - you use LR - CC with an updated catalog.

    Problems that may still occur.

    Your catalog LR4.5 is 'locked' due to a 'crash '. You must delete all files with the. LOCK the extension of the suffix, then try to open the catalog.

    Your LR4.5 catalog is corrupted. You will need to find and restore a previous backup of the catalog.

  • using fetch employeeid from the collection

    Hi all

    The code below may not fetch employee_id using the collection. can you please tell me where I was wrong.

    DECLARE

    Emp_table_type TYPE IS an ARRAY OF

    Employees.employee_id%type;

    my_emp_table emp_table_type;

    BEGIN

    SELECT employee_id IN my_emp_table FROM employees;

    BECAUSE me IN 1.my_emp_table.count

    LOOP

    DBMS_OUTPUT. Put_line (my_emp_table (i) .employee_id);

    END LOOP;

    end;

    WARNING: In BULK to COLLECT without a limit is a bad habit, correct it yourself.

    DECLARE

    TYPE emp_table_type IS TABLE OF THE employees.employee_id%type;

    my_emp_table emp_table_type;

    BEGIN

    SELECT employee_id COLLECT LOOSE my_emp_table FROM employees;

    BECAUSE me IN 1.my_emp_table.count

    LOOP

    DBMS_OUTPUT. Put_line (my_emp_table (i));

    END LOOP;

    end;

  • It is mandatory to use the manufacturers during the use of the collections?

    Code

    --------------------

    DECLARE

    Int_varray TYPE is VARRAY (3) integer;

    VARRAY_INT INT_VARRAY: = int_VARRAY();

    BEGIN

    DBMS_OUTPUT. Put_line ('VARRAY initialized with null');

    VARRAY_INT: = int_VARRAY (NULL, NULL, NULL);

    I'm in 1.3

    loop

    DBMS_OUTPUT. PUT_LINE ('INT_VARRAY('|| i||'): ' |) VARRAY_INT (i));

    end loop;

    DBMS_OUTPUT. Put_line ('VARRAY initialized as VALUES');

    VARRAY_INT: = int_VARRAY (11,12,13);

    I'm in 1.3

    loop

    DBMS_OUTPUT. PUT_LINE ('INT_VARRAY('|| i||'): ' |) VARRAY_INT (i));

    end loop;

    end;

    OUTPUT

    --------------------

    VARRAY initialized with null

    INT_VARRAY (1):

    INT_VARRAY (2):

    INT_VARRAY (3):

    VARRAY initialized as VALUES

    INT_VARRAY (1): 11

    INT_VARRAY (2): 12

    INT_VARRAY (3): 13

    The sample code above for collections works perfectly well with the help of a constructor method. However, my question is that is it possible to re - write the same code without using Builder methods?

    or is it mandatory to use constructors when the use of the collections?

    But he has not yet answered my question. Is it mandatory to use a constructor method? If 'NO', then how we can treat a VARRAY (not the tables / associative PLSQL) without a constructor method?

    When you have a basic question about the functionality of the Oracle, you should ALWAYS read the documentation.

    The doc of the PL/SQL language answers your question

    With the help of documents and Collections of PL/SQL

    Initializing and referencing Collections

    Until you initialize it, a nested table or varray is atomically null; the collection itself is zero, not its elements. To initialize a nested table or varray, you use a builder, a function defined by the system with the same name as the collection type. This function constructs collections from the elements that is passed.

    You must explicitly call a constructor for each varray and nested table variable. Associative arrays, the third type of collection, use no constructors. The constructor calls are allowed everywhere where function calls are allowed.

    Example 5-10 Initializes a nested table using a constructor, which resembles a function with the same name as the collection type.

  • Interactive report editable without using the Collection

    Hi Experts,

    I use Oracle Apex 4.2.5

    Is it possible to create an interactive report that can be changed in the same page? If the user edit a field, it must get updated in this table.

    Let me know if this is possible without assistance from the Collections of the Apex

    BR,

    Patrick

    Paul Broughton says:

    Hi Patrick,

    I also agree there is no out of the box solution, I need this for an application and I used elements of the APEX of the APEX_ITEM API

    Here is a very basic example that I have not tested, but you have a question, something like:

    [code]

    Select

    APEX_ITEM. DISPLAY_AND_SAVE (1, empno) as patient_id,

    APEX_ITEM. TEXT (2, ename) as ename

    Of

    EMP;

    [/ code]

    Make sure you use columns of standard report as your column types.

    When you click on submit you'd have a process similar to the following:

    [code]

    Start

    BECAUSE me in 1... APEX_APPLICATION. G_F01. COUNTING LOOP

    Update emp

    set ename = apex_application.g_f02 (i)

    where empno = apex_application.g_f01 (i);

    end loop;

    end;

    [/ code]

    That's assuming you don't need inline editing.  If you do this will require an even more customized solution, but the way above requires no collections.

    Thank you

    Paul

    Hi Paul,.

    I think that IR out-of-box features do not work correctly when you use the APEX_ITEM functions in the query.

    Here's another one you could use APEX 4.2

    Yet another way to create & quot; editable interactive report & quot;

    Kind regards

    Jari

  • 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

  • help to try to simplify the form table, based on the collection using dynamic measurements

    Hi everyone, I have tried cleaning and simplify an application designed in 2008 apex 3.2.  We have improved in 4.1.2 and want to take advantage of our understanding of the apex and the dynamic measures to simplify a large part of our code, get rid of the redundancies and make it easier for the programmer to debug and improve next.

    The application is for traders and commercial fishermen and currently has around 4100 users.

    The part that I'm trying to simplify is a tabular report, based on a collection.  Almost all areas in this tabular form has a logic linked to it... and in most cases, it is superfluous in that it executes a UPDATE_MEMBER on the collection.  I would like to remove as much of javascript and additional processes as possible.   I'm also still very new to jQuery and javascript, and faced with the two... but competent in pl/sql.

    tabular query is:

    {code}

    SELECT
    seq_id,

    apex_item. Text (1, seq_id, "," "id ="f01_"| seq_id,",")"DeleteRow. "

    apex_item.text_from_LOV (C004, 'SPECIES'). » -'|| apex_item.text_from_LOV (C005, 'RANK') | » -'|| apex_item.text_from_LOV (C006, 'MARKETCODE') | » -'|| Unit apex_item.text_from_LOV_query (c007, 'select unit_of_measure d, unit_of_measure r species_qc'),

    apex_item.select_list_from_LOV (6, c008, "STOP," onchange = "getAllDisposition('||) seq_id. "" ")" ',' YES, '0', "- Select favorite -", ' f06_ ' | seq_id, cm) available.

    apex_item.select_list_from_LOV (7, c009, style of ' GEAR, "=" background-color: #FBEC5D;) "onFocus ="checkGearPreviousFocus('||). " seq_id |') ; "OnChange ="getAllGears('|| seq_id ||). " "" ")" ',' YES, 'f07_', "- Select favorite -", "3333" | seq_id, cm) Gear,.

    apex_item. Text (8, TO_NUMBER (c010), 5, null, "onchange ="setTotal('||)) seq_id. ")" «, » f08_'|| seq_id, cm) quantity.

    apex_item. Text (9, TO_NUMBER (c011), 5, null, "onchange ="getPriceBoundaries('||)) seq_id. ")" «, » f09_'|| seq_id, cm) price.

    apex_item. Text (10, TO_NUMBER (c012), 5, null, "onchange ="changePrice)
    ('| seq_id |') "onKeyDown = selectDollarsFocus('||) "(seq_id |', event);" ',' f10_'| "" seq_id, cm) $,.

    Decode (c013, 'Y', apex_item.text (11, c014, 30, null, "style =" background-color: #FBEC5D;)) ' onClick = 'onFocusAreaFished('|| seq_id||'); "',' f11_'. seq_id, cm), "n","N/A") Area_Fished, "

    Decode (c017, 'Y', apex_item.text (12, c018, 4, null, "style =" background-color: #FBEC5D;)) "onBlur ="setUnitQuantity('||). " seq_id. ")" «, » f12_'|| seq_id, cm), "n","N/A") UNIT_QUANTITY, "

    Decode (c017, 'Y', apex_item.text (13, 'CN', 3, null, "readOnly = readOnly; ',' f13_'|")) seq_id, cm), "n","N/A") UNIT_COUNT, "

    Decode (c050, 'Y', apex_item.checkbox (14, 'Y','id = "f14_" | seq_id |')) "style =" background-color: #FBEC5D; " onClick = "alterYes('|| seq_id||');" "onKeyPress = alterYes('||) (("(seq_id |');" ', c021), "n", "S/o") FinsAttached,.

    decode (c050, 'Y', apex_item.checkbox (15, ', "id ="f15_"|")) seq_id |' "style =" "background-color: #FBEC5D;" onClick = "alterNo('||)" seq_id |') ; "onKeyPress = alterNo('||) (("(seq_id |');" ', c022), "n", "S/o") FinsNotAttached,.

    Decode (c050, 'Y', apex_item.checkbox (16, 'U','id = "f16_" | seq_id |')) "style =" "background-color: #FBEC5D;" onClick = "alterUnk('||)" seq_id |') ; "onKeyPress = alterUnk('||) (("(seq_id |');" ', c023), "n", "S/o") FinsUnknown,.

    Decode (c050, 'Y', apex_item.textarea (17, c028, 3, null, "onchange ="setExplanation('||))) seq_id. ")" «, » f17_'|| seq_id, cm), "n","N/A") explanation, "

    Decode (c024,' no, apex_item.select_list_from_LOV (18, c029, 'HMSNATURE','onchange = 'saveNature('||))) seq_id. ")" ',' YES, ' one ', "- Select Nature of sales -", "f18_" | seq_id, cm), 'U', apex_item.select_list_from_LOV (18, c029, 'HMSNATURE','onchange = "saveNature('||)) seq_id. ")" ',' YES, ' one ', "- Select Nature of sales -", "f18_" | seq_id, cm), 'Y', 'N/a') Nature_Of_Sale,.

    decode (c020, 'Y',
    apex_item.select_list_from_LOV (40, c040, 'HMS_AREA_CODE',
    "style =" background-color: #FBEC5D;
    "onchange ="saveHMSAREA('||). " seq_id |', this.value) "',' f40_'|" seq_id, cm),
    (' N N/A ',' ') HMS_AREA_CODE;

    C020, c050,

    decode (c020, 'Y',
    apex_item. Text (41, TO_NUMBER (c041), 5, null, "onchange ="setSalePrice('||)) seq_id |', this.value) "',' f41_'|" seq_id, cm),
    (' N n/a ',' ') Sale_Price

    of apex_collections
    where collection_name = 'SPECIES_COLLECTION' order by desc seq_id

    {code}

    I am slow at first and just try to replace the ONCHANGE for apex_item 41 (retail price).   I hope that finally replace all the onblur/onchange to use the same dynamic action.

    The ONCHANGE for apex_item 41 is currently:

    {code}

    function setSalePrice (pRow, savePrice)

    {

    get var = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is saveSalePrice', 0);

    Get.Add ('SETVALUE3', savePrice);

    Get.Add('ATTRNBR3','41');

    Get.Add ('SEQUENCEID', Prow);

    gResult = get.get ();

    }

    {code}

    the saveSalePrice application process is:

    {code}

    Start

    apex_collection.update_member_attribute (p_collection_name = > 'SPECIES_COLLECTION',)

    p_seq = >: SEQUENCEID.

    p_attr_number = >: ATTRNBR3,.

    p_attr_value = >: SETVALUE3);

    end;

    {code}

    I created two new hidden fields: P110_ID and P110_VALUE.

    I created a dynamic action: CHANGE COLUMN

    event: change

    selection type: jQuery Selector

    jQuery Selector: input [name = "f41"]

    real action 1 - records P110_ID with javascript expression: this.triggeringElement.id

    real action 2 - P110_VALUE value with javascript expression: this.triggeringElement.value

    true action 3 - run pl/sql code

    {code}

    declare

    number of v_member;
    number of v_seq;

    Start
    v_member: = TO_NUMBER (SUBSTR (: p110_id, 2, 2));
    Select ltrim (substr(:p110_ID,5,4),'0 ') in the double v_seq;

    safis_collections.update_column (v_seq,
    v_member,
    (: p110_value);
    end;

    {code}, where safis_collections.update_column is a package of db

    {code}

    Procedure update_column ()v_seq in varchar2

                            v_attr in number ,

                            v_value in VARCHAR2 )

    is

    Start

    apex_collection . update_member_attribute()p_collection_name=> 'SPECIES_COLLECTION'

                         p_seq = > v_seq ,

    p_attr_number = > v_attr ,

    p_attr_value = > v_value );

    apex_debug . message ()'put a day of column.seq ='| v_seq || 'attribute =' || v_attr || "with" || v_value );

    end ;

    {code}

    real action 4 - refreshment area

    I modified the query in a table to reference apex_item 41 to be

    Decode(C020,'Y',apex_item.) Text (41, TO_NUMBER (c041), 5, null), 'No,' N/a ') Sale_Price in the hope that it would fire the dynamic action.   I get the below error.  The value of P110_ID is null, the value of P110_VALUE seems to be correctly set.

    call returned Ajax Server ora error-sequence of 20103:member does not work
    There are in the collection 'SPECIES_COLLECTIO' application to run PL/SQL code

    I appreciate all thoughts/help on this.

    Thank you, Karen

    AHHA.  change the query to

    Decode (c050, 'Y', apex_item.textarea (28, c028, 3, null, null,,'f28_'| seq_id, cm), ' n ',' n/d "") explanation,.

    and that did the trick.  On the next item.

  • Why use the collections?

    Please help me to better understand and to right the next point

    to move from a PPT available in internet, I read a sentence under the heading "Why use collections?" Please find here

    Use of complex data sets information to host non-PL/SQL environments using table functions

    I think I understand: it means that complex data sets can be collected from oracle using only a single sql statement by using the installation, called Oracle Pipelined Table functions. http://www.akadia.com/services/ora_pipe_functions.html]

    Is any other installation in oracle to the serveup of complex datasets of the information to the host non-PL/SQL environments?

    Published by: o Manjusha Muraleedas, error corrected spelling.

    I watched the presentation and here's how I read it (although you might be better to ask the author):

    Manjusha Muraleedas wrote:
    My question is, why the statement "Serve up complex data sets of information to host non-PL/SQL environments using table functions" came under the title "Why use collections?". Just because there's an installation? or any other really good news?

    There is a hypothesis that is unwritten in the presentation: "complex" data is data that must be handled in PL/SQL, because only SQL does not work.

    Nowhere the author says that a pure SQL solution should be changed into a solution of PL/SQL.

    Once you decide that you must use the PL/SQL, you might want to put your data in collections in scalar variables.

    I understand, complex data, works of art (suppose a structure with 3 columns of tables joing 5) can be meet non-pl/sql envirormment like Java, the use of the ref Cursor or xml. Collection using to do the same thing, this is not a good option.

    Again, I think that the author uses "complex" as a shortcut for 'need to PL/SQL in the first place'. If the data must be processed in PL/SQL, there is no need to use PL/SQL scalar variables or collections.
    I would say "use of the ref Cursor. Providing relational data in format XML should be the exception, not the rule. It has a cost of additional performance.

    Now lets talk about pipeline table functions.
    ...
    functions table pipeline reached the performance of parallel processing. so even if binding commodity of time and memory is there, it will be performs better than refcursors or xml?

    Pipeline table functions perform no better than the ref Cursor. There are two processes running, one to SELECT and the other for the function, there will be more work on the server. With a ref cursor, there is a fair process to return the data.

    Parallel processing is not a problem. If you can make it work in plain SQL, you can do in parallel in SQL simple.

    Published by: Ashton stew on January 22, 2013 16:44

  • bind variables using the values in the collection

    Hi the gems... Good afternoon...

    Can we not use plsql values in the collection in the USING clause to pass the bind variable values...

    I wrote the procedure to kill all sessions that cross the parameter OPEN_CURSORS below. the query, I found only three sessions that exceed. But when I execute my procedure so those are not removed, execution gives me an error also. He simply executed but no session has been killed.

    My part of the code is as below:
    ..........
    ..........
    ..........
    OPEN rc FOR v_sql;
        FETCH rc BULK COLLECT
            INTO v_tt_sessions;
        LOOP
            EXIT WHEN v_tt_sessions.COUNT = 0;
            FOR idx IN 1 .. v_tt_sessions.COUNT
            LOOP
                EXECUTE IMMEDIATE 'alter system kill session '':a,:b'' immediate'
                    USING v_tt_sessions(idx).sid, v_tt_sessions(idx).serial#;
            END LOOP;
        END LOOP;
    CLOSE rc;
    .........
    .........
    However, when I replace the bind variable with the values in the collection, then it works:
    ..........
    ..........
    ..........
    OPEN rc FOR v_sql;
        FETCH rc BULK COLLECT
            INTO v_tt_sessions;
        LOOP
            EXIT WHEN v_tt_sessions.COUNT = 0;
            FOR idx IN 1 .. v_tt_sessions.COUNT
            LOOP
                EXECUTE IMMEDIATE 'alter system kill session '''||v_tt_sessions(idx).sid||','||v_tt_sessions(idx).serial#||''' immediate';
            END LOOP;
        END LOOP;
    CLOSE rc;
    ..........
    ..........
    Please suggest if there is something wrong in my code first. I tried, but could not get any inadequacy.

    But the doubt is when I removed the variable of liaison with the values of the collection hard-coded (in my first post), then this process works very well. But I want to use bind variables.

    You cannot use bind variables in this situation. You can use bind variables for the DML statements.
    I'm surprised that you have no error, but I guess that this block of code explains everything:

    EXCEPTION
        WHEN OTHERS THEN
            dbms_output.put_line(SQLCODE || ' : ' || SQLERRM);
      
    

    You concatenate values to build a single command ALTER SYSTEM and run, just like your second attempt.
    You don't need to have a dynamic cursor either.

    for r in (
      select v.SID, u.serial#, count(v.sid)
      from v$open_cursor v, v$session u
      where v.CURSOR_TYPE='OPEN'
      and v.sid=u.sid group by v.sid, u.serial#
      having count(v.sid)>190
      order by count(*) desc
    )
    loop
      execute immediate 'alter system kill session '''||r.sid||','||r.serial#||''' immediate';
    end loop;
    

    And of course, I agree with the comments of Keith (assuming that this is not just an exercise).

    Published by: odie_63 on October 16, 2012 14:03

  • In a table by using the Collection update of nulls

    I use collections to create a form in a table. However, I can't get the code to work. Could you please look at my logic and let me know what I am doing wrong?
    Apex version: 4.1
    1 process name: load Collection
    a. process Point: On Load - before the header
    Condition (b) process:
    i. the condition Type: PL/SQL expression
    + ii.     Expression:
     not apex_collection.collection_exists(p_collection_name => 'STAKEHOLDERS_COL')
    +
    c. code:
    if apex_collection.collection_exists('STAKEHOLDERS_COL') = TRUE then
       apex_collection.delete_collection(
             p_collection_name =>'STAKEHOLDERS_COL');
    end if;
    apex_collection.create_collection_from_query(
        p_collection_name => 'STAKEHOLDERS_COL',
        p_query => 'select id
                   , stakeholder_name
                   , stakeholder_role_id
                   , primary_contact_yn
                   , receive_notification_yn
                   , ''O'' original_flag
                   , wwv_flow_item.md5(stakeholder_name, stakeholder_role_id, 
                     primary_contact_yn, receive_notification_yn) 
                   from eba_prjv_proj_stakeholders,
       p_generate_md5 => 'YES'
    );
    * 2.     Report on the collection:
    a. query:
    select 
    apex_item.hidden(1,c001) id,
    apex_item.popupkey_from_query(2,c002,'select user_name d, user_name r from eba_prjv_app_users order by 1', 10) name,
    apex_item.select_list_from_query(4,c003,'select role_description d, id r from eba_prjv_stkhlder_roles order by role_code', 10) role,
    apex_ITEM.SELECT_LIST(5,c004,'N','Yes;Y,No;N') primary_contact_yn,
    apex_ITEM.SELECT_LIST(6,c005,'N','Yes;Y,No;N') receive_notifications_yn,
    apex_item.hidden(7, c006) status,
    apex_item.checkbox(8, seq_id) chkbx,
    apex_item.hidden(9, seq_id) seq_id
    from apex_collections
    where collection_name = 'STAKEHOLDERS_COL'
    AND c006 IN ('O','N','U')
    * 3.     I have a button 'Add a line' add a blank line for inserts. The button "submit page" REQUEST As "ADD". *
    * 4.     The process of adding new line: *.
    a. process Point: after submit - by the calculation and Validation
    b. process of Condition: what key - add row
    c. code:
    begin
    apex_collection.add_member(
    p_collection_name => 'STAKEHOLDERS_COL',
    p_c006 => 'N',
    p_generate_md5 => 'YES' );
    end;
    * 5. I have a button Delete who submits the request page = 'DELETE '. *
    * 6.     Collection update process:
    a. process Point: after submit - by the calculation and Validation
    + b.     Condition of process:
    REQUEST != 'ADD'
    +
    c. code:
    DECLARE
    l_status VARCHAR2(1);
    l_seq_id NUMBER;
    l_original_md5 VARCHAR2(4000);
    l_array_md5 VARCHAR2(4000);
    
    BEGIN
    
    FOR i IN 1..apex_application.g_f01.count LOOP
    
    -- Check previous status of Collection Member
      
       SELECT c006, c007 INTO l_status, l_original_md5
       FROM apex_collections
       WHERE 
       collection_name = 'STAKEHOLDERS_COL'
       AND seq_id = apex_application.g_f09(i);
    
    IF l_status = 'N' THEN
       l_status := 'N';
       
    ELSE
       SELECT wwv_flow_item.md5(apex_application.g_f02(i)
       , apex_application.g_f04(i)
       , apex_application.g_f05(i)
       , apex_application.g_f06(i))
       INTO l_array_md5
       FROM DUAL;
       
       IF l_original_md5 != l_array_md5 THEN
          l_status := 'U';
       END IF;
    END IF;
    
    
    IF l_status IN ('N','U') THEN
       
       apex_collection.update_member(
       p_collection_name => 'STAKEHOLDERS_COL'
       , p_seq => apex_application.g_f09(i)
       , p_c001 => apex_application.g_f01(i)
       , p_c002 => apex_application.g_f02(i)
       , p_c003 => apex_application.g_f04(i)
       , p_c004 => apex_application.g_f05(i)
       , p_c005 => apex_application.g_f06(i)
       , p_c006 => l_status
       , p_c007 => l_original_md5
     );
    END IF;
    END LOOP;
    IF :REQUEST = 'DELETE' THEN
       FOR i IN 1..apex_application.g_f08.count LOOP
       -- Check previous status of Collection Member
     
      SELECT seq_id, c006 INTO l_seq_id, l_status
      FROM apex_collections
      WHERE collection_name = 'STAKEHOLDERS_COL'
      AND seq_id = apex_application.g_f08(i);
    
      IF l_status = 'N' THEN
         apex_collection.delete_member(
         p_collection_name => 'STAKEHOLDERS_COL'
         , p_seq => l_seq_id
        );
      ELSE
        apex_collection.update_member_attribute(
        p_collection_name => 'STAKEHOLDERS_COL'
        , p_seq => l_seq_id
        , p_attr_number => '6'
        , p_attr_value => 'D'
       );
      END IF;
     END LOOP;
    END IF;
    
    end;
    * 7.     Update the collection table
    a. process Point: present - according to calculation and Validation
    b. process of Condition: If the key (APPLY_CHANGES)
    c. code
    DECLARE
    l_table_md5 VARCHAR2(4000);
    l_collection_md5 VARCHAR2(4000);
    BEGIN
    
    FOR c1 IN (SELECT c001, c002, c003, c004, c005, c006, c007,seq_id
    FROM apex_collections
    WHERE collection_name = 'STAKEHOLDERS_COL'
    ) LOOP
    
    IF c1.c006 = 'N' THEN
       insert into eba_prjv_proj_stakeholders
                ( STAKEHOLDER_NAME,
                 STAKEHOLDER_ROLE_ID,
                 PRIMARY_CONTACT_YN,
                 RECEIVE_NOTIFICATION_YN
                 )
                values
                (c1.c002,
                 c1.c003,
                 c1.c004,
                 c1.c005            
                );
    ELSIF c1.c006 = 'D' THEN
       DELETE FROM eba_prjv_proj_stakeholders
       WHERE id = c1.c001;
    ELSIF c1.c006 = 'U' THEN
       -- Check the record hasn't been updated since the query
       -- Get MD5 checksum from the Table
      
     SELECT wwv_flow_item.md5(STAKEHOLDER_NAME, STAKEHOLDER_ROLE_ID, PRIMARY_CONTACT_YN, RECEIVE_NOTIFICATION_YN)
       INTO l_table_md5
       FROM eba_prjv_proj_stakeholders
       WHERE id = c1.c001;
       -- Compare the checksum values and if they are different, raise an error.
       IF l_table_md5 != c1.c007 THEN
          raise_application_error( -20001
          , 'Current version of data in database has changed '||
            'since user initiated update process.');
         return;
      END IF;
    
      UPDATE eba_prjv_proj_stakeholders set
      STAKEHOLDER_NAME = c1.c002,
      STAKEHOLDER_ROLE_ID = c1.c003,
      PRIMARY_CONTACT_YN = c1.c004,
      RECEIVE_NOTIFICATION_YN = c1.c005
      where id = c1.c001;
    end if;
    end loop;
    apex_collection.delete_collection( p_collection_name => 'STAKEHOLDERS_COL' );
    END;
    At the end of the process, I see null values inserted in my table. The report also displays null values.

    Published by: jaouad khalifi on August 17, 2012 04:26

    Published by: jaouad khalifi on August 17, 2012 04:42

    Published by: jaouad khalifi on August 17, 2012 04:46

    Published by: jaouad khalifi on August 18, 2012 02:03

    Hello

    I changed and then brought back to the State that you had.

    The problem here is that you have status and Seq_id returned with APEX_ITEM. HIDDEN, but you have not selected the Show check box for those columns attribute report tab.

    Thus there is no f06 and f09 only named elements in your HTML DOM and therefore no APEX_APPLICATION. G_F06 and G_F09. If your processes

    FOR correct here is what you do

    1. mark the status and Seq_id as indicated in the report attribute tab columns
    2. change the ACE status display hidden to report column Standard. Change display of the Seq_id also report Standard column

    Note that when a column is not marked to show in the report he becomes any and you don't see the associated items in the DOM HTML.

    See you soon,.

  • Data Modeler: how to create and use the collection type

    Hello
    essentially of departure I don't understand how (for example) create and use the data based on the type of data varray type.

    Please notify.
    Thank you
    Andrew

    Hi André,.

    You can create new types of collection (varray/table) in two ways:
    (1) in the browser - find 'Types of data' > 'Types of Collection' node menu dropdown - there just 'create new collection type' it
    (2) in the types of data model diagram - you can create collection "some type structured" or collection of references to the it - use 'new Collection... '. "tool and click first on sight structured type and after the structured type that will contain the collection - new attribute is added to the latter and if there is none this type of collection already didn't set the new collection type are created and you can change it later.

    Philippe

  • How can insert quary in database by using the collection.

    Hi friends,


    My friend advice me to insert several point with collection for the use of multiple lines. But I don't know how to use the collection. How do I create the form to insert data using the collection.
    Please send me any link or example .au insert data into database by using the collection.



    My problem is:-

    I have a bill with several point for example. Grapes (25) with amount here and now I want to add these question with quantity in my database, Badam (145), banana (49), Apple (12)
    When I finally click on submit button.

    Actully I was used as a table but I am facing a problem when using tabular, tabular, I enter first item for example. Apple and there quantity for example. 12 in the textfield and after clicking on Add line enter Buttom went to the database. but I want that entry should not go the database. But only the new line should add when I click on the button Add a line.

    I want all these point 4 should enter into the database when I click on Submit Final.


    Maury

    Published by: Ed on September 6, 2009 02:22

    Hello

    I would do something like the code:

    BEGIN
     DECLARE
      vDATE DATE;
     BEGIN
      vDATE := TO_DATE(:P1_DATE1,'DD.MM.YYYY');
      WHILE vDATE <= TO_DATE(:P1_DATE2,'DD.MM.YYYY')
      LOOP
        INSERT INTO ABC (DTE, LEAVE)
        VALUES (vDATE, :P1_C);
        vDATE := vDATE + 1;
      END LOOP;
     END;
    END;
    

    You must ensure that the datepicker points both use the ' JJ. MM YYYY ' date format.

    Andy

Maybe you are looking for

  • Battery charge disable Lenovo Z500

    Hi all I recently got the Z500, working under Windows 8. I have a question about the battery charge. I'm working on the laptop for long periods of time with the power supply connected. Because it is bad for the battery, is it possible to disable the

  • Just updated BIOS to support Assistant HP, such as not notified - now no laptop

    HP Wizard pops up and says there are two updates tonight... Wireless LAN and BIOS I've updated both using the guests of the wizard, and it restarted, flashed the BIOS, checked, then displays a screen announcing that the laptop might restart to finish

  • Cannot print. Error message.

    I try to print using my officejet 6500 a and get this message: internal processing error.  Start again or manually check the firmware updates.  This is all new to me.  Help, please!  I don't know where to go for updates of the firmware...

  • BIOS password protected

    I'm trying to change the boot order in the BIOS (HP envy m6 with AMD A8 and Win8.1), but asks me a password.  It does not accept the passwords I've used on this computer.  After 3 attempts I get "System disabled" and a number generated from seemingly

  • Need help developing a Playbook application

    I need to write a user interface application based for playbook that needs to interact with C++ code an existing application of the playbook. I was wondering what would be the best option #1 develop the user interface using native C/C++ SDK - interfa