Declaration of WA for Table Type

Hi,
I am trying to append a structure data to a table type.
For example:
I have a Table Type called ZTABLE_TYPE of Line Type ZSTRUCTURE.
In my program, my declaration is as below:
DATA itab TYPE STANDARD TABLE OF ZTABLE_TYPE.
DATA work_area TYPE ZSTRUCTURE.
work_area-field1 = 'abc'
work_area-field2 = '123'
APPEND work_area TO itab.
However, when I try to activate, I received a syntax error: 
"WORK_AREA" cannot be converted to the line type of "ITAB".
Can I get some help on whether I have declared wrongly, or is there a more appropriate way to append data into a table type.
Thanks!

Hi,
Declare like this:
DATA itab TYPE ZTABLE_TYPE.
DATA work_area TYPE ZSTRUCTURE.
work_area-field1 = 'abc'
work_area-field2 = '123'
APPEND work_area TO itab.
This is because ZTABLE_TYPE is already a table type. So you need not mention "type table of" in your declaration part.
Thanks and Regards,
Santosh Kumar Mukka.

Similar Messages

  • How to declare variable for Table type in the ABAP Editor

    Hi!
    I have Table Type 'FIELDNAME_TAB' (Table of fieldnames). I want to pass the list of fieldnames to this Table Type in the ABAP Editor.
    Can anyone help me in this?

    You would declare the internal table like so.
    data: itab type FIELDNAME_TAB.
    data: wa like line of itab.
    wa = 'This_value'.
    append wa to itab.
    Regards.
    Rich Heilman
    Message was edited by:
            Rich Heilman

  • How do i declare a user defined table type sproc parameter as a local variable?

    I have a procedure that uses a user defined table type.
    I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable @accountList.this is the line that is having the issue: must declare the scalar variable @accountListSET @local_accountList = @accountListALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS integer_list_tbltype READONLY
    ,@startDate NVARCHAR(50)
    ,@endDate NVARCHAR(50)
    AS
    BEGIN
    DECLARE @local_accountList AS integer_list_tbltype
    DECLARE @local_startDate AS NVARCHAR(50)
    DECLARE @local_endDate AS NVARCHAR(50)
    SET @local_accountList = @accountList
    SET @local_startDate = @startDate
    SET @local_endDate = @endDate
    CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE(
    [n] [int] NOT NULL,
    PRIMARY KEY CLUSTERED
    [n] ASC
    )WITH (IGNORE_DUP_KEY = OFF)
    GO

    Why are you asking how to be an awful SQL programmer??  Your whole approach to SQL is wrong.
    We have a DATE data type so your insanely long NVARCHAR(50) of Chinese Unicode strings is absurd. Perhaps you can post your careful research on this? Can you post one example of a fifty character date in any language? 
    The use of the "sp_" prefix has special meaning in T-SQL dialect. Good SQL programmers do not use CREATE TYPE for anything. It is dialect and useless. It is how OO programmers fake it in SQL. 
    The design flaw of using a "tbl-" prefix on town names is called "tibbling" and we laugh at it. 
    There are no lists in RDBMS; all values are shown as scalar values. First Normal Form (1NF)? This looks like a set, which would have a name. 
    In any -- repeat any -- declarative programming language, we do not use local variables. You have done nothing right at any level. You need more help than forum kludges. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • JDeveloper 11.1.2.3, ADF Faces: need declarative component idea for table

    Some background:
    I'm trying to create a reusable toolbar for standard af:table behavior, see screen shot
    http://wesfang.files.wordpress.com/2013/05/dc.jpg
    I got the idea from the from using documentation Frank has published in the past
    1. http://www.oracle.com/technetwork/developer-tools/adf/learnmore/001-access-declarative-comp-attr-169113.pdf
    2. Adding a new row programatically
    The consuming subsystem's page passes in a "MyPageBean" which is a subclass of a "ArchBean" where all actionlistener operations are defined. The idea here is to minimize developer customization when using this component.
    ... <f:facet name="toolbar">             <af:toolbar id="t2">                 <mskcc:basicTransactionToolbar id="btt1" pageBean="#{MyPageBean}" tableId="t1"/>             </af:toolbar> </f:facet> ...
    The table within the consuming page is by default dropped off as a "editable" table. The developer needs to further modify the "disable" attribute to true for all the input fields and command components within the table. I would like to remove this developer step and instead have it in an architectural component. All ideas are welcome.

    Ok, finally got it working (sort of)
    Using the following method as you suggested:
    public void encodeChildren(FacesContext fc){
            try {          
                super.encodeChildren(fc);
                RichTable table =
                    (RichTable)ADFFacesUtil.findComponentInRoot((String)this.getAttributes().get("tableId"));
                lockUnlockTable(table); //method for toggling disable attribute for all command and input components
            } catch (IOException e) {
                e.printStackTrace();
    }Now the strange problem I encountered is that the encode methods are not called if the declarative component is defined within a panelCollection's f:facet-toolbar like below:
    <f:facet name="toolbar">
                        <mskcc:basicTransactionToolbar id="btt1" tableId="t1" pageBean="#{TestBean}"/>
    </f:facet>Also the above code has to be manually created because the design time editor does not allow me to drop off the dc within the toolbar facet (even though the dc is a toolbar!)
    Instead, If I move the dc outside the panelcollection, then the encode methods are invoked and the desired enable/disable behavior is correctly displayed.

  • How to pass parameter to cursor for loop having table type?

    Hi Friends,
    I am wondering how to pass a parameter into second for loop in the example code below.Please see the bold statements and answer my queries.
    Thanks a lot .Here is the code .
    declare
    l_bom_header_tbl BOM_BO_PUB.BOM_HEADER_TBL_TYPE ; ---TABLE TYPE
    V_bom_header_tbl Bom_Bo_Pub.Bom_Head_Rec_Type := Bom_Bo_Pub.G_MISS_BOM_HEADER_REC; ---Record type
    v_bom_components_tbl Bom_Bo_Pub.Bom_Comps_Tbl_Type := Bom_Bo_Pub.G_MISS_BOM_COMPONENT_TBL;---nested table type
    c:=0 number ;
    k:=1 number ;
    begin
    BOMPXINQ.Export_BOM(
    P_org_hierarchy_name => l_org_hierarchy_name,
    P_assembly_item_name => l_assembly_item_name,
    P_organization_code => l_organization_code,
    P_alternate_bm_designator => '1Test',
    P_Costs => l_costs,
    P_Cost_type_id => l_cost_type_id,
    X_bom_header_tbl => l_bom_header_tbl,
    X_bom_revisions_tbl => l_bom_revisions_tbl,
    X_bom_components_tbl => l_bom_components_tbl,
    X_bom_ref_designators_tbl => l_bom_ref_designators_tbl,
    X_bom_sub_components_tbl => l_bom_sub_components_tbl,
    X_bom_comp_ops_tbl => l_bom_comp_ops_tbl,
    X_Err_Msg => l_Err_Msg,
    X_Error_Code => l_Error_Code);
    if l_Error_Code = 0 then
    for i in 1 .. l_bom_header_tbl.COUNT LOOP
    V_bom_header_tbl.organization_code :='DSC';
    Can we assign a table type to record type like below statement?
    V_bom_header_tbl.assembly_item_name:= l_bom_header_tbl(i).assembly_item_name ;
    k:=1;
    I want to pass parameter  l_bom_header_tbl(i).assembly_item_name  into the for statement below: How to achieve this?
    for j in 1 .. l_bom_components_tbl.COUNT LOOP
    Can we assign a table type to table  type like below statement?
    v_bom_components_tbl(k).Assembly_Item_name := l_bom_header_tbl(i).assembly_item_name ;
    k := k + 1;
    end LOOP;
    end loop;
    end;
    Edited by: ILovePlSql on Mar 22, 2010 7:51 AM
    Edited by: ILovePlSql on Mar 22, 2010 8:16 AM

    ILovePlSql wrote:
    V_bom_header_tbl.assembly_item_name:= l_bom_header_tbl(i).assembly_item_name ;
    v_bom_header_tabl is a record type and l_bom_header_tbl is a table type .So is the above statement ok?I asked you for type definition. Please provide definition of BOM_BO_PUB.BOM_HEADER_TBL_TYPE and Bom_Bo_Pub.Bom_Head_Rec_Type. If BOM_BO_PUB.BOM_HEADER_TBL_TYPE is table of Bom_Bo_Pub.Bom_Head_Rec_Type then your statment is OK. For example:
    SQL> declare
      2      type BOM_HEADER_TBL_TYPE is table of emp%rowtype index by binary_integer;
      3      l_bom_header_tbl BOM_HEADER_TBL_TYPE;
      4      V_bom_header_tbl emp%rowtype;
      5  begin
      6      select * bulk collect into l_bom_header_tbl from emp;
      7      for i in 1 .. l_bom_header_tbl.count loop
      8        V_bom_header_tbl.ename := l_bom_header_tbl(i).ename;
      9      end loop;
    10  end;
    11  /
    PL/SQL procedure successfully completed.
    SQL> SY.

  • What is standard table type for the BAPIRET2

    Hi all,
    what is standard table type for the BAPIRET2
    Thanks,
    Mythily

    >
    Vikranth.Reddy wrote:
    > Hey Suhas, you edited your example after my post
    As the cliche goes, "Great minds think alike "
    Out of the 94 hits for table types i could have chosen BAPIRET2TAB, BAPIRET2_TT, BAPIRET2_TAB etc. but as luck would have it i chose BAPIRET2_T.
    Cheers,
    Suhas

  • Regarding Table type..

    Hi,
    I used to declare internal table as given below and use them in the program,
    Data : int1 type Mara.
    Data : int2 like Mara.
    But recently i saw a syntax as given below,
    Data: <internal table name> type <Table type>.
    What is table type?
    What is it use when declaring with internal table?
    I saw table type in SE11 and entered MARA in table type but i got information that "No objects correspond to the selection criteria". Please give me example for "table type".

    Hi,
    Check this out......
    You can specify the table type <tabkind> as follows:
    ANY TABLE->
    1.INDEX Table.
    2.Hashed table.
    In INDEX TABLE->
    1.STANDARD TABLE.
    2.SORTED TABLE.
    Generic table types
    INDEX TABLE
    For creating a generic table type with index access.
    ANY TABLE
    For creating a fully-generic table type.
    Data types defined using generic types can currently only be used for field symbols and for interface parameters in procedures . The generic type INDEX TABLE includes standard tables and sorted tables. These are the two table types for which index access is allowed. You cannot pass hashed tables to field symbols or interface parameters defined in this way. The generic type ANY TABLE can represent any table. You can pass tables of all three types to field symbols and interface parameters defined in this way. However, these field symbols and parameters will then only allow operations that are possible for all tables, that is, index operations are not allowed.
    Fully-Specified Table Types
    STANDARD TABLE or TABLE
    For creating standard tables.
    SORTED TABLE
    For creating sorted tables.
    HASHED TABLE
    For creating hashed tables.
    Fully-specified table types determine how the system will access the entries in the table in key operations. It uses a linear search for standard tables, a binary search for sorted tables, and a search using a hash algorithm for hashed tables.
    Regards
    Sujit Pal.

  • Wanted to assign a table type and wanted to print it

    Hi
    I have a object type by the name
    create or replace type emp_ty as object(empno number(10),ename varchar2(100),sal number(10),deptno number(10));
    In this there is a table type the name emp_tab
    create or replace type emp_tab as table of emp_ty;
    Now I have a variable by the name
    declare
    a_input emp_tab;
    begin
    a_input := emp_tab();
    dbms_output.put_line(a_input);
    end;
    This is giving me error
    ORA-06550: line 5, column 1:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 5, column 1:
    PL/SQL: Statement ignored
    Can you suggest me how to print a value for table types
    Appreciate your help on the above?
    Thanks & Regards
    Thakur Manoj R

    DECLARE
      a_input emp_tab;
    begin
    a_input := emp_tab();
    for i in 1..a_input.count loop
          dbms_output.put_line(a_input(i).empno);
    END LOOP;
    END;
    /

  • Client Proxy - Response Message does not populate table type element

    Hi,
    I came cross the situation:
    Sync Client ABAP Proxy --->PI -
    > Web Service Provider
    In our response structure, there are some single value (0:1) and table value (0:unbound).
    While testing proxy, we can see response message has one value for table type element, however, input structure table is not populated with the value.
    Any advice or idea ?
    Thanks
    Liang

    Thanks for your advice.
    The proxy is in green status. Anyway, I regenerate it and activate it again.
    The problem still exist.
    For all single elment value, I do not have problem, it seems the proxy treat the table element as single element.
    Regards
    Liang

  • Calrification of structure and table type

    hai experts,
    what is the difference between STRUCTURE AND TABLE TYPE?

    Refer this for TABLE TYPE
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm
    STRUCTURE
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2d74358411d1829f0000e829fbfe/content.htm
    SE11, In structre u <b>cant maintain any values</b>. Its just used as a refernce.
    In tables u can maintain values.

  • Which table lists the table types of a system

    Hi!
    I know that DD02L contains which tables there are in the system. But which table contains which table types that are in the system?
    Regards Anders

    DD40L                          Table types (internal tables defined in DD)
    DD40T                          Text on table types
    DD42S                          Key fields for table types (internal tab. define
    DDTYPES                        Table of all Dictionary types and classes
    DDTYPET                        ABAP/4 Dictionary: Texts for type groups

  • "table type" result from stored procedure (Oracle 10g) for physical service

    Hello,
    I'm trying to create a physical service based on a stored procedure which returns a table type like this:
    SQL
    -- create table
    create table myTable ( "col1" VARCHAR2(250) not null enable, "filtercol1" VARCHAR2(250), "filtercol2" VARCHAR2(250), "sortcol1" VARCHAR2(250), "sortcol2" VARCHAR2(250), "sortcol3" VARCHAR2(250))
    -- create return type
    create or replace type myResultType as table of varchar2(250);
    -- create function
    create or replace function getResult(param1 in varchar2, param2 in varchar2, orderby in varchar2) return myResultType as
    query_str VARCHAR2(1000);
    myResult myResultType;
    begin
    query_str := 'select m.col1 from myTable m where m.filtercol1 like :param1 and m.filtercol2 like :param2 order by ' || orderby;
    execute immediate query_str bulk collect into myResult using param1, param2;
    return myResult;
    end getResult;
    The wizard for creating the physical service complains that it can't find the return type and I have to create a schema by myself. How should it look like? I can't find a sample in the documentation.
    Thanks for any help,
    Guido

    Ok, now the wizard produces something like this:
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="protected" kind="library" isPrimary="false" nativeName="GETRESULT" nativeLevel2Container="MY_SCHEMA" style="storedProcedure">
    <nonCacheable/>
    <params xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" xmlns:pn1="ld:physical/SQLServices/MY_TMP_TABLE" >
    <param name="RETURN_VALUE" kind="return" xqueryType="pn1:MY_TMP_TABLE" nativeTypeCode="0" nativeType="RowSet"/>
    <param name="RETURN_VALUE" kind="out" xqueryType="pn1:MY_TMP_TABLE" nativeTypeCode="0" nativeType="RowSet"/>
    <param name="PARAM1" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="PARAM2" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="ORDERBY" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    </params>
    </f:function>::)
    declare procedure f1:GETRESULT($PARAM1 as xs:string, $PARAM2 as xs:string, $ORDERBY as xs:string) as schema-element(t1:GETRESULT) external;
    Then WorkSpace Studio complains about: "... error: cos-element-consistent: Type of 'RETURN_VALUE' is inconsistent with another element with the same name in this content model. "
    If I rename one RETURN_VALUE to RETURN_VALUE1 (the param name and in the schema file) the error is gone, but if I try to test the method I get:
    com.bea.dsp.das.exception.DASException: weblogic.xml.query.exceptions.XQuerySagaException: {bea-err}UPD003: Update failure: mixed outcome, update error dispatched (updateid=SAGA_596ba32b1ff8d8a4:181f0b20:11f92ed2529:-7fe2): java.lang.RuntimeException: Konflikt bei Parametertyp
         at com.bea.dsp.das.ejb.EJBClient.invokeOperation(EJBClient.java:160)
         at com.bea.dsp.das.DataAccessServiceImpl.invokeOperation(DataAccessServiceImpl.java:171)
         at com.bea.dsp.das.DataAccessServiceImpl.invoke(DataAccessServiceImpl.java:122)
         at com.bea.dsp.ide.xquery.views.test.QueryExecutor.invokeFunctionOrProcedure(QueryExecutor.java:121)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.getFunctionExecutionResult(XQueryTestView.java:1006)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.executeFunction(XQueryTestView.java:1134)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedImpl(XQueryTestView.java:1807)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.access$300(XQueryTestView.java:159)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent$3.run(XQueryTestView.java:1535)
         at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedBusy(XQueryTestView.java:1538)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelected(XQueryTestView.java:1500)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
         at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.eclipse.core.launcher.Main.invokeFramework(Main.java:339)
         at org.eclipse.core.launcher.Main.basicRun(Main.java:283)
         at org.eclipse.core.launcher.Main.run(Main.java:984)
         at org.eclipse.core.launcher.Main.eclipse_main(Main.java:959)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.m7.installer.util.NitroxMain$1.run(NitroxMain.java:39)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    "Konflikt bei Parametertyp" means something like: parameter type conflict
    Best regards,
    Guido

  • Table type for an internal table

    hi Gurus
    Can I create a table type of an internal table, if yes then how?
    The declaration of the table type has fields from 10 dfferent Infotyopes.
    Edited by: swarnali_IBM on Feb 2, 2012 6:25 AM
    Moderator Message: Search for available information before posting.
    Edited by: kishan P on Feb 2, 2012 11:13 AM

    Hi
    The problem is ALV can shown a flat data, but you have a deep structure: you can have several lines of a text for the same items, this kind of structure can't be used in ALV.
    So you should indicate us how you need to show it by ALV:
    to show the first line for every item?
    to show all lines? (but it means to repeat the document and item number for every line of the text
    In this case the structure for the ALV should be:
    VBELN    TYPE VBELN_VA,
    POSNR    TYPE POSNR_VA
    TEXTLINE TYPE TDLINE
    Max

  • How to declare a table type while executing a Procdure??

    Hi All,
    I'm facing a problem that i'm not able to call a type as an input to a proc.
    My proc has two inputs as table type and other normal inputs.
    I'm using these table type to insert value into another table.
    But when i try and execute the procedure in a DECLARE - BEGIN - END block, i'm not able to define the type properly.
    Please help mw put on this??
    Thnx in advance!!!

    Are you trying to create stored procedure with table type parameter? If so, you either needto declare table type in sql or in a PL/SQL package. For example:
    SQL> create or replace
      2    type tbl_type
      3    as table of number
      4  /
    Type created.
    SQL> create or replace
      2    procedure p1(
      3                 p_tbl tbl_type
      4                )
      5      is
      6      begin
      7          for i in 1..p_tbl.count loop
      8            dbms_output.put_line(p_tbl(i));
      9          end loop;
    10  end;
    11  /
    Procedure created.
    SQL> set serveroutput on
    SQL> begin
      2      p1(tbl_type(1,3,5,99));
      3  end;
      4  /
    1
    3
    5
    99
    PL/SQL procedure successfully completed.
    SQL> create or replace
      2    package pkg1
      3      is
      4        type tbl_type is table of number;
      5  end;
      6  /
    Package created.
    SQL> create or replace
      2    procedure p2(
      3                 p_tbl pkg1.tbl_type
      4                )
      5      is
      6      begin
      7          for i in 1..p_tbl.count loop
      8            dbms_output.put_line(p_tbl(i));
      9          end loop;
    10  end;
    11  /
    Procedure created.
    SQL> set serveroutput on
    SQL> begin
      2      p2(pkg1.tbl_type(1,3,5,99));
      3  end;
      4  /
    1
    3
    5
    99
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Need help for record/table type

    Hi, All,
    I have a table below and I need to use a procedure/function to return a list of values out and use anther procedure (array with multiple values in) to update the database. Could someone please give some examples?
    Here are my questions:
    1.     I need to create a user_defined_type to hold the list of info (array like, with more fields). Does the table type with %rowtype do that? If not, Could you please give an example?
    2.     if I do
    SELECT * INTO V_test(1) FROM PREO_profile
    where user_id = '1';
    can the 3 records of user_id 1 all be selected in the V_test table? If not, could you please tell me what to do?
    Thanks a lot.
    PREO_profile:
    User_id     N_id          M_id
    1      11 111
    1      22 222
    1      33 333
    2      11 111
    2      22 222
    2      33 333
    CREATE OR REPLACE PROCEDURE test_updatePro
    (user_id in varchar2,
    profile_info out T_Test)AS
    Type T_Test is table of PREO_profile%rowtype
    index by binary_integer;
    V_test T_Test;
    BEGIN
         SELECT * INTO V_test(1) FROM PREO_profile
         where user_id = '1';
    END;

    Here is one approach. This works in 9iR2. It's worth noting this functionality is evolving quite fast. Consequently, stuff that works in 9.2 may well not work in 9.0.1 and can probably be done much neater in 10g.
    Let's start by creating some tables....
    SQL> CREATE TABLE preo (user_id NUMBER, m_id NUMBER, n_id NUMBER);
    Table created.
    SQL> INSERT INTO preo VALUES (1, 11, 111);
    1 row created.
    SQL> INSERT INTO preo VALUES (1, 22, 222);
    1 row created.
    SQL> INSERT INTO preo VALUES (1, 33, 333);
    1 row created.
    SQL> INSERT INTO preo VALUES (2, 11, 111);
    1 row created.
    SQL> INSERT INTO preo VALUES (2, 22, 222);
    1 row created.
    SQL> INSERT INTO preo VALUES (2, 33, 333);
    1 row created.
    SQL> CREATE TABLE neo_preo AS SELECT * FROM preo WHERE 1=0;
    Table created.
    SQL> We'll need some types we need for communicating between processes....
    SQL> CREATE OR REPLACE TYPE preo_t AS OBJECT (u_id NUMBER, n_id NUMBER, m_id NUMBER);
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE preo_nt IS TABLE OF preo_t;
      2  /
    Type created.
    SQL> Here are methods to populate an array (actually a nested table)....
    SQL> CREATE OR REPLACE FUNCTION get_preo (p_uid IN NUMBER) RETURN preo_nt
      2  AS
      3    return_value preo_nt := preo_nt();
      4  BEGIN
      5    SELECT preo_t(user_id, n_id, m_id)
      6    BULK COLLECT INTO return_value
      7    FROM   preo
      8    WHERE  user_id = p_uid;
      9    RETURN return_value;
    10  END;
    11  /
    Function created.
    SQL>... and consume that array....
    SQL> CREATE OR REPLACE PROCEDURE ins_neo_preo (p_newrows IN preo_nt)
      2  AS
      3  BEGIN
      4     INSERT INTO neo_preo
      5     SELECT * FROM TABLE(CAST(p_newrows AS preo_nt));
      6  END;
      7  /
    Procedure created.
    SQL> So now we're ready to rock!
    SQL> DECLARE
      2      nt  preo_nt;
      3  BEGIN
      4      nt := get_preo(1);
      5      ins_neo_preo(nt);
      6  END;
      7  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> SELECT * FROM neo_preo
      2  /
       USER_ID       M_ID       N_ID
             1        111         11
             1        222         22
             1        333         33
    SQL> A little bit of limbo, a little bit of samba!
    Cheers, APC

Maybe you are looking for

  • Image Process is not closing the files In CS6 - what do I do?

    When using Image processor (from Bridge) - the files all save to a jpg folder in my main folder but NONE of the files close in CS6 at all.  How do I get them to close?

  • I can't activate iMessage on my iPad3. Why do I get a message saying: Unable to contact the iMessage server. Try again."

    I can't activate iMessage on my iPad3; message says: Unable to contact the iMessage server. Try again." Settings > iMessage > Enter Apple ID I enter the info Click "Sign In" Prompted for my Apple ID Password again (in a pop up) Message appears "iMess

  • Drop Shadow Frames

    I've been trying to put a different frame around my pictures.  I've received many helpful tutorials on how to do it.  Most all tutorials just quickly jump through changing the canvas size.  The say things like - "well I'll just add xx to the canvas s

  • App store pops up???

    My grandma has the new imac 2013, when working on her imac I notice that the app store randomly pops up.  Its frustrating and I would like for it to stop.  How can I stop the app store from randomly appearing on the screen?  I would say it happens ev

  • Why are my emails being marked as read automatically?

    I recently changed from iPhone 4 to 5; I never experienced any email issues with the iphone4. Now my emails on iphone5 ;same account etc) are sometimes marked as read before I view them. This happens every night over night without fail, and invariabl