Mapping refcursors with object types in a procedure

Hi all,
I need some help regarding the mapping of refcursors with object types .
Example: Procedure "A" has object types as input/output parameters which lies in the Web Method Application as a API.
We are creating a procedure "B" which has ref cursors as input/ouput parameters
which will map to the Procedure "A"'s object type parameters.
It will be highly needful for the solution.
Regards
Saugata

Your pseudocode has a lot of steps in it, but you didn't say which step you need help with. Since I already covered going from a nested table type to a refcursor, I'll assume you want an example that goes the other way now, like from a refcursor to a nested table type. Here's one ...
SQL>
SQL>
SQL> set serveroutput on
SQL>
SQL> create type nested_table_type as table of varchar2(14) ;
  2  /
Type created.
SQL> show errors
No errors.
SQL>
SQL>
SQL> create function func
  2    ( p_cursor in sys_refcursor )
  3    return nested_table_type
  4  as
  5    v_nested_table nested_table_type ;
  6  begin
  7
  8    fetch p_cursor bulk collect into v_nested_table ;
  9    return( v_nested_table );
10
11  end;
12  /
Function created.
SQL> show errors
No errors.
SQL>
SQL> select func( cursor( select dname from dept ) ) as nested_table from dual ;
NESTED_TABLE
NESTED_TABLE_TYPE('ACCOUNTING', 'RESEARCH', 'SALES', 'OPERATIONS')If your cursor selects objects instead of simple data types, the code is pretty much the same.
SQL> create type object_type as object ( c1 varchar2(14), c2 varchar2(13) );
  2  /
Type created.
SQL> show errors
No errors.
SQL>
SQL> create type nested_table_type as table of object_type ;
  2  /
Type created.
SQL> show errors
No errors.
SQL>
SQL>
SQL>
SQL> create function func
  2    ( p_cursor in sys_refcursor )
  3    return nested_table_type
  4  as
  5    v_nested_table nested_table_type ;
  6  begin
  7
  8    fetch p_cursor bulk collect into v_nested_table ;
  9    return( v_nested_table );
10
11  end;
12  /
Function created.
SQL> show errors
No errors.
SQL>
SQL> select
  2    func( cursor( select object_type( dname, loc ) from dept ) ) as object_table
  3  from dual ;
OBJECT_TABLE(C1, C2)
NESTED_TABLE_TYPE
  ( OBJECT_TYPE('ACCOUNTING', 'NEW YORK'),
    OBJECT_TYPE('RESEARCH', 'DALLAS'),
    OBJECT_TYPE('SALES', 'CHICAGO'),
    OBJECT_TYPE('OPERATIONS', 'BOSTON')
  )(NB I manually reformated the query results for clarity).

Similar Messages

  • No mapping exists from object type Telerik.Web.UI.RadMaskedTextBox to a known

    hi for all i got this problem when i try to update record in a database actually it's first
    time happining with me
    No mapping exists from object type Telerik.Web.UI.RadMaskedTextBox to a known
    managed provider native type
    and this is my code
    SqlCommand cmd = new SqlCommand("update RealEstate set DestinationEntity=@speechDirect,FULLName=@name,Individual_Iqama_NR=@egamhNo,Individual_Passport_NR_ID=@passport,Individual_Gender=@six,Individual_Sociall_Status=@martialstate,Individual_Passport_Issue_Date=@passportdate,Individual_Nationality_ID=@nationality,IqamaIssued_From=@egamhsource,Total_Staying_Time_KSA=@stayduration,Individual_Work_Address=@workdisc,Possess_Type=@omntype,Apartment_No=@estateno,Apartment_Floor_No=@storyno,Possess_City_ID=@city,QuarterID=@area,Deed_No=@InstrumentNo,Deed_Date_HijriAfter=@Instrumentdate,Deed_Issue_City_ID=@Instrumentsource,Request_Status=@orderstate,Real_Estate_Area=@estatespace,[notes]=@notes,Incomming_No=@waredno,Incomming_Date_HijriAfter=@wareddate,Qaied_No=@ghaidno,Qaied_Date_HijriAfter=@ghaiddate,ExportNumber=@jihtsdor, ExportDateHijriAfter=@job where Possess_ID=@id", _con);
    cmd.CommandType = CommandType.Text;
    _con.Open();
    cmd.Parameters.AddWithValue("@id", int.Parse(Request.QueryString["Serial"].ToString()));
    cmd.Parameters.AddWithValue("@speechDirect", RadComboBox1.SelectedValue);
    cmd.Parameters.AddWithValue("@name", txtname.Text);
    cmd.Parameters.AddWithValue("@egamhNo",txtegamhno.Text);
    cmd.Parameters.AddWithValue("@passport", txtpassportno.Text);
    cmd.Parameters.AddWithValue("@six",RDSix.SelectedValue);
    cmd.Parameters.AddWithValue("@martialstate", Rdstatus.SelectedValue);
    cmd.Parameters.AddWithValue("@passportdate", DateTime.Now);
    cmd.Parameters.AddWithValue("@nationality", RdNationality.SelectedValue);
    cmd.Parameters.AddWithValue("@egamhsource", txtegamhsou.Text);
    cmd.Parameters.AddWithValue("@stayduration", txtstayduration.Text);
    cmd.Parameters.AddWithValue("@workdisc", txtjobdirec.Text);
    cmd.Parameters.AddWithValue("@omntype", RdownType.SelectedValue);
    cmd.Parameters.AddWithValue("@estateno",txtflatNo.Text);
    cmd.Parameters.AddWithValue("@storyno", txtstoryNo.Text);
    cmd.Parameters.AddWithValue("@city", RDcity.SelectedValue);
    cmd.Parameters.AddWithValue("@area", RadComboBox2.SelectedValue);
    cmd.Parameters.AddWithValue("@InstrumentNo",txtskno.Text);
    cmd.Parameters.AddWithValue("@Instrumentdate", txtskdate.Text);
    cmd.Parameters.AddWithValue("@Instrumentsource", Rdsksource.SelectedValue);
    cmd.Parameters.AddWithValue("@orderstate", Rdordercase.SelectedValue);
    cmd.Parameters.AddWithValue("@estatespace",txtspace.Text);
    cmd.Parameters.AddWithValue("@notes", txtcomments.Text);
    cmd.Parameters.AddWithValue("@waredno",txtwaredno.Text);
    cmd.Parameters.AddWithValue("@wareddate", txtkitabno.Text);
    cmd.Parameters.AddWithValue("@ghaidno", txtgaidno.Text);
    cmd.Parameters.AddWithValue("@ghaiddate",txtghaiddate.Text);
    cmd.Parameters.AddWithValue("@jihtsdor",Rdsksource.SelectedValue);
    cmd.Parameters.AddWithValue("@job", txtsaderdate);
    int x =cmd.ExecuteNonQuery();
    any one could provide suggestion to solve this problem
    thanks

    Hello,
    I would like suggest you posting it to:
    http://www.telerik.com/support
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Ever used the Table API (TAPI) with object type in the DB?

    Hi all,
    We are trying to generate the table API of a table that has a column defined by an object type. It works without problems if that column always has a value (is instantiated in object term). The problem is when we update a row where the column is null (all attributes of the object are null thus the object is not instantiated).
    The "before update row" trigger of the Table API fails with error "ora-30625-method dispath on NULL SELF argument is disallowed".
    Any of you guys made it work? If so, how?
    Thanks

    user8879206 wrote:
    Hi friends,
    I have a procedure with object type IN OUT parameters which is used for fetching status. We are calling this from Java. But I want to call it from oracle for testing purpose. I am trying from my end but not able to do it as of now. This is the first time I am dealing with object type.We need more information. What is wrong? Your code looked okay and you did not mention any Oracle errors. What is happening that should not be or not happening that should be?
    You can call the procedure with a simple call in PL/SQL but will not be able to use it in SQL because 1) it is a procedure and 2) it has an OUT argument. A sample call should look something like (untested)
    declare
       x rec2;
       y rec3;
    begin
      --use the arguments rru was defined with as the arguments in the same order: types rec2 (x), rec3 (y)
      rru(x,y);
    end;>
    Any help would be appreciated.
    Details are given below.
    CREATE OR REPLACE TYPE REC1 AS OBJECT
    (RELAY_USAGE VARCHAR2(30)
    ,STATE VARCHAR2(1)
    TYPE REC AS TABLE OF REC1;
    CREATE OR REPLACE TYPE REC2 AS OBJECT
    (GSRN VARCHAR2(18)
    ,METERING_POINT_NAME VARCHAR2(80)
    ,RELAYS REC)
    CREATE OR REPLACE TYPE REC3 AS OBJECT
    (INFO VARCHAR2(2000)
    ,STATUS NUMBER
    PROCEDURE RRU(
    rcRelayControl IN OUT REC2
    , rcResp IN OUT REC3)
    IS
    BEGIN
    APKG.GetDetails(rcRelayControl, rcResp);
    IF rcResp.Status = BPKG.iStatusFailure THEN
    rcResp.Info := BPKG.Get_Message('20889', rcResp.Info);
    END IF;
    END RRU;
    How to call this procedure in oracle?
    Thanks.

  • Core Data Services in ABAP : No URI-Mapping defined for object type DDLS

    Hi ,
    When creating a DDL source , I get the error
    " No URI-Mapping defined for object type DDLS and object name ZCDSV_01_06".
    Can you please suggest what the issue could be?
    Thanks,
    Chakram Govindarajan

    Now I am able to proceed to the next step. Not sure how this started working. However, I get the below error when I open the DDL source editor for one particular ABAP system added in the eclipse environment. I however do not get the error when I open the DDL source editor for another system ( AH4) .I am providing the log error details . I updated the ADT installation. However the issue has not been resolved. Also I tried implementing the Note: 1834948. However I cannot find the option "Team -> Share project..." in the ABAP project.
    Thanks,
    Chakram Govindarajan

  • Any experience with Object Types and Forms6i / 9i ???

    Has anyone got any experience in working with Object Types and Object Views together with Forms 6i or 9i???
    TIA
    Rob Zoeteweij

    Hi AnneCarmen,
    Check this small video, http://project02.businesscatalyst.com/Jing/2012-07-13_0508.swf
    This is just an example where I am trying to demonstrate how the html embedded into the frame sticks to only one image and not to all the other images. Also, how to keep the thumbnails. Under menu options you can modify the transition and speed option as per your need.
    Regards,
    Abhishek Maurya

  • Restrictions with object types

    Hello
    Among other restrictions Oracle 8.1.7 does not support (1) change of definitions of types that have dependent data and (2)replication of object columns and object tables.
    (1) While it is possible to add columns to existing relational tables and even change the size of columns it is not possible to do so with object types. This may expose a significant limitation for schema migration and maintainance. Is there any other support for those requirements, any workarounds other than crafting table copy scripts from scratch?
    (2) This seems to make a couple of good things in Oracle unavailable with objects. No fault tolerance through replication? No standby database? What (development and runtime efficient) options remain with objects in that category?
    Do the limitations persist in Oracle 9i?
    What about tool support in Oracle 9i? DBA Studio, for example, is rather poor in dealing with objects in 8.1.7 - no browsing and management of object schema and data, you cannot even select an existing object type for a table column.
    Are there other restrictions one should be aware of before touching objects?
    Any experiences and information greatly appreciated.
    Thanks,
    Thomas
    null

    Thomas,
    Do you have some specific applications that you have in mind to use Oracle Objects? Do you plan to use type evolution and replication?
    Oracle9i Object-Relational Technology has reached a major milestone with several 'completeness' features. As Arvind pointed out, in Oracle9i, type evolution can propogate changes to dependents. Object replication is also supported in Oracle9i.
    Although Enterprize Management tools do provide easy-to-use GUIs, there are some limitations in handling Objects, especially when there are nesting involved. Fortunately, SQL*Plus can be used to remedy some of these limitations.
    Regards,
    Geoff

  • DB Adapter - Calling Stored Procedure with Object Type

    So, we are using JDeveloper 10.1.3.3
    We are trying to create an ESB process that invokes a SP with an object type. However, the owner of the package / SP, is NOT the owner of the object type. When going through the DB Adapter wizard, it gives us the following error:
    When attempting to use the DB Adapter in JDeveloper to create a partner link to execute a stored procedure. JDeveloper returns the following error:
    Unable to import WSDL.
    Error while writing wsdl file
    Database type is either not supported or is not implemented.
    Check to ensure that the type of the parameter is one of the supported datatypes or that there is a collection or user defined type definition representing this type defined in the database.
    However, if I create a wrapper package / SP, it works just fine. I'd really like to not be having to create wrapper code for these SPs to work. Is this resolved in 11g? Is there a patch available for 10.1.3.3?
    I think this is a JDeveloper Wizard issue, but thought I'd post this here as well.
    Thanks,
    BradW

    This problem can be resolved by granting execute permission on the object type to the caller. For example, if the stored procedure is in schema1 and the object type is in schema2 then you would connect as schema2 and execute
    SQL> grant execute on <object type> to schema1
    Referencing object types defined in other schemas is documented. This is the described method for accessing object types in other schemas.

  • How can we execute a procedure with object type as its parameter, by passing partial elements.

    Can somebody help...
    I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
    PROCEDURE p_save (example IN OUT xyz_obj)
    my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
    And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.

    user13026549 wrote:
    Can somebody help...
    I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
    PROCEDURE p_save (example IN OUT xyz_obj)
    my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
    And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.
    It ISN'T possible. How could it be? Each attribute has to be set to something don't you think?
    A common way to handle that is to define a public package variable that is an instance of the object type and has ALL elements set to null. As Odie suggested a custom constructor function can be used for that.
    Then you create your procedure instance by starting with an instance of the package variable (where everything is null) and setting values for the attributes you need.

  • How to call procedure with Object types in java

    Hi,
    We have procedure declaration as follows
    ===============
    TYPE TEST_TYPE AS OBJECT (NAME VARCHAR2(10));
    TYPE TESTTYPE1 AS object (student1 TESTTYPE,student2 TESTTYPE,student3 TESTTYPE);
    TYPE rect AS OBJECT
    -- The type has 3 attributes.
    length NUMBER,
    width NUMBER,
    area NUMBER,
    -- Define a constructor that has only 2 parameters.
    CONSTRUCTOR FUNCTION rect(length NUMBER, width NUMBER)
    RETURN SELF AS RESULT
    PROCEDURE G(obj1 in TESTTYPE1,obj2 out rect) as
    n1 testtype;
    n2 testtype;
    n3 testtype;
    n4 testtype;
    begin
    obj2 := NEW rect(10,20,200);
    n1 := obj1.student1;
    n2 := obj1.student2;
    n3 := obj1.student3;
    obj2.length :=20;
    end;
    =====================================================
    I am not able to call the procedure in java code as I cannot figure out which out parameter type will it be registered using registeroutparameter. using cursor or struct type fails.
    please let me know how I can pass values from stored procedure with objects to java.

    I'm not sure what you're trying to accomplish with your procedure, but in general, this is an example of how you could use oracle.sql.STRUCT.
    First, prepare your java.sql.CallableStatement using java.sql.CallableStatement cStmt = java.sql.Connection.prepareCall({ call G(?, ?) });
    Note that you don't have to use the OracleCallableStatement. The java.sql.CallableStatement will work just fine.
    For the IN parameter, you need to create three TEST_TYPE objects. Then you need to create one TESTTYPE1 object.
    These will all be instances of oracle.sql.STRUCT.
    To create a oracle.sql.STRUCT object you need a descriptor and a set of attributes. For example, to create a TEST_TYPE object you would do the following
    1. StructDescriptor sd = StructDescriptor.createDescriptor("TEST_TYPE", java.sql.Connection).
    2. Add a VARCHAR2 attribute to an array of attributes (e.g. Object[] attributes = new Object[]{"Student Name"})
    3. oracle.sql.STRUCT struct = new oracle.sql.STRUCT(sd, java.sql.Connection, attributes)
    Then do something similar to create the TESTTYPE1 object, except that the attribute array will contain three instances of TEST_TYPE struct objects.
    To bind the IN parameter you need to use the java.sql.CallableStatement.setObject(1, <Instance of TESTTYPE1 object>).
    To register the OUT parameter, you need to call java.sql.CallableStatement.registerOutParameter(2, oracle.jdbc.OracleTypes.STRUCT, "RECT").
    Then, execute your procedure using cStmt.execute();
    Retrieve your OUT parameter using oracle.sql.STRUCT struct = (oracle.sql.STRUCT)cStmt.getObject(2).
    Once you've done that, to get the values of the attributes of all of your STRUCT objects, you need their descriptors and their metadata.

  • Problem With Cutom Configuration with Object Type

    Dear Guru's
    I am working WebUI, I am facing a problem with Custom Configuration.
    1. The initial requirement to control the visibility for a dropdown event in ERP Quotation.
    2. To this i copied the default configuration to custom configuration with custom Object type and Subtype.
           CONFIG KEY: ZPJQTN
           OBJECT TYPE: ZOTYP_CONFIG
           OBJECT SUB TYPE:  ZSTYPE_CONFIG1
    3. I have created customm fields in enhancement.
    4. Now i chosen my new configuration (ZPJQTN,ZOTYP_CONFIG,ZSTYP_CONFIG1), when i click Show available fields, the custom fields are not showing. Instead the created fields are available at other configuration.
    5. I am able to control the visibility for the standard available fields.But i am not getting the custom created fields
    (Note:  I have created the Object type and Object sub type as follows: SPRO->CRM->UI Framework->Define Object Types
    Object type: ZOTYP_CONFIG Callback class: ZCL_CONFIG_CALLBACK
    Redifned the method: IF_BSP_DLC_OBJ_TYPE_CALLBACK~GET_OBJECT_SUB_TYPES
    Coded as below:
      data: lv_subtype type bsp_dlc_object_sub_type.
      lv_subtype = 'ZSTYP_CONFIG1'.
      append lv_subtype to result.
      lv_subtype = 'ZSTYP_CONFIG2'.
      APPEND lv_subtype to result.
    Now Please suggest me how to achieve this.
    Also please let me know, whether i am following the correct procedure for controlling the visibility.
    Thanks in Advance,
    S.Meganadhan.

    Hi Harshit,
    I added custom fields using AET only.
    I am able to see the field got added in the structure. I am able to access GET and SET methods of the field.
    But the problem is, it is not getting saved. Am i missed any configuration step?
    Please suggest me.
    Thanks in advance,
    Regards,
    S.Meganadhan.

  • Nested Tables with Object Types

    Hi,
    Does someone know from which version on object Types can be referenced via database links ?
    I could not manage with Oracle 8.1.7 and needed this features as the only way to access
    a stored procedure array is via collection and using Object Types.
    But Object Types are not possible to access remotlely.
    Thanks in advance.
    brg robert

    Click on the link below and see if you can use that method as a way to work around the problem:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1252400357305

  • Type attribute with Object type or Nested table?

    I have been creating lot many threads around the same problem, however i thought i knew but realized I do not know or else do not know how to..
    I have created object type with an attribute READINGVALUE NUMBER(21,6)...How can i use type attribute on this object while declaring variable.....can we use type attribute on NESTED TABLES, similar to the db tables?
    example
    CREATE TYPE READING AS OBJECT(READINGVALUE NUMBER(21,6));
    CREATE TABLE INTERVALREADINGS OF TYPE READING;

    meghavee wrote:
    Thanks Solomon, however this approach does not preserve precision/scale of number data type.....What you can do is create placeholder tables:
    SQL> create table reading_type_placeholder of reading
      2  /
    Table created.
    SQL> desc reading_type_placeholder
    Name                                      Null?    Type
    READINGVALUE                                       NUMBER(21,6)
    SQL> declare
      2      v_var reading_type_placeholder.readingvalue%type;
      3  begin
      4      v_var := 123456789012345;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2      v_var reading_type_placeholder.readingvalue%type;
      3  begin
      4      v_var := 1234567890123456;
      5  end;
      6  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 4
    SQL>And if you modify type attribute:
    SQL> alter type reading modify attribute readingvalue number(26,6) cascade;
    Type altered.
    SQL> desc reading_type_placeholder
    Name                                      Null?    Type
    READINGVALUE                                       NUMBER(26,6)
    SQL>SY.

  • Workflow with Object Type LFA1

    Dear Workflow Gurus,
    My business scenario is as follows:
    1. User will create the Vendor Master
    2. Workflow will be triggered to the Manager so that he can check it (Display only)
    Basically, I created a workflow with the following:
    Start Event - BO LFA1 CREATED
    Task - BO LFA1 DISPLAY
    I have tested my workflow at SWDD and SWUE. It is working fine and I get the notification in my SBWP. I can then double click/execute the item in my SBWP Inbox and it will take me to XK03 (Working Perfectly). However, in a real time scenario, when I create a Vendor Master via either FK01, MK01 or XK01, I dont get any notification in my SBWP. Im puzzled as the test at SWDD and SWUE was a success.
    Im wondering whether Im using the correct Object Type and Method for my START EVENT - BO LFA1 CREATED. Please take note that everything is Active, has been binded and I have assigned (Import checkbox) LFA1 in my Workflow Container
    Please advise.

    Hi,
    It looks no event is created from FK01, MK01 or XK01.
    Please activate the workflow event trace and check the event.
    Regards,
    Masa

  • Ever used the Designer Table API (TAPI) with object type in the DB?

    Hi all,
    We are trying to generate the Oracle Designer table API of a table that has a column defined by an object type. It works without problems if that column always has a value (is instantiated in object term). The problem is when we update a row where the column is null (all attributes of the object are null thus the object is not instantiated).
    The "before update row" trigger of the Table API fails with error "ora-30625-method dispath on NULL SELF argument is disallowed".
    The code that fails is the following:
    cg$ind.TFO_DESCRIPTION :=(:new.TFO_DESCRIPTION IS NULL AND :old.TFO_DESCRIPTION IS NOT NULL )
    OR (:new.TFO_DESCRIPTION IS NOT NULL AND :old.TFO_DESCRIPTION IS NULL)
    OR NOT(:new.TFO_DESCRIPTION = :old.TFO_DESCRIPTION) ;
    In this example, cg$ind.TFO_DESCRIPTION is a boolean and the TFO_DESCRIPTION column is based on an object type.
    Thanks for any feedback or suggestions

    For a solution to this problem: I set down to write a relatively simple and small piece of code that we can use as post compiler or post generator. After we generated one or more TAPIs, we can run this post compiler to remedy the problem the TAPI has with Merge operations. The post compiler will fix the PL/SQL inside the database. It reads the TAPI objects using dbms_metadata, makes the simple change by manipulating the PL/SQL source and then recreates the objects using execute immediate. Using this post compiler, it takes but a few seconds to fix the merge flaw in all TAPIs in your application.
    http://technology.amis.nl/blog/index.php?p=842

  • How to insert with select in table with object types

    I am in the proces of redesigning some tables, as i have upgraded from
    personal oracle 7 to personal oracle 8i.
    I have constructed an object type Address_type, which is one of the columns
    in a table named DestTable.
    The object type is created as follows:
    CREATE OR REPLACE TYPE pub.address_type
    AS OBJECT
    Street1 varchar2(50),
    Street2 varchar2(50),
    ZipCode varchar2(10));
    The table is created as follows:
    CREATE TABLE pub.DestTable
    (id INTEGER PRIMARY KEY,
    LastName varchar2(30),
    FirstName varchar2(25),
    Address pub.address_type);
    Inserting a single row is ok as i use the following syntax:
    Insert into DestTable(1, '******* ', 'Lawrence', pub.address_type(
    '500 Oracle Parkway', 'Box 59510', '95045'));
    When i try to insert values into the table by selecting from another table i
    cannot do it and cannot figure out what is wrong
    I have used the following syntax:
    Insert into DestTable
    id, name, pub.address_type(Street1, Street2, ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    I have also tried the following syntax:
    Insert into DestTable
    id, name, pub.address_type(Address.Street1, Address.Street2,Address.ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    What is wrong here ?
    null

    Magnus,
    1. Check out the examples on 'insert with subquery' in http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a85397/state21b.htm#2065648
    2. Correct your syntax that repeated the column definition after "insert into ..."
    Insert into DestTable
    id, name, pub.address_type(Street1, Street2, ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    Regards,
    Geoff
    null

Maybe you are looking for