RENAMECOLLECTIONTABLE - questions by renaming the table from the collection.

Hi all

I use the version of database Oracle 10.2.0.2, OS - Solaris

I am enrolled in the scheme after successfully.

<? XML version = "1.0" encoding = "UTF-8"? >
< xs: schema xmlns: XS = "http://www.w3.org/2001/XMLSchema".
xmlns:xdb = "http://xmlns.oracle.com/xdb".
elementFormDefault = "qualified" attributeFormDefault = "unqualified" >

< xs: element name = "employee" type = "employeeType" xdb:defaultTable = "EMPLOYEEXMLTYPE_TABLE" / >

< name XS: complexType "employeeType" = >
< xs: SEQUENCE >
< xs: element name = "name" type = "xs: String" / >
< xs: element name = "departments" type = "departmentsType" nillable = "true" minOccurs = "0" / >
< xs: element name = "name" type = "xs: String" / >
< / xs: SEQUENCE >
< name XS: attribute = "id" type = "Integer" use = "required" / >
< / xs: complexType >

< name XS: complexType = "departmentsType" >
< xs: SEQUENCE >
< xs: element name = "Department" type = "DepartementType" maxOccurs = "unbounded" / >
< / xs: SEQUENCE >
< / xs: complexType >

< name XS: complexType = "DepartementType" >
< xs: SEQUENCE >
< xs: element name = "name" type = "xs: String" / >
< xs: element name = "departmentWings" type = "departmentWingsType" / >
< / xs: SEQUENCE >
< / xs: complexType >

< name XS: complexType = "departmentWingsType" >
< xs: SEQUENCE >
< xs: element name = "departmentWing" type = "departmentWingType" maxOccurs = "unbounded" / >
< / xs: SEQUENCE >
< / xs: complexType >

< name XS: complexType = "departmentWingType" >
< xs: SEQUENCE >
< xs: element name = "name" type = "xs: String" / >
< xs: element name = "target" type = "xs: String" / >
< / xs: SEQUENCE >
< / xs: complexType >

< / xs: Schema >

My goal is to create indexes on/employee/departments/department/departmentWings/departmentWing/name.

I followed the steps mentioned in Create index for an XMLType column.

One of the measures mentioned in the link above is to rename the table in the collection (in my case departmentwing) using the DBMS_XMLSTORAGE_MANAGE procedure. RENAMECOLLECTIONTABLE.

So I tried the following:
SQL > START
DBMS_XMLSTORAGE_MANAGE 2. () RENAMECOLLECTIONTABLE
OWNER_NAME 3 = > "XDB_TEST"
Table_name 4 = > "EMPLOYEEXMLTYPE_TABLE"
5 COL_NAME = > NULL,
XPATH 6 = > ' / employee/departments/Department/departmentWings/departmentWing/name. "
7 COLLECTION_TABLE_NAME = > 'DEPTWING_TABLE '.
(8);
9 END;
10.

PL/SQL procedure successfully completed.

If the procedure has said that it has completed successfully, I couldn't see the created DEPTWING_TABLE.

SQL > DEPTWING_TABLE DESC;
ERROR:
ORA-04043: object DEPTWING_TABLE does not exist

I am left helpless. Can someone please?

Kind regards
Simo.

Published by: user5805018 on October 12, 2011 04:40

Hello

First of all, are you sure that the nested tables generated during the registration of the scheme?

You must annotate the schema with xdb:storeVarrayAsTable = 'true' and use the option genTables-online true for registration.
Then you should see something like this:

SQL> select table_name, table_type_name, parent_table_name, parent_table_column
  2  from user_nested_tables
  3  ;

TABLE_NAME                     TABLE_TYPE_NAME                PARENT_TABLE_NAME              PARENT_TABLE_COLUMN
------------------------------ ------------------------------ ------------------------------ --------------------------------------------------------------------------------
SYS_NTy8fd9LOzSmun4whyTbJC4g== department384_COLL             EMPLOYEEXMLTYPE_TABLE          "XMLDATA"."departments"."department"
SYS_NTeAiIyOu0Q9G3nvWMtcM6mQ== departmentWing381_COLL         SYS_NTy8fd9LOzSmun4whyTbJC4g== "departmentWings"."departmentWing"
 

In addition, according to the manual (xdb_easeofuse_tools.pdf):

For Oracle Database 11g Release 2 (11.2) and above, this function accepts only, XPath
the rating as a dotted notation. If the XPath notation is used, a setting of namespaces
may also be necessary.

So, on your version, you must use the notation 'dot ':

SQL> call XDB.DBMS_XMLSTORAGE_MANAGE.renameCollectionTable(
  2    USER
  3  , 'EMPLOYEEXMLTYPE_TABLE'
  4  , NULL
  5  , '"XMLDATA"."departments"."department"'
  6  , 'DEPT_TABLE'
  7  );

Method called

SQL> call XDB.DBMS_XMLSTORAGE_MANAGE.renameCollectionTable(
  2    USER
  3  , 'DEPT_TABLE'
  4  , NULL
  5  , '"departmentWings"."departmentWing"'
  6  , 'DEPTWING_TABLE'
  7  );

Method called

SQL> select table_name, table_type_name, parent_table_name, parent_table_column
  2  from user_nested_tables;

TABLE_NAME                     TABLE_TYPE_NAME                PARENT_TABLE_NAME              PARENT_TABLE_COLUMN
------------------------------ ------------------------------ ------------------------------ --------------------------------------------------------------------------------
DEPT_TABLE                     department384_COLL             EMPLOYEEXMLTYPE_TABLE          "XMLDATA"."departments"."department"
DEPTWING_TABLE                 departmentWing381_COLL         DEPT_TABLE                     "departmentWings"."departmentWing"
 

Hope that helps.

Tags: Database

Similar Questions

  • Rename the table with sys 11 g

    Hi all

    Prior to Oracle 11 g and Oracle 10 g (I think) we can rename a table like this:

    (with the user sys):

    alter table SCOTT. Rename ancien_nom NewName;

    I mean the user SYS might rename a table from another schema (for example, SCOTT)

    Now, (oracle 11g) when I try to rename a table with the user SYS to another schema, it shows me:

    SQL> conn sys as sysdba
    Enter password:
    Connected.
    SQL> rename table plantest.PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old;
    rename table plantest.PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old
           *
    ERROR at line 1:
    ORA-00903: invalid table name
    
    
    
    
    SQL> alter table plantest.PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old;
    alter table plantest.PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old
                                          *
    ERROR at line 1:
    ORA-01735: invalid ALTER TABLE option
    
    
    
    
    SQL>
    

    I read the documentation and the only way (as much, I know) rename table is that the user PLANTEST be connected to the database and rename the table. I mean, only the table owner can rename?

    Please, how can I rename ANY table of my database with the user SYS or SYSTEM?

    Thank you

    chijar,

    Please user query,

    Use the ALTER TABLE RENAME command:
    
     SQL> ALTER TABLE . RENAME TO ; 
    

    This is the keyword to rename mising is why you receive error below.

    1. SQL > alter table plantest. PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old;
    2. ALTER table plantest. PEMVX_AFEPRE_ESP to PEMVX_AFEPRE_ESP_old
    3. *
    4. ERROR on line 1:
    5. ORA-01735: invalid option of ALTER TABLE
    6. SQL >

    Naming conventions:
    -------------------

    1 names must be between 1 and 30 characters long.
    2. the names must begin with a letter.
    3. it must contain only A - Z, a - z, 0-9, _, $, and the #. You are strongly
    not recommended to use $ and #.
    4. the names are not case sensitive, unless they are created by double-quotes.

  • How to design the table from the answer to the question table.

    Hi all

    I am creating an application for student review online.

    There are two types of questions, the only choice of response and multi choice answers.

    My question is less than
    create table question_master
    (
    exam_id number references exam_master(exam_id),
    marks_of_each_question number,
    type_of_question char(1),-- single choice answer/multiple choices answer
    q1 varchar2(2000),
    q2 varchar2(2000),
    q3 varchar2(2000),
    q4 varchar2(2000))
    my table to answer (I'm not satisfied with who is below
    create table answers_of_questions
    (
    answer_id number primary key,
    question_ID number referenes question_master(question_id),
    answer varchar2(4000) not null,
    is_answer_correct char(1),--y/n,
    student_selection char(1),--y/n   student select it or not
    ....
    ...
    now, I'm perfectly how to create the RESPONSE table to contain the answers.
    the only choice is good, but several checkboxes choices, what to do?
    How to design the table from the answer?

    do I have to create 2 tables to contain the answers?
    Note: the QUESTIONS and ANSWERS, all will be entered by the teacher. students will make a choice and I will store this choice in another table
    may be called STUDENT_SELECTED_ANSWERS or something like that.
    If anyone has some reference to the script retail scheme review online, kindly share with me.

    Kind regards.

    Kind regards.

    If you need to have answers in another table:

    Student (student_id, name, etc...)
    Review (exam_id, exam_name, etc...)
    Question (question_id, exam_id, question_text)

    Response (question_id, a_text, b_text, c_text, d_text, a, b, c, d).<-- one-to-one="" with="" question="" table,="" a-d="" flags="" used="" to="" indicate="">
    OR
    Response (question_id, answer_id, answer_text, OK)<-- many-to-one="" with="" question="" table,="" correct="" flag="" used="" to="" indicate="" correctness="" for="" this="" single="">

    Student_Answer (student_id, question_id, a, b, c and d)
    OR
    Student_Answer (question_id, student_id, answer_id)<-- creation="" of="" a="" question_id+answer_id="" in="" this="" table="" implies="" the="" student="" checked/selected="" it="" as="" an="">

    To what extent you want to standardize, it is up to you.

  • Rename the table

    How to rename the table using export and import utility?


    Thanks 10

    883532 wrote:
    How to rename the table using export and import utility?

    Thanks 10

    What is the version?

    It is not possible to rename the table using import and export, why not use SQL in 9i? its very simple
    SQL > create table emp_new in select * from emp;

    If his 10g.then above

    System $expdp / * tables = scott.emp dumpfile = emp.dmp = directory = data_pump_dir emp.log logfile
    System $impdp / * dumpfile = emp.dmp logfile = emp_imp.log remap_table = rΘpertoire emp:emp_new = data_pump_dir

    HTH.

    883532 profile
    883532
    Newbie
         
    Handle: 883532
    Status level: Beginner
    Registration date: Sep 6, 2011
    Messages total: 28
    Total Questions: 18 (12 pending)

    Keep the forum clean as much as possible by markers as replied.

    Published by: CKPT on February 20, 2012 22:00

  • questions of x 2 in 1: rename the buttons in the skin of arktic / indented form

    Hi all

    2 simple questions.  Take a look at the form below (pic).  I want to rename the "Refresh button" "Send the request" - but rename the button seems to affect the coding.  I played but am now frustrated.

    Here's the script for this part of the form:

    conditional else region1
    } else {? >}
    < input type = "submit" name = "KT_Update1" value = "<?" PHP echo NXT_getResource ("Update_FB");? ">" / >
    <? PHP}
    endif conditional region1
    ? >
    < input type = "button" name = "KT_Cancel1" value = "<?" PHP echo NXT_getResource ("Cancel_FB");? ">" onclick = "return UNI_navigateCancel (event, '... / includes/nxt/back.php')" / > "
    < / div >
    < / div >
    < / make >

    2nd question.  I want to dash the form, - have it's about 30 pixels from the left side of the screen.  Whenever I have created dynamic lists and forms, they are still stuck in the left side of the page, and I would like to find a way around it.  I tried to use the removal of text and tried to burst an additional column in French - but nothing works so far.

    So, we are people, 2 fairly easy questions so I thought I have them would contain a quick message.

    screenshot.jpg

    You tried to change

    conditional else region1
    } else {? >}
                    " />
                   
    endif conditional region1
    ?>

    for this

    conditional else region1
    } else {? >}
                   
                   
    endif conditional region1
    ?>

    Form 'dash' simple solution would be to wrap the form in a container and use css to set the padding or the margin of the form.

    Like this:

    Form HERE

  • Easy question: router WRT54G: how to rename the user and give a new password?

    Not very computer, but following the recommendations in the FAQ, I have reset my WRT54G router to the default settings by hitting the reset buttong and entering into the Web site. I got a new computer and I forgot the old password. After reset to defaults now the link is not secure. How can I go about renaming the user and giving it a new password of my own - it was a while that I have configured the router, and I don't have the CD. Any help that you can offer or the direction you can piont me is appreciated.

    Try to proceed as following:

    Open an Internet Explorer browser on your computer (desktop) wired page. In the address bar type - 192.168.1.1 and press ENTER... Let the empty user name & password use admin lowercase...

    For wireless settings, follow these steps: -.
    Click on the Wireless tab
    -Wireless network mode must be mixed...
    -Provide a unique name in the name box of the wireless network (SSID) in order to differentiate your network from your network of neighbors...
    -Set the channel 11-2 wireless, 462 GHz... Wireless SSID broadcast should be enabled and then click on save settings...
    Please take note of the name of the wireless network (SSID) because it's the network identifier...

    For wireless security: -.
    Click the sub-tab under wireless > Wireless Security...
    Change the mode of WEP wireless security, encryption must be 64-bit. Let the empty password, do not type in anything... Under type of WEP Key 1 in all 10 numbers please (numbers only and no mailbox for example: your 10-digit phone number) and click on save settings...
    Please note the 1 WEP key as it comes to the security key for the wireless network...

    Click the settings advanced wireless
    Change the interval of tag to 75 > change the Fragmentation threshold to 2304, change the RTS threshold to 2304 > click 'save settings '...
    Now let's see if you can locate your wireless network and try to connect...

  • Droping a table from within a procedure by passing the name of the Table as an Argument

    HII All

    I want to remove a table from a procedure dynamically passing the table name as a parameter of a procedure manual

    to do this, I wrote the following procedure

    CREATE OR REPLACE PROCEDURE DEL_TAB (TAB_NAME IN VARCHAR2) AS

    V_TAB_NAME VARCHAR2 (10);

    V_STMT VARCHAR2 (50);

    BEGIN

    V_TAB_NAME: = TABLE_NAME;

    V_STMT: = 'DROP TABLE' | V_TAB_NAME;

    RUN IMMEDIATELY 'V_STMT ';

    DBMS_OUTPUT. PUT_LINE(V_TAB_NAME||) e TABLE DELETED ');

    END DEL_TAB;

    but whenever I'm execute it gives me an error

    ERROR on line 1:

    ORA-06550: line 1, column 15:

    PLS-00357: Table, view or sequence of reference 'A' not allowed in this context

    ORA-06550: line 1, column 7:

    PL/SQL: Statement ignored

    Please tell me the solution...

    Thanks in advance

    Alisson

    Why do you want to implement this procedure? If you want to remove a table just issue the DROP of stand-alone statement. Why write a procedure for this? Also you must understand the difference between REMOVE and DROP in the context of RDBMS. You either use them which is incorrect. DELETION is to remove rows from a table and DROP is to remove the database table.

    And with regard to your problem

    > RUN IMMEDIATELY 'V_STMT ';

    This should be

    immediately run v_stmt;

    You closed the V_STMT variable is in single quotes. You must remove the apostrophes.

  • Recently, when I download files from the SD card, LR6 not rename the files. How can I fix it?

    Recently, when I download files from the SD card, LR6 not rename the files. How can I fix it?

    If I open the folder, not through Lr, I can rename the file. Now, the problem disappeared. Maybe it was related to the DD. I removed and put back in place the protections in SD via the menu of my camera and the problem disappeared. Now, he works as usual. Amount and rename the files by LR. Thank you for your interest

  • The lateset, 2015.5 edition, does not transfer data from the metadata, only the focal length objective. Disappointment when you want to know what that lens you used. (It allows to rename the files but after you create a second copy. "It's an improvement.)

    The last edition, 2015.5, does not transfer data from the metadata, only the focal length objective. Disappointment when you want to know what that lens you used. (It allows to rename the files but after you create a second copy. "It's an improvement.)

    Yes, copied files from Nikon NEF, DNG.

  • Hi, I have a question, I m interested in buying cc for oligo, but I didn't how will look at payment collected monthly from my account. I m from Poland, is if there is any conversion related to the collection to the monthly fee? Exceeds one

    Hi, I have a question, I m interested in buying cc for oligo, but I didn't how will look at payment collected monthly from my account. I m from Poland, is if there is any conversion related to the collection to the monthly fee? Is beyond the $ 19.99 euros will be ordered to pay the money transfer from zlotys to the euro.

    Hello

    In order to know the payment process, you can contact Adobe support:

    https://helpx.Adobe.com/contact.html?step=CCSN

    To know the offers and different plans, you can visit the Adobe Web site:

    Pricing plans and creative Cloud membership | Adobe Creative Cloud

    Let us know if you need more information.

  • How rename you photos from an SD camera card using the latest update?

    The Lightroom help page says that you cannot rename photos downloaded from a camera memory card.  It has been easy.  Now is it impossible?  How do rename you the pictures you want to download from SD or CF card?

    Please see:How to specify the options import in Lightroom

    Kind regards

    Mohit

  • In Photoshop, how can I change the background (Mount table) from black to white. I must have hit something because it changed suddenly mid-project and I cannot find anywhere in preferences to solve this problem.

    In Photoshop, how can I change the background (Mount table) from black to white. I must have hit something because it changed suddenly mid-project and I cannot find anywhere in preferences to solve this problem.

    Right-click on the pasteboard, and you should have a choice of colours from timeline menu.

    I would add that you should have a file to open it or it won't work.

    Gene

  • How to rename the table or synonym?

    Hi all

    11.2.0.1

    I want to rename the table or synonym owned by HR as a SYS user.

    SQL > rename hr.emp in hr.emp_old;

    *

    ERROR on line 1:

    ORA-01765: specifying the name of the owner of the table is not allowed

    Thank you very much

    zxy

    Hello

    You can do something like that as a user of the SYSTEM:

    1 alter session set current_schema = "HR".

    2. Rename emp emp_old

    Thank you &

    Best regards

  • How to import the selected tables from MySQL to Oracle

    Hello world:

    How can I import tables from MySQL to Oracle? I have more than 180 tables in my DB (MySQL), but I copy only 12 of them to ORACLE... rigth now I do it manually, using SQL Developer (rigth clicking on the picture icon and copy to Oracle) but now I need to do this automatically every 4 hours...

    I read on the dblink option, but I don't know if this is the best for this case...

    I appreciate all help.

    Best regards
    Jack

    Hi Jack,

    I think that with a db-link you can define an automated task (PL/SQL + programmer).
    We use a db-link to Oracle's RDBMS to MySQL. So we have no experience.
    We have created the db-link like http://www.pythian.com/news/1554/how-to-access-mysql-from-oracle-with-odbc-and-sql/

    Heike cordially

  • Additional code added when you paste the table from Word in Dreamweaver

    Hello world

    I stuck in a table from Word in Dreamweaver and even if all the table code was written, Dreamweaver put < p > tags around all the content of the data cell and he also added valign = "top".

    Is it possible to get just Dreamweaver to create the base table code and do not add any extra markup?

    Appreciate any advice.

    I just tested this and had the same results, regardless of the option I used when using 'paste special '.

    Outside the coding table yourself and adding data, it didn't there has anything you can do on the entry formatting of MS Word.

    If you insert the code in the table in a new document, maybe run a search and replace to remove the valign = top of all cells.  Regarding the

    Tags, you could do the same, find and replace each of the tags separately (but this should be done in a new document that has this particular table), otherwise I don't worry too much about those, maybe just set padding and margin on the

    elements to 0 or all that is appropriate, within this particular table.

    Once you have the code as you like, then copy and paste into your web page document.

    Just an idea anyway

Maybe you are looking for