How to record object type type cast

Tbl table (col1, col2 number number)
type the object obj (col1, col2 number number)

in the package I
obj1 obj;
for rec_test in (select * from tbl) loop

Here, I wanted to make an assignment

obj1 = cast (rec_test as obj)

His giving compile error

Error (301,29): PLS-00382: expression is of the wrong type

How about you put together a better example, something like that, so we have a real idea of what you're talking about (the exact commands you use and your version of Oracle).

ME_XE?create table table1
  2  (
  3     col1 number,
  4     col2 number
  5  );

Table created.

Elapsed: 00:00:01.03
ME_XE?
ME_XE?insert into table1 select level, mod(level, 4) from dual connect by level <= 100;

100 rows created.

Elapsed: 00:00:00.96
ME_XE?
ME_XE?create type  table1_type as object
  2  (
  3     col1 number,
  4     col2 number
  5  );
  6  /

Type created.

Elapsed: 00:00:01.21
ME_XE?
ME_XE?declare
  2  begin
  3     for x in
  4     (
  5        select
  6           table1_type(col1, col2) as some_values
  7        from table1
  8        where col1 = 10
  9     )
 10     loop
 11        dbms_output.put_line(x.some_values.col1 || '-' || x.some_values.col2);
 12     end loop;
 13  end;
 14  /
10-2

PL/SQL procedure successfully completed.

Elapsed: 00:00:01.76
ME_XE?
ME_XE?select * from v$version;

BANNER
----------------------------------------------------------------------------------------------
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

5 rows selected.

Elapsed: 00:00:03.23

Tags: Database

Similar Questions

  • Impossible object type cast 'VMware.Vim.ClusterVmHostRuleInf o' type 'VMware.Vim.ClusterAntiAffinityRuleSpec '.

    Hello

    I was surprised by this error. Any who see it this way? I was doing some affinity for the cluster rules. At the beginning when there was no vmgroups, hostgroups, no virtual machine to the rules of the host, this command worked very well, that no errors were generated. According to the rules of antiaffinity of vm-virtual machine, I did a few groups of MV, the host groups and created AA rules for this cluster as well via the api.  Everything has not worked well, no errors when creating. But after a few days, I wanted to add 1 more AA machine vm-virtual rule. And I received this error, no idea why this would come to the top? This error appears, but the rule is created anyway.

    PowerCLI C:\ > XYZ New-DrsRule-Cluster - name AA-vm1-vm2 - KeepTogether: $false VM - vm1, vm2
    New-DrsRule: 14/05/2012 09:30:23 impossible object type cast New-DrsRule ' VMware.Vim.ClusterVmHostRuleInf
    o ' to type 'VMware.Vim.ClusterAntiAffinityRuleSpec '.
    Online: 1 character: 12
    + New-DrsRule < < < < - XYZ - name AA-vm1-vm2 Cluster - KeepTogether: $false VM - vm1, vm2
    + CategoryInfo: NotSpecified: (:)) [new DrsRule], ViError)
    + FullyQualifiedErrorId: Client20_ClientSideTaskImpl_ThreadProc_UnhandledException, VMware.VimAutomation.ViCore.Cm
    dlets.Commands.NewDrsRule

    Thank you

    Greg

    BTW.

    Why he would mount "VMware.Vim.ClusterVmHostRuleInfo"?

    "An object of ClusterVmHostRuleInfo identifies virtual machines and the host groups that determine the position of the virtual machine. Virtual machines and the host referenced by a rule of VM-host must be in the same cluster. »

    But it is a rule antiaffinity VM - VM, not a vm host rule.  I still have no idea why the error comes out but I used onyx to see if I have the same problem when you do it with the api:

    $spec = new-Object VMware.Vim.ClusterConfigSpecEx
    $spec.rulesSpec = new-Object VMware.Vim.ClusterRuleSpec [] (2)
    $spec.rulesSpec [0] = new-Object VMware.Vim.ClusterRuleSpec
    $spec.rulesSpec [0] .operation = 'Add '.
    $spec.rulesSpec [0] = new-Object VMware.Vim.ClusterAffinityRuleSpec .info
    $spec.rulesSpec [0].info.enabled = $true
    $spec.rulesSpec [0].info.name = "AA-vm1-vm2.
    $spec.rulesSpec [0].info.userCreated = $true
    $spec.rulesSpec [0].info.vm = new-Object VMware.Vim.ManagedObjectReference [] (2)
    $spec.rulesSpec [0].info.vm [0] = new-Object VMware.Vim.ManagedObjectReference
    $spec.rulesSpec [0].info.vm [0] = 'VirtualMachine' game
    $spec.rulesSpec [0].info.vm [0] .value = "vm-xxxxxxx".
    $spec.rulesSpec [0].info.vm [1] = new-Object VMware.Vim.ManagedObjectReference
    $spec.rulesSpec [0].info.vm [1] = 'VirtualMachine' game
    $spec.rulesSpec [0].info.vm [1] .value = "vm-yyyyyyy.

    _this $ = get-view-Id "ClusterComputeResource-domain-c345645464.
    _this $. ReconfigureComputeResource_Task ($spec, $true)

    It works without errors

    Hi Greg,.

    Thank you for reporting this issue. I can also confirm that it is a bug that is caused by vm-to-host rules. We already fixed for the next version.

    Kind regards

    Yasen

  • Impossible object type cast 'System.Boolean' to type 'System.String '.

    Whenever I boot, I get the message on the impossible object of type casting office "System.Boolean" in type 'System.String '. How can I erase this?

    It's because of one of your applications at startup, open start and find MSCONFIG or MSCONFIG.msc and in boot menu deselection those applications that you may think caused this problem and restart your PC.

  • How to detect the type cast variant

    I did a piece of refactoring lately that cause the replacement a variant with an object.  Variants be wonderful as they are, any old interface VI, which would take a Variant entered simply throws the entry object to a variant.  Is it possible to search for LabVIEW for this action of casting?  I would prefer not to have to find each module that took the variant / should now take an object, if possible.

    Simplest is to open your project, open a VI that you know has the function, click on the function and the + f hit.  The dialog box search must already be on 'Search objects' with the selected function.  The value of the drop-down list to and click on find.

    You can do this without selecting the function before + f - you just need a little bit of navigation.

  • How to return data using the object type?

    Hello all - I have an obligation to return the values object type.

    In the same way as

    list - Plan1, Subplan1, Fund1, 2 Fund Fund 3

    list - Plan2, Subplan2, Fund2

    list - plane3, Subplan3, not funds


    To achieve this I wrote below proc but its giving as response below which is does not correspond with my requirement. Someone has an idea how to write code to get the list of funds against each plan in each line?



    Output:

    PDB01. () T_T_CONTRACT

    PDB01. T_O_CONTRACT ('p1', 's1', PDB01. T_O_FUND ('p1', 's1', 'f1')),

    PDB01. T_O_CONTRACT ('p1', 's1', PDB01. T_O_FUND ('p1', 's1', 'f2')),

    PDB01. T_O_CONTRACT ('p1', 's1', PDB01. T_O_FUND ('p1', 's1', 'f3')),

    PDB01. T_O_CONTRACT ('p2', 's2', PDB01. T_O_FUND ('p2', 's2', 'f2')),

    PDB01. T_O_CONTRACT ('p3', 's3', PDB01. T_O_FUND (NULL, NULL, NULL))

    )




    DROP TYPE T_T_fund;

    create or replace

    TYPE T_O_fund

    AS OBJECT)

    argument plan_id Varchar2 (128).

    subplan_id Varchar2 (128).

    fund_id Varchar2 (128)

    )

    No final;

    /

    create or replace

    type T_T_FUND

    as the table of T_O_FUND;

    /

    type of projection T_T_CONTRACT;

    create or replace

    TYPE T_O_contract

    AS OBJECT)

    argument plan_id Varchar2 (128).

    SUBPLAN_ID varchar2 (128).

    ov_fund T_o_fund

    )

    no final;

    /

    create or replace

    type T_t_contract as the T_O_contract table;

    /

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

    / * Remove T_T_FUND;

    DROP TYPE T_O_fund;

    type of projection T_T_CONTRACT;

    DROP TYPE T_O_contract; * /

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

    create or replace

    procedure test_cursor (o_c1 OUT sys_refcursor) is

    V_T_T_FUND T_T_FUND;

    v_T_t_contract T_t_contract;

    Start

    WITH (CONTRACTS AS

    SELECT "p1" PLAN_ID, "s1" SUBPLAN_ID FROM DUAL UNION ALL

    SELECT "p2" PLAN_ID, 's2' SUBPLAN_ID FROM DUAL UNION ALL

    SELECT "p3" PLAN_ID, 's3' SUBPLAN_ID FROM DUAL

    ),

    Fund)

    Select "p1" PLAN_ID, SUBPLAN_ID 's1', 'f1' FUND_ID of all the DOUBLE union

    Select "p1" PLAN_ID, SUBPLAN_ID 's1', 'f2' FUND_ID of all the DOUBLE union

    Select plan_id "p1", "s1" subplan_id argument, "f3" fund_id Union double all the

    Select the argument plan_id 'p2', 's2' subplan_id, 'f2' double fund_id

    )

    Select T_O_contract (c.PLAN_ID, c.SUBPLAN_ID, T_o_FUND (f.PLAN_ID, f.SUBPLAN_ID, f.FUND_ID))

    TO COLLECT FEES IN BULK

    in v_T_t_contract

    c CONTRACTS, FUND F

    where C.PLAN_ID = F.PLAN_ID

    and c.SUBPLAN_ID = f.SUBPLAN_ID (+);

    Open the O_C1 for

    SELECT 't' TYP, v_T_t_contract contract_LST

    FROM DUAL;

    end;

    /

    impression o_test

    You can declare the attribute OV_FUND as T_T_FUND data type:

    create or replace type t_o_contract as object (
      plan_id     varchar2(128)
    , subplan_id  varchar2(128)
    , ov_fund     t_t_fund
    );
    /
    

    You will be able to do this:

    with contracts as (
      select 'p1' plan_id, 's1' subplan_id from dual union all
      select 'p2' plan_id, 's2' subplan_id from dual union all
      select 'p3' plan_id, 's3' subplan_id from dual
    ),
    funds as (
      select 'p1' plan_id , 's1' subplan_id, 'f1' fund_id from dual union all
      select 'p1' plan_id , 's1' subplan_id, 'f2' fund_id from dual union all
      select 'p1' plan_id , 's1' subplan_id, 'f3' fund_id from dual union all
      select 'p2' plan_id , 's2' subplan_id, 'f2' fund_id from dual
    )
    select t_o_contract(
             c.plan_id
           , c.subplan_id
           , cast(
               multiset(
                 select t_o_fund(f.plan_id, f.subplan_id, f.fund_id)
                 from funds f
                 where f.plan_id = c.plan_id
                 and f.subplan_id = c.subplan_id
               )
               as t_t_fund
             )
           )
    from contracts c ;
    
  • How to run the type of object...

    HI team,

    Please let me know how to run pl/SQL object type.

    create or replace TYPE  T_PARTY_ID_LIST  AS TABLE OF T_PARTY_ID; 
    create or replace TYPE  T_PARTY_ID AS OBJECT
     (SEQ NUMBER(10,0)
     ,COUNTRY_ID CHAR(2)
     ,ID VARCHAR2(50)
     ,ID_TYPE VARCHAR(3)
     ,DATE_FROM DATE
     ,DATE_TO DATE
     );
    
    create or replace PROCEDURE P_UPDATE_RICA_COUNT_ID
     (A_PARTY_IDS IN T_PARTY_ID_LIST
     ,A_ICAP_ID  IN number
     ) as
    v_id      sa_id_registration_counts.id%TYPE;
    
    --
    BEGIN
        FOR C IN (SELECT X.id_type, X.ID FROM TABLE (CAST(A_party_ids AS T_PARTY_ID_LIST)) X
                 WHERE X.ID_Type IN ('N','P','B')
                 ORDER BY X.ID_Type)
       LOOP
    --
          BEGIN
     --             
             UPDATE sa_id_registration_counts
             SET no_of_registrations = no_of_registrations-1
             WHERE id = V_ID
                   AND id_type = C.ID_Type;
    --
             IF SQL%ROWCOUNT < 1 THEN
                RAISE NO_DATA_FOUND;
             END IF;
    --
          EXCEPTION
             WHEN NO_DATA_FOUND THEN
                BEGIN
    --
                   INSERT
                   INTO sa_id_registration_counts
                      (id ,id_type,exclude_yn,no_of_registrations)
                   SELECT V_ID,C.ID_Type,'N',1 
                   FROM dual;
    --
                EXCEPTION
                   WHEN OTHERS THEN
                      RAISE_APPLICATION_ERROR(-20000,'Error updating RICA ID count ['||SQLERRM||']');
                END;  
          END;
    --
       END LOOP;  
    --
    END;
    --
    

    I'm trying, but receive an error message

    DECLARE
      A_PARTY_IDS SCOTT.T_PARTY_ID_LIST;
      A_ICAP_ID NUMBER :=12323;
    BEGIN
    
    A_PARTY_IDS.extend(1);
      SELECT T_PARTY_ID(1,'1','1','1',null,null) INTO A_PARTY_IDS(1)
       FROM DUAL;
       
      P_UPDATE_RICA_COUNT_ID(
        A_PARTY_IDS => A_PARTY_IDS,
        A_ICAP_ID => A_ICAP_ID );
    
    END;
    Error report -
    ORA-06531: Reference to uninitialized collection
    

    I do not know why you do what you do that is row-by-row (aka slow-by-slow), when you could do all this in a single merge - something like statement:

    create or replace PROCEDURE P_UPDATE_RICA_COUNT_ID
       (A_PARTY_IDS IN T_PARTY_ID_LIST,
        A_ICAP_ID  IN number)
    as
    begin
      merge into sa_id_registration_counts tgt
      using (select x.id_type, x.id, count(*) cnt
             from   table(cast(a_party_ids as t_party_id_list)) x
             where  x.id_type in ('N', 'P', 'B')
             group by x.id_type, x.id) src
         on (tgt.id_type = src.id_type
             and tgt.id = src.id)
      when matched then
        update set no_of_registrations = no_of_registrations - src.cnt
      when not matched then
        insert (tgt.id, tgt.id_type, tgt.exclude_yn, tgt.no_of_registrations)
        values (src.id, src.id_type, 'N', 1);
    end;
    /
    

    You v_id in your procedure, but you never defined anywhere, for as far as I could tell, so I made a few assumptions about the join condition. You will need to change if necessary.

    Meanwhile, for your procedure, you should do something like:

    DECLARE
      A_PARTY_IDS T_PARTY_ID_LIST := t_party_id_list();  -- initialised the collection here
      A_ICAP_ID NUMBER :=12323;
    BEGIN  
    
      A_PARTY_IDS.extend(1);
      A_PARTY_IDS(1) := T_PARTY_ID(1,'1','1','1',null,null); 
    
      P_UPDATE_RICA_COUNT_ID(
          A_PARTY_IDS => A_PARTY_IDS,
          A_ICAP_ID => A_ICAP_ID );
    end;
    /
    

    Another thing - you seem to like selection of the many double - if you're in PL/SQL, then you can just assign variables directly (overall; there are a few exceptions, depending on your version of the database).

  • How to create a type of record and a pl/sql table of this record type in the database

    Hello
    I want to create a record type, and then I want to create a PL/SQL table in the oracle 9i database.
    I did block PL/SQL.
    But when I'm doing it in the database it throws me a few errors.
    Could you please tell me how can I do?

    Concerning

    user576726 wrote:
    Hello
    I want to create a record type, and then I want to create a PL/SQL table in the oracle 9i database.
    I did block PL/SQL.
    But when I'm doing it in the database it throws me a few errors.
    Could you please tell me how can I do?

    Concerning

    RECORD type is only supported in PL/SQL for SQL, you must use the OBJECT type.

  • Casting of object type to aid to more specific

    Hello

    I'm bit stuck in the legacies of the class in my current project. I implement a zero-coupling messaging architecture that uses variant tables to store objects to be cast to sample.

    The good news: it works in general, little we take a peek at some photos

    I tried the script of coulee before using an example that works as expected.

    Shows probe resulting:

    The Message of abstract [14] is cast to the more specific Message for the controller test [15], [9]

    Now, this implementation with the variants table, change things unfrotunately:

    The only thing that apparently changes is, as the class to be cast to a return value of a Subvi (actually reading the table variant) [12].

    As shown in the probe that the casting does not work this time... There is also no error on the terminal error.

    I have to admit, I'm quite confused... especially because in another class this exact methodiolgy works...

    Any thoughts?

    See you soon

    Oli

    Cast throws more specific to the type of object shown on the thread in the IDE, regardless of the type of the actual object passing along this thread (i.e. type of YARN and not DATA type).

    I bet that your wire to the Center terminal of the 'to more specific' is a son of the same type as the object you are trying to change but actually a more specific object.  The 'Cast to more specific"is a compiling decision, not a decision of execution. As such it takes the type of thread, not the object type for the casting.

    Look at the names on the left of your probes, they are all the same in the example below (all wires are nominally of the same type).  It's the onfo LV casting (assuming the names corresponding to the nominal type of the thread) not use content REAL of the wire.

    Shane.

    PS to make things clearer, give each hierarchy in your legacy a different aspect of wire.

  • How to get a number of participants of type cast

    Refer to TCPIP given simple client.vi using examples of Labview. I try to get data digital display after the type cast but cannot connect to the service. I tried to use unbundle, cannot work.

    I typed the string connection hoping to see some digital data in it, but I see something like '@'.

    I expect a server.vi of simple data conversions, how to display numbers in the display of digital data without going through the waveform table?

    Thanks in advance

    You have typecasted your string in an array of double (or single, I can't tell from the picture of the chart), but try to connect to a scalar indicator.  You must either use a table or Index table indicator for one particular item out of the array to send the digital scalar indicator.

    Regarding your '@', I don't know who.  It all depends on what data the other end of your TCP/IP sends communications.  Put some sensors on the channel, as well as the number coming out casting bytes.

  • How to pass the number object type to bind the variable in a select statement

    Hello

    I have a scenario like,

    UI, we store the values in the type of object, and this object type must be spent in a select query to retrieve the data accordingly.

    Is it possible to do so.

    If this isn't the case, please let me know how to take the values of object type and pass to the select query.

    Kind regards

    I found it,

    Object_name ('parameters1', 'parameter2');

  • How to use Type Casting in the JSF Expression Language

    I have a CategoryId attribute in my original Version of type oracle.jbo.domain.Number. I am using the expression of the Boolean element in JSF as #{rank. CategoryId! = 4}
    Here the JSF code:
                          <af:column id="s141NewItem3Col" noWrap="true" width="100"
                                     rowHeader="false">
                            <f:facet name="header">
                              <af:outputLabel value="CAtIDDeq4" showRequired="false"
                                              id="ol18"/>
                            </f:facet>
                            <af:inputText id="s141NewItem3"
                                          value="#{row.CategoryId != 4}"
                                          label="CAtIDDeq4" required="false"
                                          readOnly="#{((pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn']))) or ((!pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn'])))}"></af:inputText>
                          </af:column>
    I get the run-time exception "Cannot convert type oracle.jbo.domain.Number class 4 to class java.lang.Long".

    I wonder how the line. CategoryId is considered to be Long? Please notify. Also, I'll be able to use type cast expressions in the JSF Expression Language?

    Thank you, Pradeep

    Use the attributeValue
    Try * #{row.bindings.CategoryId.attributeValue! = 4} *?

    Check this thread for more details dealing with roughly the same:
    El expression to enable or disable

    Thank you
    Nini

  • JavaScript how to get / change the field (object) TYPE (no access or mandatory)?

    Hello

    I would like to change or at least to get the TYPE of a field/object field

    Reason: I have a function in my script object that needs some things if the given parameter is a text field or button

    {myFunction (Object)}

    If (type is button)...

    ClassName is relative to any use. He always comes = field

    Could someone provide a code please?

    Hello

    This script could help show how to get the type of field.  I'm reasonably show that he originally site of Stefan Cameron, http://forms.stefcameron.com/, but can not find it now.  Basically if you have a 'field' then ui.oneOfChild.className will give you the type of field.

    I don't think you'll have a chance to change the field type.  I think that you need to have all the field types you want on the form and that they are visible when necessary.

    function listAllFields (node)
    {
    If (node.className == 'exclGroup' | node.className == "subform" | node.className == 'subformSet' | node.className == 'region')
    {
    for (var i = 0; i)< node.nodes.length;="">
    {
    If (node.name! = "ErrorIconSubform")
    {
    childNode var = node.nodes.item (i);
    listAllFields (childNode);
    }
    }
    }
    Else if (node.className == "field")
    {
    Switch (node.ui.oneOfChild.className)
    {
    case "button":
    Console.println ("button:" + node.somExpression);
    break;

    case "checkButton":
    If (node.parent.className is "exclGroup")
    Console.println ("RadioButtonList:" + node.somExpression);
    on the other
    Console.println ("checkbox:" + node.somExpression);
    break;

    case "choiceList":
    var oUITypeNode = node.ui.resolveNode ("#choiceList");
    If (oUITypeNode.open is "userControl")
    Console.println ("DropDownList:" + node.somExpression);
    on the other
    Console.println ("ListBox:" + node.somExpression);
    break;
      
    case "dateTimeEdit":
    Console.println ("DateTime:" + node.somExpression);
    break;

    case "imageEdit":
    Console.println ("Image:" + node.somExpression);
    break;

    case "numericEdit":
    Console.println ("digital:" + node.somExpression);
    break;

    case "passwordEdit":
    Console.println ("password:" + node.somExpression);
    break;

    case "textEdit":
    Console.println ("Text:" + node.somExpression);
    break;

    case "signature":
    Console.println ("Signature:" + node.somExpression);
    break;

    case 'barcode ':
    Console.println ("bar code:" + node.somExpression);
    break;

    by default:
    unknown field type
    break;
    }
    }
    }

  • How to fill the value in the nested table by using the object type


    Hi gurus

    I created an object type and able to fill the values in it, now I want to create a nested table type of this object and fill it but looks like I'm doing something wrong, see my code below.

    Code example

    CREATE or REPLACE TYPE countries_o
    AS
    OBJECT
    (
    COUNTRY_ID TANK (2 BYTES),
    COUNTRY_NAME VARCHAR2 (40 BYTE),
    REGION_ID NUMBER);
    /

    create or replace type countries_t is table of the countries_o;

    /

    CREATE OR REPLACE

    ABC of the PROCEDURE

    IS

    v_print countries_t; -: = arr_countries_t('01','Aus',1);

    BEGIN

    v_print: = countries_t('01','A',11);

    DBMS_OUTPUT. Put_line (v_print. COUNTRY_ID | v_print. COUNTRY_NAME | v_print. REGION_ID);

    END;

    /

    Error

    • Error (6.3): PL/SQL: statement ignored
    • Error (6,12): PLS-00306: wrong number or types of arguments in the call to 'COUNTRIES_T '.
    • Error (7.3): PL/SQL: statement ignored
    • Error (7.32): PLS-00302: component 'COUNTRY_ID' must be declared

    Thanks in advance

    Concerning

    Muzz

    Hi user,

    Here is another method that you can try-

    CREATE OR REPLACE

    ABC of the PROCEDURE

    IS

    v_print countries_t: = countries_t (countries_o('01','A',11));

    BEGIN

    DBMS_OUTPUT. Put_line (v_print (1).) COUNTRY_ID | v_print (1). COUNTRY_NAME | v_print (1). REGION_ID); -you're accessinf the first element of the nested table, which in turn points to the object.

    END;

    In the sections of the declaration you have assigned values to the nested table.

    Kind regards
    Maxou

  • How to change the type of object?

    I have an object type, as shown below:

    Here are the object and its type

    create or replace type test_object1 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );

    create or replace type test_type1 is table of the test_object1;


    Now I want to change the type of object. I want to increase the size of val1 to varchar2 (100).

    Any body could help for the alter script.

    Thank you
    Lavan

    >
    SQL > alter type test_object1 change attribute (varchar2 (100)) val1;
    >
    Which won't work OPs example. Your example does not include the second type of object that depends on the first type.

    You cannot change the underlying type unless you use the CASCADe or INVALIDATE option.
    >
    change the type of test_object1 change attribute (val1 varchar2 (100)) waterfall;
    >
    See the CASCADE clause in the link provided by Osame
    >
    CASCADE clause

    Specify the CASCADE clause if you want to propagate the type change to the tables and dependent types. Oracle database abandons the statement if errors are found in the dependent types or tables, unless you also specify the FORCE.

    If you change the property of the type between FINAL and NON-FINAL, you must specify this clause to convert data in the tables and dependent columns. Please refer to [NOT] FINAL.

  • How to convert the column of ROW using DBMS_REDIFINITION object type column

    Hi all
    Suppose I have the following table to convert:
    create table customer as select customer_id cid, cust_first_name name, cust_address street from customers;
    alter table customer modify cid primary key;
    I created the table based on the customers of the OE schema table, while the street column has cust_address_typ with the following attribute object type
    SQL> describe cust_address_typ
     Name                                     Null?     Type
     ----------------------------------------------------- -------- ------------------------------------
     STREET_ADDRESS                               VARCHAR2(40)
     POSTAL_CODE                                   VARCHAR2(10)
     CITY                                        VARCHAR2(30)
     STATE_PROVINCE                               VARCHAR2(10)
     COUNTRY_ID                                   CHAR(2)
    I want to convert the object attribute adresse_rue in a column of RDM. Consider the following temporary table:
    CREATE TABLE INT_CUSTOMER(
    CID NUMBER,
    NAME VARCHAR2(30),
    street varchar2(100)
    );
    First of all, I checked if the table can be redefined:
    --Verify if the table can be redefined
    BEGIN
    DBMS_REDEFINITION.CAN_REDEF_TABLE('OE','CUSTOMER',DBMS_REDEFINITION.CONS_USE_PK);
    END;
     4  /
    
    PL/SQL procedure successfully completed.
    But when I started the redefinition, I got an error:
    BEGIN
    DBMS_REDEFINITION.START_REDEF_TABLE(
    uname => 'OE',
    orig_table => 'CUSTOMER',
    int_table => 'INT_CUSTOMER',
    col_mapping => 'CID CID, NAME NAME, STREET CUST_ADDRESS_TYP(STREET_ADDRESS)'
    );
    END;
      9  /
    BEGIN
    *
    ERROR at line 1:
    ORA-00923: FROM keyword not found where expected
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 52
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 1646
    ORA-06512: at line 2
    What seemed to be the problem?

    Best regards
    Val

    Published by: Valerie good-natured October 9, 2011 21:43

    Have you tried this one:

    BEGIN
    DBMS_REDEFINITION.START_REDEF_TABLE(
    uname => 'OE',
    orig_table => 'CUSTOMER',
    int_table => 'INT_CUSTOMER',
    col_mapping => 'CID CID, NAME NAME,"CUSTOMER".STREET.STREET_ADDRESS STREET'
    );
    END;
    

    Looking at your trace file, I claim that when you use the call above to START_REDEF_TABLE, the inner workings of this procedure will create this SQL statement:

    select CID CID, NAME NAME,"CUSTOMER".STREET.STREET_ADDRESS STREET from "OE"."CUSTOMER" "CUSTOMER"
    

    (You can prove or disprove my claim by tracing it ;-)))

    And this statement has had an alias - even if the alias is the same as the name of the table...

Maybe you are looking for