Varray in pl\sql

Hi All,
iam using the following varray in pl\sql
CREATE OR REPLACE TYPE EMPARRAY is VARRAY(20) OF VARCHAR2(30)
CREATE OR REPLACE procedure getEmpArray1 (emp out EMPARRAY)
AS
l_data EmpArray := EmpArray();
CURSOR c_emp IS SELECT ename FROM EMP;
BEGIN
FOR emp_rec IN c_emp LOOP
l_data.extend;
l_data(l_data.count) := emp_rec.ename;
END LOOP;
END;
it is created successfully,can anyone tell how to view the data in emp out EMPARRAY from the procedure
thanks in advance
Farza

FOR i IN l_data.FIRST .. l_data.LAST LOOP
dbms_output.put_line('l_data('||i||'): '||l_data(i)) ;
END LOOP;

Similar Messages

  • Help with VARRAY in PL/SQL

    I wrote the below Stored Procedure in a package. I am not able to execute this, can anyone please help
    Package Definition:
    CREATE OR REPLACE PACKAGE "CDS_SUBLIMIT_TYPE_PKG" as
    TYPE COLLATERAL_ARRAY is VARRAY(100) OF NUMBER(29);
    procedure get_original_balance_array_p(in_collateral_id IN NUMBER, l_data OUT COLLATERAL_ARRAY );
    end CDS_SUBLIMIT_TYPE_PKG;
    Package Body:
    CREATE OR REPLACE PACKAGE BODY "CDS_SUBLIMIT_TYPE_PKG" as
    procedure get_original_balance_array_p
    (in_collateral_id IN NUMBER, l_data OUT COLLATERAL_ARRAY ) IS
    CURSOR c_collateral IS
    SELECT collateral_id FROM collateral where rownum < 10;
    BEGIN
    l_data:=COLLATERAL_ARRAY();
    FOR collateral_rec IN c_collateral LOOP
    l_data.extend;
    l_data(l_data.count):=collateral_rec.collateral_id;
    END LOOP;
    l_data.extend;
    l_data(l_data.count):=in_collateral_id;
    END get_original_balance_array_p;
    end CDS_SUBLIMIT_TYPE_PKG;
    Execution:
    declare
    collateral_id number;
    collectionId collateral_array;
    begin
    collateral_id:=55;
    CDS_SUBLIMIT_TYPE_PKG.get_original_balance_array_p(collateral_id, collectionId);
    end;

    collectionId collateral_array;You missed out the package name - it should be
    collectionId cds_sublimit_type_pkg.collateral_array;VARRAYs are good as multivalue columns in database tables, if you're into that (I'm not particularly). In PL/SQL code, nested tables have more functionality, especially in 10g.
    www.williamrobertson.net/documents/collection-types.html

  • Loading VARRAY's with SQL loader, direct path in 9i?

    Isn't it possible to load VARRAY's with SQLloader and direct path in a Oracle 9i database?
    /Magnus Hornstrom
    mailto:[email protected]

    Daniel,
    I appreciate your response alot.
    Now a follow on. You say that SQL*Loader is the fastest way to get data into Oracle Spatial even though the conventional path. How does SQL*Loader do this? Doesn't it use OCI?
    I just can't help but think that coverting my data to SQL*Loader format, and then having it parse it and send it to the database in some form must be slower than me just sending whatever SQL Loader sends to the DB myself using OCI. Am I missing something?
    The SQL Loader documentation seems to suggest that SQL*Loader just turns the input into alot of INSERT stateemnts. If so, can't I just do this?
    My performance with OCI and INSERT statements isn't very good, but I believe I am doing one transaction per insert. Might I be as well off to concentrate on fine tuning my OCI based code using INSERTs?
    I will actually do some time tests myself, but I would appreciate your opinion.
    Once again thanks for the great info you have provided.

  • Generating XML using Varray or Pl/SQL table

    I am trying to convert an old plsql procedure to generate XML data. The program is getting all the data to report from various sources to a pl/sql table.
    Is there any way to directly convert data into xml from plsql table ??
    Here is the plsql table defination
    TYPE Emp_rec IS RECORD ( Batch_name VARCHAR2(240)
    ,Employee_name VARCHAR2(240)
    ,Employee_number VARCHAR2(240)
    ,Element_name VARCHAR2(240)
    ,Bee_value NUMBER
    ,Ele_scr_value NUMBER
    TYPE emp_data IS TABLE OF Emp_rec
    INDEX BY BINARY_INTEGER;
    E emp_data;
    And i am trying to get xml using following code:
    FOR i IN E.FIRST.. E.LAST
    LOOP
    SELECT
    XMLConcat (
    XMLELEMENT(
    "batch",
    XMLFOREST(
    E(i).Batch_name AS "Batch_name",
    E(i).Employee_number AS "Employee_number",
    E(i).Element_name AS "Element_name"
    INTO l_xml
    FROM dual;
    end loop;
    I am not sure whether this can actually be done or not. I have option to write the xml file manually to output ; but just wondering whether this method of getting xml is correct or not ? If yes, then how can we use plsql table data and merge it into a single XML file
    Please let me know your views and opinions.
    Thanks
    Ankur

    I am trying to convert an old plsql procedure to generate XML data. The program is getting all the data to report from various sources to a pl/sql table.
    Is there any way to directly convert data into xml from plsql table ??
    Here is the plsql table defination
    TYPE Emp_rec IS RECORD ( Batch_name VARCHAR2(240)
    ,Employee_name VARCHAR2(240)
    ,Employee_number VARCHAR2(240)
    ,Element_name VARCHAR2(240)
    ,Bee_value NUMBER
    ,Ele_scr_value NUMBER
    TYPE emp_data IS TABLE OF Emp_rec
    INDEX BY BINARY_INTEGER;
    E emp_data;
    And i am trying to get xml using following code:
    FOR i IN E.FIRST.. E.LAST
    LOOP
    SELECT
    XMLConcat (
    XMLELEMENT(
    "batch",
    XMLFOREST(
    E(i).Batch_name AS "Batch_name",
    E(i).Employee_number AS "Employee_number",
    E(i).Element_name AS "Element_name"
    INTO l_xml
    FROM dual;
    end loop;
    I am not sure whether this can actually be done or not. I have option to write the xml file manually to output ; but just wondering whether this method of getting xml is correct or not ? If yes, then how can we use plsql table data and merge it into a single XML file
    Please let me know your views and opinions.
    Thanks
    Ankur

  • VARRAY AND OBJECT OUTPUT(PL/SQL)

    Hi Friends,
    My Table is---
    SQL> DESC STUDENT_MARKS1
    Name                                                  Null?    Type
    ROLL_NO                                                        NUMBER
    NAME                                                           VARCHAR2(20)
    SUBJECT_MARKS                                                  V_ARR_MARKS1
    and My VARRAY V_ARR_MARKS1 is--
    SQL> DESC V_ARR_MARKS1
    V_ARR_MARKS1 VARRAY(3) OF OBJ_MARKS
    Name                                                  Null?    Type
    SUBJECT                                                        VARCHAR2(20)
    MARKS                                                          NUMBER(3)
    GRADE                                                          VARCHAR2(1)
    I want to display the table data on sql*plus is like ---
    1     KARTIK     PHY       90     A
               MATHS     98     A
                     CHM       78     B
    2     ASHISH     PHY       89     B
               MATHS     76     B
                     CHM       89     B
    3     CHANDAN    PHY       67     B
               MATHS     56     C
               CHM       56     C
    -------------------------------------------but it is displaying like that------
    1     KARTIK     PHY     90     A
    MATHS     98     A
    CHM     78     B
    2     ASHISH     PHY     89     B
    MATHS     76     B
    CHM     89     B
    3     CHANDAN     PHY     67     B
    MATHS     56     C
    CHM     56     C
    ------------------------------------------- could some one help me out ?
    Message was edited by:
    KarTiK
    Message was edited by:
    KarTiK
    Message was edited by:
    KarTiK

    I m not using two tables.
    My one and only table is --- STUDENT_MARKS1
    and the STUDENT_MARKS1.SUBJECT_MARKS is VARRAY type.
    and My VARRAY V_ARR_MARKS1 is Object type.
    and My Object OBJ_MARKS has three fields---
    1.SUBJECT
    2.MARKS
    3.GRADE
    Thanks.
    KarTiK.

  • Skipping fields in SQL*LOADER data file

    I have a data file that has more fields than the target table does. How can I write a SQL*LOADER control file to skip some fields in the middle of the text line?
    null

    If you don't want to define input fields by position, the simplest way I think is to use FILLER fields.
    Quoted from SQL*Loader doc:
    "Specifying Filler Fields
    Filler fields have names but they are not loaded into the table. However, filler fields can be used as arguments to init_specs (for example, NULLIF and DEFAULTIF) as well as to directives (for example, SID, OID, REF, BFILE). Also, filler fields can occur anyplace in the data file. They can be inside of the field list for an object or inside the definition of a VARRAY.
    See SQL*Loader DDL Behavior and Restrictions for more information on filler fields and their use.
    A sample filler field specification looks as follows:
    field_1_count FILLER char,
    Ex:
    Regards,
    Zoltan

  • Oracle 8: VARRAY-problem

    Hi!
    I'm not able to work this out, using a VARRAY in a sql-query:
    Her are my structures:
    CREATE OR REPLACE TYPE tlfliste_vartype AS VARRAY(10) OF VARCHAR2(20);
    CREATE OR REPLACE TYPE ansatt_objtype AS OBJECT (
    ans_nr NUMBER,
    ans_navn VARCHAR2(30),
    tlf_nr_var tlfliste_vartype);
    CREATE TABLE ansatt_objtab OF ansatt_objtype;
    INSERT INTO ansatt_objtab VALUES(1,'HANSEN',tlfliste_vartype('415-555-1212'));
    INSERT INTO ansatt_objtab VALUES(2,'OLSEN',tlfliste_vartype('609-555-1212','201-555-1212'));
    I've tried this query:
    SELECT a.ans_nr, a.ans_navn, t.tlf_nr_var
    FROM ansatt_objtab a, table(a.tlf_nr_var) t;
    but it doesn't work. I want to list out "ans_nr", "ans_navn" and the belonging telephonenumbers. How do I do it?
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Uthaya:
    Hi,
    You are right. u need to edit the ORADIM command. The other way is...
    1) Go to control panel
    2) Go to services
    3) Go to your database service(For example if u r db is DEV your service looks like OracleServiceDEV)
    4) go to the properties of it(click starup button).
    5) make the startup mode as automatic.
    This will start your database when ever u start NT.
    Let me know if u still have the problem
    Uthaya<HR></BLOCKQUOTE>
    From: Muhammad Munir
    Dear Uthaya,
    I did all that but I have Still Problem. I am MCSE and I know NT well. This is I think Oracle Problem not NT problem.I want to explain that I change the password of INTERNAL and then restart the Computer.
    I have to startup the oracle from the SVRMGR> consoal. And i again change the INTERNAL password that it was by default and I restart the system now the Database is Open and running. So I think the problem is of ORACLE not the NT services.
    Please Help Me.
    null

  • Question regarding cursor variables, while using table functions

    Hi,
    I created a procedure and when i'm try'g to call it. now i'm getting this error.
    CREATE OR REPLACE TYPE TAB_EMP_REC IS OBJECT(
    EMP_ID NUMBER(9),
    EMP_NAME VARCHAR2(30));
    CREATE OR REPLACE TYPE T_EMP_TMP IS TABLE OF TAB_EMP_REC ;
    CREATE OR REPLACE PROCEDURE USP_CREATE_DATA(
    p_Input IN NUMBER,
    V_EMP_CUR OUT sys_refcursor) IS
    T_EMp T_EMP_TMP := T_EMP_TMP( );
    BEGIN
    t_emp.extend();
    t_emp(1) := TAB_EMP_REC(p_input, 'jack');
    OPEN V_EMP_CUR FOR SELECT * from TABLE(t_emp);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR '||SQLERRM);
    END USP_CREATE_DATA;
    calling procedure::
    DECLARE
    type O_RESULT_CUR is ref cursor return TAB_EMP_REC;
    V_EMP_REC TAB_EMP_REC;
    BEGIN
    USP_CREATE_DATA(99, O_RESULT_CUR);
    LOOP
    FETCH O_RESULT_CUR INTO V_EMP_REC;
    EXIT WHEN O_RESULT_CUR%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(V_EMP_REC.EMP_ID);
    END LOOP;
    CLOSE O_RESULT_CUR;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR '||SQLERRM);
    END;
    Now i'm getting an error PLS-00362: invalid cursor return type; 'TAB_EMP_REC' must be a record type.
    My question is i already declared it as a database object. What do i need to do ?
    thank you

    but t_emp(1) := TAB_EMP_REC(p_input, 'jai');
    is correct, since.. i'm passing a record into t_emp(1)(this is the first column in this table)No it is not, since TAB_EMP_REC is just an object, when used as a collection, it can be a VARRAY, a PL/SQL table(associative array), nested table etc. As mentioned in my earlier post, if you want to use a collection of the same structure (with subscript n, as you have done here), then you need to declare a collection of type TAB_EMP_REC.In this case you have already declared a table of type TAB_EMP_REC - +CREATE OR REPLACE TYPE T_EMP_TMP IS TABLE Also, t_emp is of type T_EMP_TMP - T_EMp T_EMP_TMP := T_EMP_TMP( );*
    As for the error you are getting, try changing to -
    t_emp := T_EMP_TMP(TAB_EMP_REC(p_input, 'jai'));*
    Note : Not Tested.

  • Arrays in oracle

    There are some query's to be executed by java code that return more than one rows, but i want this query to be executed by a stored procedure. I am looking for a solution which will return this multiple rows using a parameter in a procedure/Package.
    e.g I have emp table that has 10 records, I create a proedure emp_data which will have select * from emp, I want this procedure to return 10 rows.

    > there is VARRAY in Oracle - is it different than the array?
    A VARRAY is a fixed size (static) array in the SQL Engine. When defining and using arrays in PL/SQL Engine,
    these are dynamic (can be extended) arrays (aka PL/SQL "tables").
    There are also other differences. The SQL Engine "knows" the VARRAY SQL type and can use it - it has access
    to the array's type definition.
    The SQL Engine cannot however (directly) use a PL/SQL array - as the type has been defined in the
    PL/SQL (and can include non-SQL data types like BOOLEAN). This requires PL/SQL arrays to be casted to
    a structure that the SQL Engine can understand (and array data copied from the PL/SQL Engine to
    the SQL Engine). Only then can the SQL Engine use a PL/SQL array.
    Personally, I do not like using VARRAYs as that does not fit with my views of a relational design. It is
    IMO dealing with a bad case of 2nd normal form when using VARRAYs in a SQL table.
    Nested tables in a SQL table however can be justified in my view - especially when the child rows of one
    parent row have absolutely nothing in common with the child rows from another parent row.
    The question as to HOW to use these arrays depend on the requirements - and then selecting the best tool
    for the job. Arrays have the same basic data structure, and serve the same basic purpose, irrespective
    of the programming language.

  • XDB Native Web Services - Collection of object types

    Hello,
    my DB 11g (11.1.0.6.0) is enabled to use XDB Native Web Services, everything works as it should. I already use it successfully to publish a web service with object types as OUT parameter. They are created as complex types in the XML response as described here: [http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_web_services.htm#CHDGBFID]
    But what I need is a collection of these object types, e.g.
    I have a type FLIGHT with some information elements (departure, arrival, date, time, price) and I have a web service function GET_AVAILABILITY with parameters departure, arrival and date. What I want is to return a collection of FLIGHT objects, it could be none, one or many flights for a request.
    For the moment I create another object type which contains a fix number of FLIGHT objects to work around the collection issue:
    create flight_tab_typ as object (
    fl1 flight_typ
    ,fl2 flight_typ
    ,fl3 flight_typ
    I tried to build a PL/SQL table of object type and also a VARRAY of object type but for both the WSDL of the web service cannot be build up correctly in the web browser. For me it seems that this is not supported by the Native Web Services.
    I know I can build up my own XMLTYPE with XML structure as OUT parameter but to use object types is much easier and it builds up the XML structure automatically.
    Does anybody know how to use collections (VARRAY or PL/SQL Tables) with the Native XML DB Web Services?
    Thanks,
    Andreas

    Hi flea,
    I use complex types with XDB native webservices. Here is an example. Using people/groups objects. I haven't compiled this so there may be some typos etc, but it should give you the idea.
    Beware!I have had problems with the created WSDL file in that it doesn't always include the namespace from all types. In many client packages ( JDevloper , SOAPUI etc) this causes a wsdl import failure.
    You can add the missing namespace by hand a load the WSDL file locally and then it should work. I haven't raised an SR with Oracle about this yet.
    Assume you create the following under SCoTT schema on machine host.com on port 8080.
    The webservice[WSDL] will be available from
    http://host.com:8080/orawsv/SCOTT/WEBSERVCIES/GET_GROUP[?wsdl]
    For other peoples sanity it took me a little while to realise the WSDL url is case specific. E.g. the schema, package and functions have to be UPPER case.
    create table people_groups_tab (group_name varchar2(40 char),first_name varchar2(40 char),last_name varchar2(40 char))
    insert into people_groups_tab values ('FINANCE','Joe','Bloggs')
    insert into people_groups_tab values ('FINANCE','Bob','Jones')
    insert into people_groups_tab values ('IT','Alan','Andrews')
    create or replace type person_obj
    as object
         first_name people_groups_tab.first_name%type
         ,last_name people_groups_tab.last_name%type
    create or replace type people_obj
    as table of person_obj
    create or replace type people_groups_obj
    as object
    group_name varchar2(40 char)
    people people_obj
    create or replace package webservices
    as
              function get_group
         p_group_name varchar2
              ) return people_groups_obj;
    end;
    create or replace package body webservices
    as
              function get_group
         p_group_name varchar2
              ) return people_groups_obj
    as
    l_group people_groups_obj;
              l_people people_obj;
    begin
              select person_obj
                        first_name
                        ,last_name
              bulk collect into l_people
              from people_groups_tab
              where group_name p_group_name;
              l_group := people_groups_obj(p_group_name,l_people);
              return l_group;
    end;
    end;
    /

  • Value select from nested table

    CREATE TYPE test AS OBJECT (
    test1 varchar2(10),
    test2 varchar2(10));
    create or replace type test2 as table of test;
    two record are there within object type.then how i will select value from nested table.

    How many times are you going to ask this question before you either look at the response I have given to Re: how i will display type like (nestedtable or varrays or pl/sql table).?
    You have posted often enough to this forum to know the ettiquette by now.
    Regards, APC

  • Token a string

    Hello, I have a stored procedure which have one in parameters. This one is a string with this syntax:
    a/b/c/d
    I would like to token it in the procedure with the separater '/'.
    Thank you.

    There is no tokenizer function like Java has. However, it is relatively easy to implement this functionality using varrays and standard SQL functionality.
    DECLARE
      offset NUMBER;
      TYPE vchars IS TABLE OF VARCHAR2(20);
      tokens vchars;
      l_string VARCHAR2(32000);
      n NUMBER;
    BEGIN
      tokens := vchars();
      l_string := 'a/b/c/d';
      n := 1;
      offset := INSTR(l_string, '/');
      LOOP
         WHEN offset = 0 THEN EXIT;
         tokens.extend;
         tokens(n) := SUBSTR(l_string, 1, offset-1);
         l_string := SUBSTR(l_string, offset+1);
         n := n+1;
      END LOOP;
      tokens(n) := l_string;
    END LOOP;
    /Obviously, you'll want to make it more robust and more flexible. The best way of achieving that end is to put it in a package.
    Warning: I don't have access to a database at the moment, so the above code has not been tested.
    Cheers, APC

  • SQL*Modeler - creation of VARRAY or Collection Type of scalar type errors

    In SQl*Modeler 2.0.0 Build 584, I can create either VARRAY or Collections. These work fine for usre defined structured types but I encounter huge problems when I use a simple scalar type of number or varchar2.
    For instance I create a new collection type, give it a name, specify its a collection (or VARRAY, same problem) then click datatype. On the select Data type box I select logical type. A new window opens, I select VARCHAR from the drop down list.
    Enter the size 15, everything appears fine. I click OK, the select data type screen now shows a logical type of VARCHAR(15).
    So far I'm happy. I generate the DDL, everthing is fine, the DDL contains my collection of VARCHAR2(15).
    Now I save the model, close it and re-open the same model. My collection is now of VARCHAR so the next time I generate it will get an error because the syntax is wrong because it has no length. Same problem happens when selecting a NUMBER, looses the precision and scale but at least that command still works, just with a maximum numeric value.
    Ok, so lets try creating distinct types. Why we can't access domains when specifying types from here remains a mystery to me.
    So I create a distinct type Varchar2_15 which is of Logical type VARCHAR and give it a size. Similarly, create another distinct type of NUMERIC_22_0 precision 22 scale 0. This seems to get around the problem of losing the data but the DDL generated shows the datatype to be either VARCHAR (not VARCHAR2) and NUMERIC(22), not number(22). Now I know that VARCHAR currently maps to VARCHAR2 but isn't guaranteed to in the future (even though its been like that since V6) and NUMERIC is just an alias for NUMBER but its going to confuse a lot of java people and its totally inconsitent and just plain wrong.
    Any suggestions or workarounds will be gratefully received.
    Ian Bainbridge

    Hi Ian,
    I see a bug in save/load of collection types and as result no size or precision and scale information. It's fixed in new release.
    However I cannot reproduce the problem with distinct types - I have them generated as varchar2 and number (this is for Oracle).
    You can check:
    - database you use in DDL generation - I got varchar and numeric for MS SQL Server;
    - mapping of logical types VARCHAR and NUMERIC to native types in "Types Administration".
    Philip
    PS - I was able to reproduce it - I looked at wrong place - DDL generation for collection types is broken - it's ok for columns. I logged bug for that.
    Edited by: Philip Stoyanov on Jun 28, 2010 8:55 PM

  • SQL*Loader halt loading large varray object

    I was using sql*loader of Oracle 8i NT, trying to load some records with
    varray (some records have lots of array elements, up to several thousands).
    however, after several hundreds records loaded, sql*loader became very slow,
    and virtually stopped at some point. I watched the system resouces taken by
    sql*loader, it simply drove my NT out of physical memory (it occupied
    hundreds meg of physical mem). I set virtual memory to very large, and
    didn't help neither. My whole datafile is only 60MB, although several lines
    have 250K chars in single line/record. but such record only takes sql*loader
    one minute to load if I load it individually.
    However, if I load the records 100 after 100 in "append" mode (loading 100,
    then load next 100 with skipping previous loaded records), it works fine,
    the loader only occupied 60 meg physical mem, and released the mem when I
    started next 100 manually. This is really bizzare for that sql*loader seems
    doesn't know how to unload the memory if I chose to load the whole data file
    automatically. I tried to manipulate the ROWS and BINDSIZE options, doesn't
    help much.
    Does anyone has any idea about this strange thing? Is there any other way to
    load data into Oracle tables? I can't believe sql*loader will take several
    days to load only 60mb exteral text file.
    Thanks!
    John
    null

    There is no 'setDescription' method available with the ordimage type. You can use putMetadata if that works for you.
    Otherwise, you would have to build a custom data-type based on the ordimage type in order to store your 'description'.

  • Using sql functions (min, max, avg) on varray or table collection

    Hi,
    I would like to know if there is a way to use sql function or oracle sql function like Min,Max, Avg or percentile_cont on varray or table collection ?
    Does anyone encountered this type of problem ?
    Thanks

    Yes you can apply Min,Max, Avg... if varray or table collection type is SQL (created in the databaase) UDF, not PL/SQL declared type:
    SQL> set serveroutput on
    SQL> declare
      2      type str_tbl_type is table of varchar2(4000);
      3      str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
      4      max_val varchar2(4000);
      5  begin
      6      select max(column_value)
      7        into max_val
      8        from table(str_tbl);
      9      dbms_output.put_line('Max value is "' || max_val || '"');
    10  end;
    11  /
          from table(str_tbl);
    ERROR at line 8:
    ORA-06550: line 8, column 18:
    PLS-00642: local collection types not allowed in SQL statements
    ORA-06550: line 8, column 12:
    PL/SQL: ORA-22905: cannot access rows from a non-nested table item
    ORA-06550: line 6, column 5:
    PL/SQL: SQL Statement ignored
    SQL> create or replace type str_tbl_type is table of varchar2(4000);
      2  /
    Type created.
    SQL> declare
      2      str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
      3      max_val varchar2(4000);
      4  begin
      5      select max(column_value)
      6        into max_val
      7        from table(str_tbl);
      8      dbms_output.put_line('Max value is "' || max_val || '"');
      9  end;
    10  /
    Max value is "ZZZ"
    PL/SQL procedure successfully completed.
    SQL> SY.

Maybe you are looking for

  • PB screen goes black when TV is plugged in

    I occasionally plug my PB G4 12" into the TV using the Video Adapter. This used to work fine - the desktop would span both TV and PB screen, just as it does when I have my external monitor plugged in. But when I upgraded to Leopard this stopped worki

  • Camera Raw 5.2 not installing in PSE6 on Mac

    Hi, I've downloaded the update and opened it. It goes into an automatic install, skipping over "Destination Select". After it finished, I looked in the root Library/Application Support/Adobe/Plug-in/CS3/File Formats, and the only thing there is the o

  • Audio files and duplicates question.

    Hello Group, After almost seven years my  Macbook pro is getting full., I have been using Omnidisksweeper to help locate files that are no longer needed. I have always been confused as to where My music files are kept. If I import audio files using I

  • MobileMe iCal event invite sent to iCloud iCal not showing up

    My husband is still on MobileMe. I am on iCloud. He sent me 2 calendar event invites. I got the email but they are not showing up in my calendar for me to accept. I don't see them on my iPhone, my iPad, my desktop, or iCloud.com. This used to work fi

  • I want to upgrade from 10.6.8 to 10.9.

    Is it possible to go from OS X 10.6.8 straight to OS X 10.9.5? 10.9.5 is the only version currently available at the App Store. I believe. I would prefer to upgrade to 10.9 but if 10.9.5 is the only version of Mavericks available I will do it. I have