Alter Table problem
Hi there. I'm new in Oracle environments. I've a problem with this procedure with the alter table statement.
CREATE OR REPLACE PROCEDURE HR.PROC_ETL_TAB IS
CURSOR cursor_ETL IS
SELECT * FROM ETL_TAB_REF WHERE AVAILABLE_FLAG = 1;
record_etl ETL_TAB_REF%ROWTYPE;
VAR_ALTER VARCHAR2(100);
BEGIN
OPEN cursor_ETL;
LOOP
FETCH cursor_ETL INTO record_etl;
EXIT WHEN cursor_ETL%NOTFOUND;
VAR_ALTER:='ALTER TABLE '||record_etl.EXT_TABLE_NAME||' LOCATION('''||record_etl.FILE_NAME||''')';
DBMS_OUTPUT.PUT_LINE(VAR_ALTER);
EXECUTE IMMEDIATE VAR_ALTER;
END LOOP;
CLOSE cursor_ETL;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END PROC_ETL_TAB;
When I try to call the procedure (call proc_etl_tab()) this error occurs: ORA-01735: invalid ALTER TABLE option. Can anyone help me please? Thanks.
Pl post details of OS and database versions, along with a sample of what this command would look like when the variables are evaluated
VAR_ALTER:='ALTER TABLE '||record_etl.EXT_TABLE_NAME||' LOCATION('''||record_etl.FILE_NAME||''')';
I do not believe ALTER TABLE ... LOCATION ... is a valid command.
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_3001.htm
HTH
Srini
Similar Messages
-
I'm using oracle9i on windows 2000/NT.
All the DDL Commands(alter table,drop table etc..) result in hanging of the session.
On restarting the oracle instance the command starts working. But only for sometime. We reinstalled oracle for 2-3 time and on different servers. But the problem persists. What could be reason/solution for this.No, you cannot avoid the recompiles. An ALTER TABLE changes the structure of the table and all dependent objects have to be recompiled -- the dependent objects
are set to status INVALID. The RDBMS does do an implicit
compile when an INVALID View/Package/Procedure is invoked but, occassionally, with a long list of dependencies and cross-dependencies, it may fail to compile an object.
Use DBA_DEPENDENCIES to identify dependencies.
Hemant -
PLEASE HELP! URGENT Alter table problem !
I have 3 tables:
EVALUATION (No_expert, No_article)
EXPERT (No_expert, origine, name)
AUTHOR_ARTICLE (No_Article, Code_author)
AUTHOR (Code_author, Name, Original)
and my question is: How can i make a check to refuse each time an EXPERT ADDED to the EVALUATION table. If this one is an AUTHOR, in other words, the EVALUATION.No_expert must <> than AUTHOR.Code_author.
This is what i did but it doesn't work:
ALTER TABLE EVALUATION ADD CONSTRAINT No_expert
CHECK (EVALUATION.No_expert <> AUTHOR_ARTICLE.Code_author);
thank a lot
luong.I do not think you can refer to table name and column names of other tables in defining a check constraints. Look into using a 'before insert' trigger here.
-
Problem with alter table in execute immediate
We have PL/SQL scripts which modify the data structure, add data etc to en existing database. These scripts basically ensure that the db is compatible with what the software expects.
The reason for doing it in PL/SQL rather than SQL script is A) The scripts are launched using GUI so that they are more user friendly. sqlplus is launched as a background process which executes these scripts. All the scripts have EXIT FAILURE WHENEVER SQLERROR as first line to ensure that the control does not hang in the sqlplus background process.
Going from one version to other, we have added a few tables to the database and also modified a few tables. since (i think) DDL is not allowed in PL/SQL block, we had to resort to putting them in EXECUTE IMMEDIATE enclosures.
Now for the real question,
If I create a table using EXECUTE IMMEDIATE clause, I can immediately have insert as a next statement to insert data in this table. but, if I alter the table and add a column to the existing table, I cannot immediately add data to that column, it throws an error saying 'invalid identifier'
At code level, the following is allowed :
EXECUTE IMMEDIATE 'CREATE TABLE SP_TEST_TABLE
ID NUMBER,
NAME Varchar2(40)
INSERT INTO SP_TEST_TABLE(ID, NAME) Values(1, 'SP');
but I get error for the following :
EXECUTE IMMEDIATE 'ALTER TABLE SP_TEST_TWO ADD
ANOTHER_COLUMN number
UPDATE SP_TEST_TWO SET ANOTHER_COLUMN = 1;
In this case, it says ANOTHER_COLUMN invalid identifier
Does anybody know why?
any workaround will be greatly appreciated.
--SPFriends,
Thanks to all of you for your help. The spelling mistakes might have occurred becuase i changed the actual script to something 'short and complete' to show the problem.
I could solve the problem by having more than one PL/SQL block within my file. something like :
BEGIN
--alter table statements here
END;
BEGIN
--insert the values in column here.
END;
I am still not sure why the error is presented only on alter table statement and not for create table statement. Probably somebody with the knowledge of oracle internals will be able to throw more light on it. I am trying to get the naswers, if I get the answer, I'll surely post it here.
Regards,
--Saurabh -
How to alter table in sql server2008
Hi Friends, I have import one table and want to alter table. How do i do this
Hi ,
YOu need Alter Command for the same. but you have to specify what you want to Alter.
For Reference
To add a column in a table, use the following syntax:
ALTER TABLE table_name
ADD column_name datatype
To delete a column in a table, use the following syntax (notice that some database systems don't allow deleting a column):
ALTER TABLE table_name
DROP COLUMN column_name
To change the data type of a column in a table, use the following syntax:
ALTER TABLE table_name
ALTER COLUMN column_name datatype
http://www.techonthenet.com/sql/tables/alter_table.php
http://www.tutorialspoint.com/sql/sql-alter-command.htm
Thanks
Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. -
How to change default value in a table using ALTER TABLE
Hi,
How to change default value in a table
I have a table TEST which has 2 fields CODE of Datatype VARCHAR2(10) and Indicator as VARCHAR2(1).
I want to change the default value using ALTER TABLE TEST of field Indicator to 'I'.
Any help will be needful for me
Thanks and Regardsuser598986 wrote:
Hi,
How to change default value in a table
I have a table TEST which has 2 fields CODE of Datatype VARCHAR2(10) and Indicator as VARCHAR2(1).
I want to change the default value using ALTER TABLE TEST of field Indicator to 'I'.
ALTER TABLE test
MODIFY (indicator DEFAULT 'I');
Incidentally, INDICATOR is a keyword in Oracle, so you may have problems using it as a column name. If so, you'll have to enclose the column name in double-quotes, and be careful to use capital letters inside the quotes.
Edited by: Frank Kulash on Aug 26, 2009 11:42 AM -
Deadlocks with ALTER TABLE DISABLE CONSTRAINT
Hello,
We're deleting millions of redundant rows from a particular table in our live 10g database. This is being done online because the downtime would be unacceptable. The table in question has 30 child tables, so for speed I am disabling the foreign keys using ALTER TABLE DISABLE CONSTRAINT before the deletion (we haven't had any constraint violations for ages). Without this, deletion takes about 1 second per row i.e. a very long time.
However, we're finding that ALTER TABLE DISABLE CONSTRAINT often reports ORA-00060: deadlock detected. This is causing problems with the live system. Can anyone think of the reason why a deadlock might occur in this situation and what we could do to prevent it happening? Note that any solution has to be doable without downtime unless it takes less than 30 minutes.
Thanks a lot
Ed
Edited by: edwiles on Feb 4, 2009 6:02 AMlook suggestions in the similar thread:
Re: Deadlock when deleting a not linked data record in a parent table -
Insert data into the xml schema-based xmltype table problem!
Hello, there,
I got problem in inserting data into the xmltype table after registered XML schema and created table. details see below:
1) xml schema:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2007 sp2 (http://www.altova.com) by Constantin Ilea (EMERGIS INC) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.emergis.com/eHealth/EHIP/data/meta/profile:v1" targetNamespace="http://www.emergis.com/eHealth/EHIP/data/meta/profile:v1" elementFormDefault="qualified">
<!-- ************** PART I: BEGIN SIMPLE OBJECT TYPE DEFINITIONS ********************************** -->
<xs:simpleType name="RoutingType">
<xs:restriction base="xs:string">
<xs:enumeration value="Synch"/>
<xs:enumeration value="Asynch"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="StatusType">
<xs:restriction base="xs:string">
<xs:enumeration value="ACTIVE"/>
<xs:enumeration value="VOID"/>
<xs:enumeration value="PENDING"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SenderApplicationType">
<xs:restriction base="xs:string">
<xs:enumeration value="PR"/>
<xs:enumeration value="CR"/>
<xs:enumeration value="POS"/>
<xs:enumeration value="CPP"/>
<xs:enumeration value="Other"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ServiceTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="IS"/>
<xs:enumeration value="WS"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="RouteDirect">
<xs:restriction base="xs:string">
<xs:enumeration value="Request"/>
<xs:enumeration value="Reply"/>
<xs:enumeration value="None"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Indicator">
<xs:annotation>
<xs:documentation>can we also change the value to "ON" and "OFF" instead? in this way this cn be shared by all type of switch indicator</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="YES"/>
<xs:enumeration value="NO"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="RuleType">
<xs:restriction base="xs:string">
<xs:enumeration value="ControlAct"/>
<xs:enumeration value="WSPolicy"/>
<xs:enumeration value="AccessControl"/>
<xs:enumeration value="Certification"/>
<xs:enumeration value="MessageConformance"/>
<xs:enumeration value="Variant"/>
<xs:enumeration value="Routing"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="HL7Result">
<xs:restriction base="xs:string">
<xs:enumeration value="ACCEPT"/>
<xs:enumeration value="REFUSE"/>
<xs:enumeration value="REJECT"/>
<xs:enumeration value="ACK"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="IIPType">
<xs:restriction base="xs:string">
<xs:enumeration value="PUT"/>
<xs:enumeration value="GET/LIST"/>
<xs:enumeration value="NOTIF"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ProfileTypeType">
<xs:restriction base="xs:string">
<xs:enumeration value="IIPProfile"/>
<xs:enumeration value="BizOperationProfile"/>
<xs:enumeration value="OrchestrationProfile"/>
<xs:enumeration value="DomainObjectProfile"/>
<xs:enumeration value="ServiceProfile"/>
<xs:enumeration value="ExceptionProfile"/>
<xs:enumeration value="CustomizedProfile"/>
<xs:enumeration value="SystemProfile"/>
<xs:enumeration value="HL7XMLSchemaProfile"/>
<xs:enumeration value="EnricherParametersProfile"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ParameterType">
<xs:restriction base="xs:string">
<xs:enumeration value="String"/>
<xs:enumeration value="Object"/>
<xs:enumeration value="Number"/>
<xs:enumeration value="Document"/>
</xs:restriction>
</xs:simpleType>
<!-- ************** PART I: END SIMPLE OBJECT TYPE DEFINITIONS ********************************** -->
<!-- ************** PART II: BEGIN COMPLEX OBJECT TYPE DEFINITIONS ********************************** -->
<!-- *********************** begin new added objects, by rshan *************************************** -->
<xs:complexType name="ProfileType">
<xs:annotation>
<xs:documentation>
1.Profile IS USED TO BE AN WRAPPER ELEMENT FOR ALL KIND OF PROFILES NO MATTER WHAT KIND OF PROFILE IT IS
2.ProfileID used to uniquely identify the current profile
3.ProfileData used to hold all the necessary profile related data
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="ProfileID" type="ProfileIDType">
<xs:annotation>
<xs:documentation>this will hold all the common attributes, espically the global unique identifier to the profile, no matter what type of profile is</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ProfileData" type="ProfileDataType">
<xs:annotation>
<xs:documentation>all the non-common profile meta data that attached to each specific profile type such as IIPProfile, OrchestrationProfile, and BizOperationProfile will be placed here</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProfileIDType">
<xs:annotation>
<xs:documentation>global unique identifier and all the common attributes across all different profiles, the @ID and @Type together will be used as the primary key to identify the profile data</xs:documentation>
</xs:annotation>
<xs:attribute name="ID" type="xs:ID" use="required">
<xs:annotation>
<xs:documentation>ID is the global unique identifier to the profile, no matter what type of profile it is</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Name"/>
<xs:attribute name="Description"/>
<xs:attribute name="Version">
<xs:annotation>
<xs:documentation>version of the profile data</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Type" type="ProfileTypeType" use="required">
<xs:annotation>
<xs:documentation>value to identify the ProfileType type within
IIPProfile,BizOperationProfile,OrchestrationProfile,DomainObjectProfile
ServiceProfile,ExceptionProfile,SystemProfile,HL7XMLSchemaProfile,
EnricherParametersProfile,CustomizedProfile
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Status" type="StatusType" default="ACTIVE">
<xs:annotation>
<xs:documentation>used to show the related profile data status like "ACTIVE","PENDING","VOID"...</xs:documentation>
</xs:annotation>
</xs:attribute>
<!--
<xs:sequence>
<xs:element name="ProfileReference" type="ProfileIDType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>this will be the place to hold the integrity relationship with other profiles like foreign key if existed and necessary to show up</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
-->
</xs:complexType>
<xs:complexType name="ProfileDataType">
<xs:annotation>
<xs:documentation>meta data associated tightly to each specific type of profile</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element name="EnricherParametersProfileData" type="EnricherParametersDataType">
<xs:annotation>
<xs:documentation>Enricher Parameters related profile data
1. one instance of this type may contains all the related System metadata.
2. idType part may use to identify different version/release/status
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ExtendProfileData" type="ExtendProfileDataType">
<xs:annotation>
<xs:documentation>If needed, any profile data not defined within the current release scope can be added here </xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:complexType name="ExtendProfileDataType">
<xs:sequence>
<xs:element name="ExtendProfile" type="xs:anyType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EnricherParametersDataType">
<xs:sequence>
<xs:element name="EnricherParameter" type="EnricherParameter" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EnricherParameter">
<xs:sequence>
<xs:element ref="Enricher"/>
</xs:sequence>
<xs:attribute name="serviceName" type="xs:string" use="required"/>
<xs:attribute name="interactionID" type="xs:string"/>
</xs:complexType>
<xs:element name="Enricher">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Parameters" type="Parameters"/>
<xs:element ref="Section" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="ValueType">
<xs:attribute name="field" use="required"/>
<xs:attribute name="value"/>
<xs:attribute name="action"/>
</xs:complexType>
<xs:element name="Section">
<xs:complexType>
<xs:sequence>
<xs:element name="Value" type="ValueType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="Section" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="path" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="Parameters">
<xs:sequence>
<xs:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" use="required"/>
<xs:attribute name="reference"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RuleList">
<xs:annotation>
<xs:documentation>an array of rules</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Rule" type="RuleProfile" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RuleProfile">
<xs:attribute name="RName" use="required"/>
<xs:attribute name="RType" type="RuleType" use="required"/>
<xs:attribute name="Status" default="ON">
<xs:annotation>
<xs:documentation>By default is ON (or if is missing)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Order"/>
<xs:attribute name="Direction" type="RouteDirect">
<xs:annotation>
<xs:documentation>Request / Reply</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- ************** PART II: END COMPLEX OBJECT TYPE DEFINITIONS *********************************** -->
<!-- ************** PART III: BEGIN ROOT ELEMENTS DEFINITIONS ********************************* -->
<!-- 0) Profile wrapper root element
Profile IS USED TO BE AN WRAPPER ELEMENT FOR ALL KIND OF PROFILES NO MATTER WHAT KIND OF PROFILE IT IS
-->
<xs:element name="Profile" type="ProfileType">
<xs:annotation>
<xs:documentation>Profile IS USED TO BE AN WRAPPER ELEMENT FOR ALL KIND OF PROFILES NO MATTER WHAT KIND OF PROFILE IT IS</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
2)register xml schema:
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 schemaurl=>'http://rac3-1-vip:8080/home/'||USER||'/xsd/EHIPProfile_v00.xsd',
5 schemadoc=>xdbURIType('/home/'||USER||'/xsd/EHIPProfile_v00.xsd').getClob(),
6 local=>True,
7 gentypes=>True,
8 genbean=>False,
9 gentables=>False
10 );
11 End;
12 /
PL/SQL procedure successfully completed.
SQL>
SQL>
3) xml data:
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
<Profile xmlns="http://www.emergis.com/eHealth/EHIP/data/meta/profile:v1">
<ProfileID Type="EnricherParametersProfile" Status="ACTIVE" ID="EnricherPP.ID.0001" Name="EnricherPP.ID.0001" Description="EnricherPP.ID.0001" Version="01"/>
<ProfileData>
<EnricherParametersProfileData>
<EnricherParameter serviceName="LRS_BusinessDomainObject.lrs.businessDomainObject.domainObjectBuilder.concrete.ExceptionCreators:createExceptionV50CategoryCanonicalPart" interactionID="">
<Enricher>
<Parameters>
<Parameter name="MESSAGE_ID" reference="test"/>
</Parameters>
<Section path="HEADER">
<Section path="RESPONSE_TYPE">
<Value field="value" value="I"/>
</Section>
<Section path="HL7_STANDARD_VERSION">
<Value field="value" value="HL7V3"/>
</Section>
<Section path="DESIRED_ACKNOWLEDGMENT_TYPE">
<Value field="value" value="NE"/>
</Section>
<Section path="SENDING_NETWORK_ADDRESS">
<Value field="value" value=""/>
</Section>
<Section path="SENDING_APPLICATION_IDENTIFIER">
<Value field="root" value="2.16.840.1.113883.3.133.1.3"/>
<Value field="extension" value=""/>
</Section>
<Section path="SENDING_APPLICATION_NAME">
<Value field="value" value="NL HIAL"/>
</Section>
</Section>
</Enricher>
</EnricherParameter>
<EnricherParameter serviceName="LRS_BusinessDomainObject.lrs.businessDomainObject.domainObjectBuilder.concrete.DomainObjectCreators:createFindClientsAssociatedIdentifersRequestObject" interactionID="PRPA_IN101105CA">
<Enricher>
<Parameters>
<Parameter name="MESSAGE_ID" reference="test"/>
</Parameters>
<Section path="HEADER">
<Section path="RESPONSE_TYPE">
<Value field="value" value="I"/>
</Section>
<Section path="HL7_STANDARD_VERSION">
<Value field="value" value="HL7V3"/>
</Section>
<Section path="PROCESSING_CODE">
<Value field="value" value="T"/>
</Section>
<!--
<Section path="PROCESSING_MODE_CODE">
<Value field="value" value="T"/>
</Section>
-->
<Section path="DESIRED_ACKNOWLEDGMENT_TYPE">
<Value field="value" value="NE"/>
</Section>
<Section path="RECEIVER_NETWORK_ADDRESS">
<Value field="value" value="prsunew.moh.hnet.bc.ca"/>
</Section>
<Section path="RECEIVER_APPLICATION_IDENTIFIER">
<Value field="root" value="2.16.840.1.113883.3.40.5.1"/>
<Value field="extension" value=""/>
</Section>
<Section path="SENDING_NETWORK_ADDRESS">
<Value field="value" value=""/>
</Section>
<Section path="SENDING_APPLICATION_IDENTIFIER">
<Value field="root" value="2.16.840.1.113883.3.133.1.3"/>
<Value field="extension" value=""/>
</Section>
<Section path="SENDING_APPLICATION_NAME">
<Value field="value" value="NL HIAL"/>
</Section>
</Section>
</Enricher>
</EnricherParameter>
<EnricherParameter serviceName="LRS_BusinessDomainObject.lrs.businessDomainObject.domainObjectBuilder.concrete.DomainObjectContentEnrichers:enrichPRRequest" interactionID="">
<!--Sample XML file generated by XMLSpy v2007 sp2 (http://www.altova.com)-->
<Enricher>
<Parameters>
<Parameter name="MESSAGE_IDENTIFIER" reference="test"/>
</Parameters>
<Section path="HEADER">
<Section path="HL7_STANDARD_VERSION">
<Value field="value" value="V3PR2"/>
</Section>
<!--POS/CPP populated ?-->
<!--Not sure if this should be set as a variance within EHIP or if we expect the POS/CPP to provide this value-->
<Section path="PROCESSING_CODE">
<Value field="value" value="T"/>
</Section>
<!--POS/CPP populated ?-->
<Section path="PROCESSING_MODE_CODE">
<Value field="value" value="T"/>
</Section>
<!--POS/CPP populated ?-->
<Section path="DESIRED_ACKNOWLEDGMENT_TYPE">
<Value field="value" value="NE"/>
</Section>
<!-- note:We Expect PRS to give us a web service address -->
<!--<Section path="RECEIVER_NETWORK_ADDRESS">
<Value field="value" value="_http://PRSServer/svcName"/>
</Section>
-->
<Section path="RECEIVER_APPLICATION_IDENTIFIER[0]">
<Value field="root" value="2.16.840.1.113883.3.40.1.14"/>
<Value field="extension" value="SIT1"/>
</Section>
<!-- note: values of the fields to be provided by PRS -->
<Section path="RECEIVER_APPLICATION_NAME[0]">
<Value field="value" value="receiverAppName"/>
</Section>
<!-- note: RECEIVER_ORGANIZATION has an extra trailing space, as in the Excel mapping spreadsheet -->
<!-- note: values of the fields to be specified by PRS later -->
<Section path="RECEIVER_AGENT/RECEIVER_ORGANIZATION/RECEIVER_ORGANIZATION_IDENTIFIER[0]">
<Value field="root" value="2.16.840.1.113883.3.40.4.1"/>
<Value field="extension" value="receiverOrgId"/>
</Section>
<Section path="SENDING_APPLICATION_NAME[0]">
<Value field="value" value="NLPRSCLNT"/>
</Section>
<!-- note: SENDING_ORGANIZATION has an extra trailing space, as in the Excel mapping spreadsheet -->
<!-- note: values of the fields to be specified by PRS later -->
<Section path="SENDING_AGENT/SENDING_ORGANIZATION/SENDING_ORGANIZATION_IDENTIFIER[0]">
<Value field="root" value="2.16.840.1.113883.4.3.57"/>
<Value field="extension" value="3001"/>
</Section>
<Section path="PERFORMER/HEALTHCARE_WORKER_IDENTIFIER[0]">
<Value field="root" value="2.16.840.1.113883.4.3.57"/>
<Value field="extension" value="HIAL_USR"/>
</Section>
</Section>
<Section path="PAYLOAD">
<!--<Section path="QUERY_STATUS_CODE">
<Value field="value" value="New"/>
</Section>-->
<!-- note: AUDIT has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="AUDIT[0]/AUDIT_INFORMATION">
<Value field="code" value="LATEST"/>
<Value field="codeSystem" value="PRSAuditParameters"/>
</Section>
<!-- note: CONFIDENCE has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="CONFIDENCE/CONFIDENCE_VALUE">
<Value field="value" value="100"/>
</Section>
<!-- note: HISTORY has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="HISTORY/INCLUDE_HISTORY_INDICATOR">
<Value field="value" value="false"/>
</Section>
<!-- note: JURISDICTION has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="JURISDICTION/JURISDICTION_TYPE">
<Value field="value" value="NL"/>
</Section>
<!-- note: RESPONSE_OBJECT has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[0]">
<Value field="code" value="GRS_ADDRESS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[1]">
<Value field="code" value="GRS_ELECTRONIC_ADDRESS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[2]">
<Value field="code" value="GRS_IDENTIFIER"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[3]">
<Value field="code" value="GRS_ORGANIZATION_NAME"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[4]">
<Value field="code" value="GRS_PERSONAL_NAME"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[5]">
<Value field="code" value="GRS_REGISTRY_IDENTIFIER"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[6]">
<Value field="code" value="GRS_TELEPHONE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[7]">
<Value field="code" value="PRS_CONDITION"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[8]">
<Value field="code" value="PRS_CONFIDENTIALITY_INDICATOR"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[9]">
<Value field="code" value="PRS_DEMOGRAPHIC_DETAIL"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[10]">
<Value field="code" value="PRS_DISCIPLINARY_ACTION"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[11]">
<Value field="code" value="PRS_INFORMATION_ROUTE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[12]">
<Value field="code" value="PRS_NOTE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[13]">
<Value field="code" value="PRS_PROVIDER_CREDENTIAL"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[14]">
<Value field="code" value="PRS_PROVIDER_EXPERTISE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[15]">
<Value field="code" value="PRS_PROVIDER_RELATIONSHIP"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[16]">
<Value field="code" value="PRS_STATUS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[17]">
<Value field="code" value="PRS_WORK_LOCATION"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[18]">
<Value field="code" value="PRS_WORK_LOCATION_ADDRESS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[19]">
<Value field="code" value="PRS_WORK_LOCATION_DETAIL"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[20]">
<Value field="code" value="PRS_WORK_LOCATION_ELECTRONIC_ADDRESS"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[21]">
<Value field="code" value="PRS_WORK_LOCATION_INFORMATION_ROUTE"/>
</Section>
<Section path="RESPONSE_OBJECT[0]/PROVIDER_QUERY_RESPONSE_OBJECT[22]">
<Value field="code" value="PRS_WORK_LOCATION_TELEPHONE"/>
</Section>
<!-- note: ROLE_CLASS has an extra trailing space, as in the Excel mapping spreadsheet -->
<Section path="ROLE_CLASS /ROLE_CLASS_VALUE">
<Value field="value" value="LIC"/>
</Section>
<Section path="SORT_CONTROL[0]/SORT_CONTROL_ELEMENT_NAME">
<Value field="code" value="PrincipalPerson.name.value.family"/>
</Section>
<Section path="SORT_CONTROL[0]/SORT_CONTROL_DIRECTION_CODE">
<Value field="value" value="A"/>
</Section>
</Section>
</Enricher>
</EnricherParameter>
</EnricherParametersProfileData>
</ProfileData>
</Profile>
the data is valid against the schema through XML Spy tool... and loaded into the XDB repository...
4) create table and insert data:
SQL> CREATE TABLE EHIP_PROFILE OF SYS.XMLTYPE
2 XMLSCHEMA "http://rac3-1-vip:8080/home/EHIPSBUSER1/xsd/EHIPProfile_v00.xsd" ELEMENT "Profile"
3 ;
Table created.
SQL>
SQL> alter table EHIP_PROFILE
2 add CONSTRAINT EHIP_PROF_PK PRIMARY KEY(XMLDATA."ProfileID"."ID",XMLDATA."ProfileID"."Type");
Table altered.
SQL>
SQL>
SQL>
SQL>
SQL> select xdbURIType('/home/'||USER||'/ProfileData/EnricherPP.ID.0001.xml').getClob() from dual;
XDBURITYPE('/HOME/'||USER||'/PROFILEDATA/ENRICHERPP.ID.0001.XML').GETCLOB()
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy
SQL>
SQL>
SQL> insert into ehip_profile values(xmltype.createXML(xdbURIType('/home/'||USER||'/ProfileData/EnricherPP.ID.0001.xml').getClob()));
insert into ehip_profile values(xmltype.createXML(xdbURIType('/home/'||USER||'/ProfileData/EnricherPP.ID.0001.xml').getClob()))
ERROR at line 1:
ORA-21700: object does not exist or is marked for delete
what's the problem caused the "ORA-21700: object does not exist or is marked for delete" error?
Thanks in advance for your help?Thanks Marco,
Here're my environment:
SQL> select INSTANCE_NUMBER, INSTANCE_NAME,HOST_NAME,VERSION from v$instance;
INSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION
2 rac32 RAC3-2 10.2.0.3.0
I followed your suggested in the above, and always purge recyclebin, but still got the same problem. because in 10gr2, there's no dbms_xmlschema.purge_schema available,
and I did checked the recyclebin after force the delete of schema, nothing inside. any other recommendation? -
(oracle 8i)Alter Table table coalesce partition
Hi all,
Need assistance in solving a problem. I have a possibly large fragemented table. I tried to run a coalese command ALTER TABLE EMPTY_COPY COALESCE PARTITION
got an error: 'ora -14501 - object is not partitioned'
NOt sure how to proceed, I am working in oracle 8i environment.
Should I do :
ALTER TABLESPACE MY_DATA COALESCE
ALTER INDEX EMPTY_COPY_PK COALESCE
ALTER INDEX EMPTY_COPY_PK REBUILD
ALTER TABLE MY_DATA.EMPTY_COPY MOVE TABLESPACE NEW_DATA
Not sure if the syntax is correct or which to use, are there any redundancies in the commands above.
Thanks kindly for any input you may provide.thanks.
My real problem is an ora 1653 'UNABLE TO EXTEND TABLE' error where I could not insert into a table. The PCT_INCREASE was at 25 and the next_extext was at 160mb. Way too large. There still looks to be l plenty of space available for an another extent but it is not being allocated.
Would this apply? -
Autonomous Trigger / Mutating Table Problem
We have a specific problem in one of our applications being developed where by the database needs to enforce a specific business requirement.
We need to use a database trigger to enforce some data integrity which involves more than one table as such cannot use standard constraint. The integrity has to be maintained in the database as the DML statements may be coming from a Java application or PL/SQL code as such we need the logic all in one place.
The problem being that within the trigger we need to examine the state of the table the trigger is associated with as well as one other table. Obviously using a trigger on a table that is being affected by DML statements causes the dreaded mutating table problem.
One suggested solution to this was to make the trigger or the code the trigger called autonomous. This allows the trigger to execute by only showing the trigger the original state of the table before any of the DML statements have affected it.
The problem is this seems to work for single row DML statements but not for multi row DML statements. In multi row the trigger only sees the original state of the table, not the state of the table plus the changes made by any other actions in the same DML statement.
Below I have shown an example of what I'm seeing.
I have grossly simplified the example code below to only refer to a single table and use stupidly simple logic
I do realise i appear to be implementing uniqueness in my own PL/SQL code, this is purely for the example.
CREATE TABLE mutate_test
id INTEGER NOT NULL,
value VARCHAR2(255) NOT NULL
ALTER TABLE mutate_test ADD CONSTRAINT pk_mutate_test PRIMARY KEY(id);
ALTER TABLE mutate_test ADD CONSTRAINT ck_mutate_test CHECK (value = UPPER(value));
CREATE OR REPLACE FUNCTION duplicate_found(in_value IN mutate_test.value%TYPE) RETURN BOOLEAN IS
PRAGMA AUTONOMOUS_TRANSACTION;
v_value_found INTEGER;
BEGIN
SELECT COUNT(*)
INTO v_value_found
FROM mutate_test
WHERE value = in_value;
IF v_value_found > 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;
CREATE OR REPLACE TRIGGER tr_mutate_test BEFORE INSERT OR UPDATE ON mutate_test
FOR EACH ROW
BEGIN
IF duplicate_found(:new.value) = TRUE THEN
RAISE_APPLICATION_ERROR(-20000,'Duplicate value found');
END IF;
END;
INSERT INTO mutate_test (id,value) VALUES (1,'CLIFF');
INSERT INTO mutate_test (id,value) VALUES (2,'SULA');
COMMIT;
SELECT * FROM mutate_test;
-- Should fail as row 1 already has a value of CLIFF
INSERT INTO mutate_test (id,value) VALUES (3,'CLIFF');
COMMIT;
SELECT * FROM mutate_test;
-- Should fail as row 1 is already set to CLIFF
UPDATE mutate_test SET value = 'CLIFF' WHERE id = 2;
COMMIT;
SELECT * FROM mutate_test;
UPDATE mutate_test SET value = 'CLIFFORD' WHERE id = 1;
COMMIT;
SELECT * FROM mutate_test;
INSERT INTO mutate_test (id,value) VALUES (3,'RONNY');
INSERT INTO mutate_test (id,value) VALUES (4,'TIM');
INSERT INTO mutate_test (id,value) VALUES (5,'MONIQUE');
COMMIT;
SELECT * FROM mutate_test;
-- Wanted result would be row 1 would be updated from CLIFFORD to CLIFF
-- and the others raise errors, or all of them raise errors.
UPDATE mutate_test SET value = 'CLIFF' WHERE id IN (1,3,4);
COMMIT;
SELECT * FROM mutate_test;This is all from a University application that deals with eLearning.
Shell = Mapping from the system to an external eLearning application, ie: unique id of the Blackboard course shell, or WebBoard board.
Term = Academic term
Sector = University sector, ie: Higher Education, TAFE, etc..
Resource = eLearning tool, ie: Blackboard, WebBoard, etc..
Resource Level = Whether the resource is being offered at a Course or Program level
Resource Mapping = Association of a resource to shell
What we are trying to achieve is that shells cannot be used across sector boundaries.
The real table structure is (grossly simplified again)
CREATE TABLE sector (sector_pk INTEGER PRIMARY KEY);
CREATE TABLE sector_pattern (sector_pk INTEGER REFERENCES sector(sector_pk), pattern CHAR(2) NOT NULL UNIQUE CHECK (pattern = UPPER(pattern)));
CREATE TABLE term (term_pk INTEGER PRIMARY KEY, term CHAR(4) NOT NULL UNIQUE CHECK (term = UPPER(term)));
CREATE TABLE resource_level (resource_level_pk INTEGER PRIMARY KEY, term_pk INTEGER REFERENCES term(term_pk));
CREATE TABLE shell_detail (shell_detail_pk INTEGER PRIMARY KEY);
CREATE TABLE resource_mapping (resource_mapping INTEGER PRIMARY KEY, resource_level_pk INTEGER REFERENCES resource_level(resource_level_pk), shell_detail_pk INTEGER REFERENCES shell_detail(shell_detail_pk));
Based on the Ask Tom article linked I'd liked to use a MATERIALIZED VIEW on the following query
SELECT DISTINCT rm.shell_detail_pk,sp.sector_pk
FROM resource_mapping rm, resource_level rl, term t, sector_pattern sp
WHERE rm.resource_level_pk = rl.resource_level_pk
AND rl.term_pk = t.term_pk
AND SUBSTR(t.term,3,2) = sp.pattern;
Then apply a UNIQUE constraint on that VIEW.
But I'm receiving a
SQL Error: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
I'm not sure how to create the MATERIALIZED VIEW LOG entries for the above VIEW.
Any ideas anyone? ;)
Need to do some more reading and research but as Tom says
"I'm asking around about the future of "SQL" as far as enhancments go like that
(will update when I get some feedback), but -- you are not limited to triggers
(in fact, I would avoid triggers as it is virtually IMPOSSIBLE to implement
cross row/cross object constraints with them!!!! at least correctly)"
So I think i'll give up on the TRIGGER approach as it doesn't meet our requirements. -
What privs r required to run Alter table truncate partition update indexes?
I rebuilt the indexes on the table. Know my problem is that when I truncate a partition on the table the unique index whic consist of the primary key fields becomes unusable which causes my to have to rebuild it after each truncate. I tried to runm the following statement from the master schema on but get
an insufficient privs error when I use "update indexes":
Alter table schema_name.table_name truncate partition partition_name storage update indexes;
What priv does master need to perform statement successfully when there's data in it?
Does using 'update indexes' needs extra priveleges?
Thanks in Advance
GaganHi Its Oracle 10.2.0.4 64 Bit on HP UX.
I dont have the exact error as I got this much information only from the end user....It will be couple of hours more then he will be available again
ok so for Truncate we need 'Drop any' privs but to use clause 'update indexes' alongwith do we need some extra privelege?
Thanks again
Gagan -
Dear All ,
I have 10g database on rehl5 .I move table's(T_TRANSACTION_TABLE) tablespace(USERS) to tablespace (IMAGES) .
It completed successfully
MY command is
ALTER TABLE USERS MOVE TABLESPACE IMAGES
and
ALTER INDEX USERS REBUILD TABLESPACE IMAGES
Problem is transaction_images table show using table space IMAGES but store data in USERS table space .
I check this using em->administrator->schema->Table
and i also check DBA_SEGMENT,DBA_EXTENTS both are show tablespace USERS
Note :- 1) This table contain BLOB column for save image .
2) I am also rebuild index also.
Thanks in advance
Shaikh Abdul MoyedA LOB (CLOB or BLOB) can be stored in a different tablespace than the rest of the table. Are you certain that you're looking at the tablespace for the table segment rather than the LOB segment?
If you want to move the LOB segment to a different tablespace
ALTER TABLE <<table name>>
MOVE LOB( <<name of BLOB column>> )
STORE AS( TABLESPACE <<new tablespace>> )Additionally, I'm a bit confused by the DDL you posted
ALTER TABLE USERS MOVE TABLESPACE IMAGES
ALTER INDEX USERS REBUILD TABLESPACE IMAGESYou use USERS as a table name and as an index name in these DDL statements. But then you later talk about the USERS tablespace. I'm guessing that you really put the table name (TRANSACTION_IMAGES) in the ALTER TABLE command and that you used the correct index name in your ALTER INDEX.
Justin -
Will alter table table_name move statement change the storage parammeter
Hi there,
I have a question about table reorgnization. Will alter table
table_name move SQL statment change the table's storage parameter
or keep the same as the original one? If I want to use alter
table statement to do table defragmentation and change the
initial and next storage parameter, how will I write this SQL
statement?
Thanks in advance.Thanks. My table has 5000 extents each of which is 64k, so I
think I need to do table defragmentation to improve performance.
If I use alter table table_name move without storage parameter
and tablespace name, I will relocate this table in current
tablespace and adopt the current tablespace's storage parameter
as my table's new storage paramater which is still 64k. After
that, if I issue alter
table table_name storage (initial 50M next=50M) command, will it
change this table's storage parameter and decrease the totoal
extents number? I ask this question because I use OEM2.2 tuning
pack reorg wizard to generate the job script to do table
defragmentation, but in the job script there is no new storage
parameter. It only generate alter table table_name move
statement, so I wonder if I don't need to modify this job scripts
and after it executes this job script, I issue alter table
table_name storage parameter command manaully. Will this solve
my problem or I must modify the job script and add new storage
parameter in the job script? -
Can't have alter table in SP ?
I tried to create a procedure
CREATE OR REPLACE PROCEDURE sp_disablefk
is
begin
Alter Table ACCOUNTDETAIL
Disable constraint SYS_C0022265;
end;
It returned me a message Encountered symbol Alter when expecting .....
However, when I place same statement in Execute Immediate statement, also inside of procedure, it creates and executes it without problems.
Can I still have it straight inside of SP, without Execute Immediate ? This constraint is FK referensing PK in another table.
ThanksIt is true for any DDL statement (which includes CREATE/DROP, of course).
By naked DDL he meant that DDL statements can not be placed within PL/SQL block just on their own (like other SQL statements - SELECT, INSERT, UPDATE etc...).
They need to be wrapped inside EXECUTE IMMEDIATE or for older Oracle versions using DBMS_SQL package. -
hi everybody !
I have a table which also has data in it. Now, before i add some more data to this table i want to create a partition with all the existing data. Following is the error message i get when executing the altertable command.
ALTER TABLE address_header_temp
add PARTITION add_head_temp
VALUES LESS THAN (MAXVALUE);
error :-
ORA-14501: object is not partitioned
Please help me in solving this problem.
Thanks in advance
MoloyIf you wanna do it online, then, use dbms_redine package to redifine objects online. I believe this is one time process. Once you add partitions and you can drop and create partions accordingly. At least you get out of heap table to meet your requirements.
Otherwise, create another table with required partions and move data from heap (non partitoned) table to partitioned table, drop the old one and rename the new one to old one.
Jaffar
Maybe you are looking for
-
SSO To J2EE engine of ABAP+JAVA Addin Install
Hi all, I have setup an SAP system as a ABAPJAVA Addin Install. The system is running NW04s SP11. I have an SAP Portal installed on the JAVA side to support some BW functions. I would like to do SSO from the users desktop directly to the portal co
-
Message control for payments above Rs 20000
Hi My client wants to put warning message in case a ash payment for more than Rs 20000 is posted. Where can this be done ?
-
Reading a multi-dimensional array from a binary file?
Hi, experts! Once again I'm stuck with a basic problem in labview. I've ben trying to make a VI that reads a binary measurement file that consists of a 2D array, i.e. n channels of sampled data. This seems to be easier said than done in LV and I the
-
I have a 5 year old MBP, 2GHz Intel Core Duo, 1GB MHz, DDR2 SDRAM, running Snow Leopard, 10.6.8. I use wireless to connect to the Internet and everything works fine when I sign on. After being on line for awhile and my remaining battery power at abo
-
Installation error for 11.1.2.1
1)My common components is failed during the installation process during installation of 11.1.2.1 2)while product selection I am not able to find some components SHARED SERVICES ,SMART VIEW First installed weblogic in a different folder.Then I downlod