Associative Array Question

Hi All,
I've searched through this forum trying to find information I'm needing on associative arrays with a varchar2 index without luck. What I'm looking for is a way to get the index or "key" values of the array without knowing what they are. Meaning, I wouldn't have to know the index value when designing the array but would be able to utilize them values at runtime. For those familiar with Java it would be like calling the keySet() method from a Map object.
So, if I have an array of TYPE COLUMN_ARRAY IS TABLE OF VARCHAR2(4000) INDEX BY VARCHAR2(100) is there any way to dynamically get the index values without knowing what they are?
Any help is appreciated.
Thanks

Thanks for the response.
I am aware of using FIRST and NEXT for iterating the array but can I extract the index value of the current element into a variable when I don't know what the index value is at runtime ?
Thanks

Similar Messages

  • Associative Array to Nested Table: Anything faster?

    (First Post! Some ASP.NET references, but I think this really is a PL/SQL question)
    I work on a team that runs an Oracle instance for data warehousing and reporting along with an ASP.NET based website for display.
    Sometimes, I may want to have many parameters come in and only show records that match those parameters. For example, I may want to show all employees who are Managers or Developers and not show employees who are Accountants or Scientists. Typically, I send a parameter into my PL/SQL stored procedures as an associative array (as declared in my package specification). Once in the procedure, I convert that associative array into another associative array (as a user created SQL type) and then I'm able to use it like a nested table to join on.
    My question is: in your experience, is there any way to get around this type conversion or another faster way?
    For example:
    -- Create the sql type
    CREATE OR REPLACE TYPE DIM.sql_string_table AS TABLE OF VARCHAR2(255);
    --pretend that this works and it's in a package body
    declare
    type string_table is table of varchar2(255) index by binary_integer;
    l_job_types string_table; -- Keep in mind I'd normally be sending this via ASP.NET
    l_job_types_nested sql_string_table := sql_string_table();
    begin
    -- Add some data
    l_job_types(0) := 'Manager';
    l_job_types(1) := 'Developer';
    -- Do the conversion
    for i in l_job_types.first .. l_job_types.last
    loop
    l_job_types_nested.extend;
    l_job_types_nested(l_job_types_nested.count) := l_job_types(i);
    end loop;
    -- get some data out (we're pretending)
    open fake_ref_cursor for
    Select e.*
    from employees e,
    the(select cast(l_job_types_nested as sql_string_table) from dual) jobs_types_wanted
    where e.type = value(jobs_types_wanted);
    end;
    The result would be all employees whose have a type that was input into the l_job_types associatve array.
    See: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:110612348061
    for additional reference

    > I convert that associative array into another associative array (as a user created SQL type)
    Just so we're clear, Oracle use the term 'associative array' to refer to the exclusively PL/SQL sparse collection type ("table of x index by pls_integer" etc) as distinct from the common nested table collection type.
    Also I could be wrong but I think
    SELECT ..
    FROM   the(select cast(l_job_types_nested as sql_string_table) from dual) jobs_types_wantedis generally the same as
    SELECT ..
    FROM   TABLE(l_job_types_nested) jobs_types_wantedthough "SELECT *" and implicitly collection casting don't always mix. The "THE()" syntax is deprecated.

  • Associative Array, Drp-DwnList and Accesing "SubArray" Values ?

    Based on the users selection on a drop-down box, I need to be able to access different elements associated with that selection (elements of a subArray, so to speak)
    I am not certain how to go about creating arrays in LiveCycle. I've tried a number of things including:
    putting the array name in the "variables tab" of the Form Properties, with a value of [] -- that doesn't seen to be the way to go, so I removed it
    using rounded brackets ( instead of square [
    declaring the arrays differently using var codeDetail = new Array(array,Values,Here);
    putting the code in a fragment--not sure how to reference the values,
    I have the following code residing in the "Exit" event for the drop-down box:
    var codeDetail = [];   //an associative array
    codeDetail["99999"] = ["None",null,null,null,null,null,null,null];
    codeDetail["78400"] = ["Trampoline",40,45,50,60,10,20,40];
    codeDetail["78020"] = ["Horse(s)",10,12,15,20,5,10, 20];
    codeDetail["78401"] = ["Horse Boarding (each)",19,23,28,39,17,24,48];
    codeDetail["78010"] = ["Watercraft - Outboard over 50 HP (each)",13,18,20,24,17,24,48];
    codeDetail["78011"] = ["Watercraft - Inboard or I/O over 50 HP (each)",30,35,40,50,17,24,48];
    codeDetail["78050"] = ["Recreational Vehicle: ATV (each)",40,51,61,84,9,11,22];
    codeDetail["78053"] = ["Recreational Vehicle: Snowmobiles (each)",36,46,55,76,9,11,22];
    codeDetail["78052"] = ["Recreational Vehicle: Golf Carts (each)",29,37,44,61,9,11,22];
    codeDetail["73000"] = ["Personal Injury",14,19,22,31,null,null,null];
    codeDetail["78030"] = ["Office, School or Studio",10,11,13,19,9,17,34];
    codeDetail["78060"] = ["Retail Sales",36,46,56,77,3,4,8];
    codeDetail["78061"] = ["Incidental Business Pursuits",36,46,56,77,3,4,8];
    codeDetail["78070"] = ["Additional Insured: Premises Only",8,10,12,17,null,null,null];
    codeDetail["78090"] = ["Additional Insured - Personal Libility",31,40,50,69,9,17,34];
    codeDetail["78040"] = ["Seasonal Residence Occupied by Insured",10,11,13,19,3,4,8];
    codeDetail["78041"] = ["Rented to Others: One Family",23,28,34,47,9,17,34];
    codeDetail["78042"] = ["Rented to Others: Two Family",29,35,43,61,11,23,45];
    codeDetail["78043"] = ["Rented to Others: Three Family",43,55,66,90,17,33,60];
    codeDetail["78044"] = ["Rented to Others: Four Family",67,83,100,139,24,50,80];
    codeDetail["76000"] = ["Waterbed Liability",10,12,13,19,null,null,null];
    codeDetail["78300"] = ["Non-Owned and Hired Auto Liability",56,69,80,92,17,24,48];
    itemChosen = [];  //a subArray
    var i = this.rawValue
    itemChosen = [codeDetail[i]];    //  values based on user's selection
    The goal is to now be able to use the itemChosen values and simply refer to them:
    this.rawValue = itemChosen[i]   or   this.rawValue = itemChosen[someField.rawValue]
    So if this drop-down box has a rawValue = "78400" then itemChosen[2] would have a value of 45 (see above).
    Am I anywhere close?
    Also, a couple of other questions:
    When using a variable.value or a field.rawValue as the index value for itemChosen[i]
    do you include "" or .value or .rawValue in the index brackets?
    Do you ever use .value when referencing an array as in: itemChosen[i].value
    How do I make sure arrays and variables created like this are global, or not? I tried with and without the "var" declaration
    Thanks much!
    Stephen

    I've just been playing with a similar thing.
    My code is based on a sample from WindJack Solutions, which is available here:
    http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle
    Check this thread for a good sample from Bruce, he took my code and jacked it up considerably.
    http://forums.adobe.com/message/2203834#2203834
    If you google "multi dimensional javascript arrays" you'll find quite a bit of info too.

  • Returning collection-associative array from pl-sql procedure

    CREATE OR REPLACE procedure test_ganesh( p_deptno IN number,gana out PARTIES_RESULT)
    is
    query varchar2(200);
    PARTY_ID varchar2(200);
    PARTY_CODE varchar2(200);
    PARTY_NAME varchar2(200);
    PARTY_SEQ VARCHAR2(200);
    counter number;
    TYPE PARTIES IS TABLE OF varchar2(2000) index by binary_integer;
    txn_parties PARTIES;
    type PARTIES_RESULT IS TABLE OF PARTIES index by binary_integer;
    total_result PARTIES_RESULT;
    TYPE EmpTyp IS REF CURSOR;
    p_du EmpTyp;
    p_cursor EmpTyp;
    global_counter number;
    begin
    global_counter:=1;
    counter:=1;
    open p_cursor FOR
    select A.ref_no
    from ot_lc_txn_details A
    where rownum <12;
    LOOP
    FETCH p_cursor INTO query;
    EXIT WHEN p_cursor%NOTFOUND;
    counter:=1;
    open p_du FOR
         select party_id,party_code,seq_no,party_name from ot_txn_party where ref_no=query;
         LOOP
         FETCH p_du INTO PARTY_ID,PARTY_CODE,PARTY_SEQ,PARTY_NAME;
         EXIT WHEN p_du%NOTFOUND;
         txn_parties(counter):=PARTY_ID || '&&&' || PARTY_CODE || '&&&'||PARTY_SEQ || '&&&' || PARTY_NAME;
              counter:=counter+1;
         END LOOP;
         CLOSE p_du;
    total_result(global_counter):=txn_parties;
    global_counter:=global_counter+1;
    END LOOP;
    CLOSE p_cursor;
    --open gana FOR SELECT * FROM table(cast(total_result as PARTIES_RESULT)) ;
    end;
    The error comes at line one, PLS-00905- object PARTIES_RESULT is invalid.
    i have used the create type thing to create this type.
    if i remove the out parameter it works, no compilation error.
    Questions i) How to return the associative array as out parameter?
    ii)Am i doing aynthing qrong here?
    iii) Can i open a ref cursor to this associative array and then return that ref_cursor?
    Please anyone reply back, Thanks in advance
    Message was edited by:
    user649602

    As an example:
    SQL> create type PARTIES is table of varchar2(2000);
      2  /
    Type created.
    SQL> create or replace procedure proc1(p_deptno number,gana out parties) as
      2  begin
      3   select ename
      4   bulk collect into gana
      5   from emp
      6   where deptno = p_deptno;
      7  end;
      8  /
    Procedure created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • SELECT Command on Associative Array

    Guys,
    I have a question on associative arrays in ORACLE.
    I m working on one assignment where I am not allowed to create any object into the database e.g. Create temporary tables, use of cursors etc.
    For data manipulation i used associative array, but at the end i want to show that result in pl/SQL developer.
    I know that I can't use select command on associative arrays.
    Any alternative/solution for it?
    Also is there any way that i can write the contents of associative array to a .csv file?

    user13478417 wrote:
    I m working on one assignment where I am not allowed to create any object into the database e.g. Create temporary tables, use of cursors etc.Then cease to use Oracle - immediately. As you are violating your assignment constraints.
    ALL SQL and anonymous PL/SQL code blocks you send to Oracle are parsed as cursors. And as you are not allowed to use cursors, it will be impossible to use Oracle as cursors is exactly what Oracle creates... and creates a lot of. For every single SQL statement. And every single anonymous PL./SQL block.
    For data manipulation i used associative array, Why? Arrays is a poor choice in Oracle as a data structure most times as it is inferior in almost every single way to using a SQL table structure instead.
    Pumping data into an array? That already severely limits scalability as the array requires expensive dedicated server (PGA) memory. It does not use the more scalable shared server (SGA) memory.
    Manipulating data in an array? That requires a "+full structure scan+" each time as it does not have the indexing and partitioning features of a SQL table.
    Running a SQL select on an array? That is using a cursor. That also means copying the entire array structure, as bind variable, from the PL/SQL engine to the SQL engine. An excellent way to waste memory resources and slow down performance... but hey you can still shout "+Look Ma, no --brains-- hands, I'm not using any SQL tables as dictated by my assignment!+".... +<sigh>+
    Any alternative/solution for it?You mean besides using Oracle correctly ?
    You could reload the shotgun and shoot yourself in the other foot too. That should distract you for from the pain in the first foot.

  • Associated Arrays...How are they managed?

    Hi I have a question about how the associated arrays are managed by oracle. Does Oracle keep the data in memory and start paging it to disk once they reach a certain size or does it keep certain amount in memory and use some temporary table to which it insert and retrieve data as and when needed.
    This is important to me as I feel that I may end up putting a lot of data in the associated arrays and I know for certain that paging is really slow.
    Thanks for your insight..
    Regards,
    Sumit

    Associative Array are important for what they represent, not for how their memory is managed. Associative Arrays are equivalent to Java/C# Hash tables/collections. Previously, Oracle only allowed collections/arrays to be indexed by standard datatypes like binary_integer.
    Jason

  • Bulk collect into associative array

    Please advise examples of a bulkk collecting a cursor into associative array amd working on the basis of one column as key.
    Here need to calculate based onnfollowing data and key as Col1 until all records for that key are worked upon.
    Col1 col2 col3 Flag
    AA A11 A13 1
    AA A12 A13 1
    BB B11 B11 1
    BB B11 B11 2
    CC C11 C11 1

    ?:|
    You might want to rephrase your question...
    http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
    Examples:
    http://www.java2s.com/Code/Oracle/PL-SQL/Howtodoabulkcollectintoanassociativearray.htm
    http://www.oracle-developer.net/display.php?id=201
    http://www.oracle.com/pls/db102/search?word=bulk+collect
    http://www.oracle.com/pls/db102/search?word=associative+array

  • Associative array related problem

    Hi All,
    When I am trying to use assotiative array in a select statement I recieve the following error:
    ORA-06550: line 9, column 22:
    PLS-00201: identifier 'COL1' must be declared
    ORA-06550: line 9, column 22:
    PLS-00201: identifier 'COL1' must be declared
    ORA-06550: line 9, column 10:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 9, column 3:
    PL/SQL: SQL Statement ignored
    Here is the example
    --create table MyTable (col1 varchar2(255), col2 varchar2(255))
    declare
      type m_ttMyTable
        is table of MyTable%rowtype index by MyTable.col1%type;
      m_tMyTable                   m_ttMyTable;
      m_sCol2 varchar2(255);
    begin
      select m_tMyTable (col1).col2  /* works with ocntant: select m_tMyTable */('col1').col2
        into m_sCol2
      from MyTable
      where rownum = 1;
    end;
    --drop table MyTableAny ideas how to workaround this?
    Thanks

    The only collection types SQL can query are ones defined in SQL using CREATE TYPE. That excludes associative arrays, as they are PL/SQL-only constructs. I'd recommend a nested table collection.
    Some more suggestions:
    www.williamrobertson.net/documents/collection-types.html

  • Associative Array our only option?

    Hello,
    I'm having a problem accepting associative arrays as the only option I have for getting data from a stored procedure. I have a good reason for not wanting to use ref cursors as I am using the stored procedure to manipulate data which I in turn would like to pass back to VB through the stored procedure and would rather not have to insert he data into a table just to re-select it for a ref cursor.
    My main concern is that with associative arrays I am expected to define the number of return results before I even generate the data. Also from what I can see I am required to set the data length for each and every item in said array one at a time. All this overhead seems like more work than what I would have to do to utilizer a reference cursor. Is there a right way to do this? I would really like to do the most straight forward way I can without the extra processing.

    Hi,
    Here's a blog post of mine that illustrates using pipelined functions and PL/SQL to return results:
    http://oradim.blogspot.com/2007/10/odpnet-tip-using-pipelined-functions.html
    Not sure if that will be helpful in your case, but perhaps it might be a place to start anyway.
    - Mark

  • Associative Array error

    I am using a couple associative arrays in my code and comparing the data in one, and if it is an asterisk, I change it to use the data in the other. Here is the meat of my code. I am running into an error at the bolded line saying I have too many values, which I don't understand because the code is the exact same as the block of code right before it where I populate the first array. FYI, the table it is pulling from only has one row. The error is listed below the code.
    Code
    DECLARE
    TYPE refresh_file_t IS TABLE OF test.loading_dock%ROWTYPE ;
    refresh_data refresh_file_t ;
    prospect_data refresh_file_t ;
    TYPE CV_TYPE IS REF CURSOR ;
    c_id CV_TYPE ;
    v_id NUMBER(10) ;
    v_phone VARCHAR2(10) ;
    v_project VARCHAR2(10) ;
    BEGIN
    OPEN c_id FOR
    'SELECT id
    FROM test.loading_dock
    WHERE rownum = 1' ;
    LOOP
    FETCH c_id INTO v_id ;
    EXIT WHEN c_id%NOTFOUND ;
    SELECT * BULK COLLECT
    INTO refresh_data
    FROM test.loading_dock
    WHERE id = v_id ;
    SELECT * BULK COLLECT
    INTO prospect_data
    FROM test.prospects
    WHERE id_number = v_id ;
    IF refresh_data(1).home_phone = '*' THEN
    v_phone := prospect_data(1).phone ;
    ELSE
    v_phone := refresh_data(1).home_phone ;
    END IF ;
    DBMS_OUTPUT.PUT_LINE(v_phone) ;
    END LOOP ;
    CLOSE c_id ;
    END ;
    Error
    ORA-06550: line 29, column 13:
    PL/SQL: ORA-00913: too many values
    ORA-06550: line 27, column 13:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 34, column 46:
    PLS-00302: component 'PHONE' must be declared
    ORA-06550: line 34, column 13:
    PL/SQL: Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"

    Collection prospect_data is of type refresh_file_t, which is a table of records of test.loading_dock%TYPE. Most likely tables test.loading_dock and test.prospects have different structure - test.prospects has fewer columns. So when you try to fetch from test.prospects into prospect_data you get the error Try replacing
    prospect_data refresh_file_t ;with
    TYPE prospect_data_t IS TABLE OF test.prospects%ROWTYPE ;
    prospect_data prospect_data_t ;SY.

  • Associative Array (Object) problems

    Here is the function i'm dealing with
    i'm reading in a delimited string and using indexed arrays to
    break them up and assign the keys and values to an associative
    array in a loop.
    i'm using variables in the loop and the array loads as
    expected in the loop
    but outside the loop, the only key is the variable name and
    the value is undefined
    this is true using dot or array notation, as well as literal
    strings for the keys
    any help is appreciated
    watchSuspendData = function (id, oldval, newval):String {
    //the incoming suspendData string is delimited by the
    semicolon;
    //newval is: firstValue=Yes;captivateKey=1
    var listSuspendData:Array = newval.split(";"); // convert it
    to a list of key/value pairs
    if (listSuspendData.length > 0){
    //line 123: listSuspendData.length is: 2
    for (i=0; i < listSuspendData.length; i++){ //for each
    key/value pair
    var keyValArray:Array = new Array();
    var myNameValue:String = listSuspendData
    //line 127: listSuspendData is: firstValue=Yes
    keyValArray = myNameValue.split("="); // split 'em on the
    equal sign
    var myKey:String = keyValArray[0];
    var myVal:String = keyValArray[1];
    //keyValArray[0] is: firstValue
    //keyValArray[1] is: Yes
    // store the key and the value in associative array
    suspendDataArray.myKey = myVal;
    trace("line 134: suspendDataArray is: " +
    suspendDataArray.myKey);
    // trace is line 134: suspendDataArray is: Yes on the first
    pass and 1 on the second
    //the below loop always returns one array key: myKey and the
    value as undefined
    for(x in suspendDataArray){
    trace("x is: " + x); //x is: myKey
    trace("the val is: " + suspendDataArray.x); //the val is:
    undefined
    } //end for
    return newval;

    on lines 12-13 i assign the key=value pair to string
    variables
    then on lines 17-18 i assign those values to the associative
    array using dot notation
    the trace seems to work there
    the problem is that when the procedure exits the for loop,
    the associative array only has one key (myKey) and no value
    (undefined)
    all the documentation i've read shows using these types of
    arrays with either non-quoted property names like:
    myAssocArray.myKey = "somevalue";
    or
    myAssocArray[myKey] = "somevalue";
    i tried assigning the key/value pairs directly from the
    indexed arrays, but the result was always undefined
    like this:
    suspendDataArray.keyValArray[0] = keyValArray[1]
    or
    suspendDataArray[keyValArray[0]] = keyValArray[1]
    i even tried building a string in the loop and trying to
    assign all the pairs at once using the curly brace
    this is pretty wierd behavior for actionscript or i'm missing
    something basic here
    thanks for looking

  • Associative Array vs Table Scan

    Still new to PL/SQL, but very keen to learn. I wondered if somebody could advise me whether I should use a collection (such as an associative array) instead of repeating a table scan within a loop for the example below. I need to read from an input table of experiment data and if the EXPERIMENT_ID does not already exist in my EXPERIMENTS table, then add it. Here is the code I have so far. My instinct is that it my code is inefficient. Would it be more efficient to scan the EXPERIMENTS table only once and store the list of IDs in a collection, then scan the collection within the loop?
    -- Create any new Experiment IDs if needed
    open CurExperiments;
    loop
    -- Fetch the explicit cursor
    fetch CurExperiments
    into vExpId, dExpDate;
    exit when CurExperiments%notfound;
    -- Check to see if already exists
    select count(id)
    into iCheckExpExists
    from experiments
    where id = vExpId;
    if iCheckExpExists = 0 then
    -- Experiment ID is not already in table so add a row
    insert into experiments
    (id, experiment_date)
    values(vExpId, dExpDate);
    end if;
    end loop;

    Except that rownum is assigned after the result set
    is computed, so the whole table will have to be
    scanned.really?
    SQL> explain plan for select * from i;
    Explained.
    SQL> select * from table( dbms_xplan.display );
    PLAN_TABLE_OUTPUT
    Plan hash value: 1766854993
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |   910K|  4443K|   630   (3)| 00:00:08 |
    |   1 |  TABLE ACCESS FULL| I    |   910K|  4443K|   630   (3)| 00:00:08 |
    8 rows selected.
    SQL> explain plan for select * from i where rownum=1;
    Explained.
    SQL> select * from table( dbms_xplan.display );
    PLAN_TABLE_OUTPUT
    Plan hash value: 2766403234
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |     5 |     2   (0)| 00:00:01 |
    |*  1 |  COUNT STOPKEY     |      |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| I    |     1 |     5 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter(ROWNUM=1)
    14 rows selected.

  • Associative array type for each blob column in the table

    i am using the code in given link
    http://www.oracle.com/technology/oramag/oracle/07-jan/o17odp.html
    i chnages that code like this
    CREATE TABLE JOBS
    JOB_ID VARCHAR2(10 BYTE),
    JOB_TITLE VARCHAR2(35 BYTE),
    MIN_SALARY NUMBER(6),
    MAX_SALARY NUMBER(6),
    JOBPIC BLOB
    CREATE OR REPLACE PACKAGE associative_array
    AS
    -- define an associative array type for each column in the jobs table
    TYPE t_job_id IS TABLE OF jobs.job_id%TYPE
    INDEX BY PLS_INTEGER;
    TYPE t_job_title IS TABLE OF jobs.job_title%TYPE
    INDEX BY PLS_INTEGER;
    TYPE t_min_salary IS TABLE OF jobs.min_salary%TYPE
    INDEX BY PLS_INTEGER;
    TYPE t_max_salary IS TABLE OF jobs.max_salary%TYPE
    INDEX BY PLS_INTEGER;
    TYPE t_jobpic IS TABLE OF jobs.jobpic%TYPE
    INDEX BY PLS_INTEGER;
    -- define the procedure that will perform the array insert
    PROCEDURE array_insert (
    p_job_id IN t_job_id,
    p_job_title IN t_job_title,
    p_min_salary IN t_min_salary,
    p_max_salary IN t_max_salary,
    p_jobpic IN t_jobpic
    END associative_array;
    CREATE OR REPLACE package body SHC_OLD.associative_array as
    -- implement the procedure that will perform the array insert
    procedure array_insert (p_job_id in t_job_id,
    p_job_title in t_job_title,
    p_min_salary in t_min_salary,
    p_max_salary in t_max_salary,
    P_JOBPIC IN T_JOBPIC
    ) is
    begin
    forall i in p_job_id.first..p_job_id.last
    insert into jobs (job_id,
    job_title,
    min_salary,
    max_salary,
    JOBPIC
    values (p_job_id(i),
    p_job_title(i),
    p_min_salary(i),
    p_max_salary(i),
    P_JOBPIC(i)
    end array_insert;
    end associative_array;
    this procedure is called from .net. from .net sending blob is posiible or not.if yes how

    Ok, that won't work...you need to generate an image tag and provide the contents of the blob column as the src for the image tag.
    If you look at my blog entry -
    http://jes.blogs.shellprompt.net/2007/05/18/apex-delivering-pages-in-3-seconds-or-less/
    and download that Whitepaper that I talk about you will find an example of how to do what you want to do. Note the majority of that whitepaper is discussing other (quite advanced) topics, but there is a small part of it that shows how to display an image stored as a blob in a table.

  • Associative Array and Blob

    I’m currently working on a system that allows the users to upload an Excel spreadsheet (.xls) in the system. The upload page is a PL/SQL cartridge. Then I’ve written a Java servlet (using Oracle Clean Content) to convert the XLS into a CSV and store it back in the database. (it is stored in the “uploaded_files” table as a blob). I’m trying to create another procedure to read the contents of the blob and display a preview of the data on the screen (using an html table (will be done using cartridge)). After the preview, the user can choose to submit the data into the database into the “detail_records” table or simply discard everything.
    I've been trying to use an associative array to grab all the data from the blob but I’m getting confused about how to implement it in my situation.
    Can someone provide any examples of this nature?
    Any help is greatly appreciated.

    I decided to create a "record" type with all the columns from my excel spreadsheet. Then I will create a table type of records
    I am doing something like this:
    declare
    type s_record is record
                            (l_name varchar2(100),
                             f_code varchar2(4) ,
                             l_code varchar2(6),
                             d_date varchar2(5),
                             d_type varchar2(5),
                             price number,
                             volume number,
                             tax number,
                             amount_paid number
    type s_data_tab is table of s_record index by binary_integer;
    v_s_data s_data_tab;
    v_indx binary_integer :=0;
    begin
    end; I am getting confused about parsing an entire row of values separated by commas into a row in the temporary table created above.
    I know I need a loop, but from what I understand, the way to populate data needs to be something like this, for example:
    for v_indx in 0..data_size loop
       v_s_data(v_indx).l_name:= 'Company A';
       v_s_data(v_indx).f_code := '2700';
    end loop; But I'm not sure how this approach should be used to parse an entire row at once.
    Any help appreciated.

  • Associative  array binding - poor performance

    Dear All
    i have very very low performence when i am inserting a binary array using associative array bind. i mean when i insert huge jagged binary array.
    the jagged array has
    BinarryArray[0][0]........BinarryArray[0][8000]
    BinarryArray[1][0]........BinarryArray[1][8000]
    BinarryArray[3600][0]........BinarryArray[3600][8000]
    BinarryArray[0] - i have 8000 byte end so on. total is 3600 X 8000
    that means 28,800KB hence to ~28MB.
    the C# code is as follows
    string strInsert "Insert Into T Values(t.SEQUENCE.currval, :paramArr);
    OracleCommand objCommand = new OracleCommand;
    OracleParameter objParam = new OracleParameter(paramArr, OracleDbtype.blob, 8000, system.data.ParameterDirection.Input,true,0,0,"ColumnName", system.data.DataRowVersion.Curren, BinarryArray);
    objCommandtext = strInsert;
    objCommand.ArrayBindCount = BinarryArray.Length;
    objCommand.Parameters.Clear();
    objCommand.Parameters.Add(paramArr);
    objCommand.ExecuteNonQuery();
    In generall the Insertion is good for each row in the array i get separate row in the DB but it works so slow.
    why??????
    see the code below

    well??

Maybe you are looking for

  • Issues in WSDL Import

    Hi all, I'm trying to import a WSDL file into XI and I get this error Unable to convert imported document to WSDL Reason: Tag definitions cannot have an attribute version from namespace urn:ebay:api:PayPalAPI Check the selected category Kindly provid

  • Creative Cloud desktop app unresponsive and extension manager not downloading

    I uninstalled Acrobat pro from my computer so I could install the newer version and now my creative cloud app is stuck on spinning circle when I try to go to the applications. I can't uninstall the craetive cloud desk app to reinstall it as it says t

  • Dynamic calc member formula problem

    Hello Gurús! We are using a member called "Full Year" that is a Dynamic calc with a member formula that calls another dynamic calc. For any reason, it is not working when we try to retrieve it from Excel Add-in. Any ideas? Any problem for put a Dynam

  • Incredible SMS update from Customer Services - Sum...

    To cut a long story short ... 10th July, two weeks after the promised install date which was given to me back in May and I'm still waiting for the line to be activated.  Having had several ridiculous conversations with first and second-line 'support'

  • Does Business Objects XI still support RDC for Crystal Reports?

    Post Author: DLO34 CA Forum: Integrated Solutions My company develops an application which uses Crystal Reports to present data to the user. We have been using the RDC API through our internal C code for a while now. From the documentation I have fou