Problem to insert id into the foreign key  php/mysql

Hello all,
I'm having rouble to understand the process and there is no tutorial about my problem anywhere
I have two table:
Table 1 (member) with id, name, phone etc
Table2 (post) add_id, title, description, price, member_id
I got a form to post the add and I need to insert the id of table 1 into my table 2 member_id zone
Fisrt I did the recorset to get user id
$colname_rsMember = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_rsMember = $_SESSION['MM_Username'];
mysql_select_db($database_connect, $connect);
$query_rsMember = sprintf("SELECT * FROM member WHERE username='".$_SESSION['MM_Username']."'")or die(mysql_error());
$rsMember = mysql_query($query_rsMember, $connect) or die(mysql_error());
$row_rsMember = mysql_fetch_assoc($rsMember);
$totalRows_rsMember = mysql_num_rows($rsMember);
This part is working and I'm able to retreive info via echo just for testing
After this code I have my insert code
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
  $insertSQL = sprintf("INSERT INTO add (title, `description`, price, member_id) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($_POST['title'], "text"),
                       GetSQLValueString($_POST['description'], "text"),
                       GetSQLValueString($_POST['price'], "text"),
                       GetSQLValueString($_POST['member_id'], "int"));
  mysql_select_db($database_connect, $connect);
  $Result1 = mysql_query($insertSQL, $connect) or die(mysql_error());
  $insertGoTo = "ok.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  header(sprintf("Location: %s", $insertGoTo));
Do I need to include hidden field in y form?
I'm having the same error message. Col member_id can't not be null
Any idea what I'm doing wrong?
Thank You!

When someone logs in, Dreamweaver creates a session variable called $_SESSION['MM_Username']. Use that session variable to create a recordset to get the user's ID, which can then be entered into the foreign key field of the child table.
Dreamweaver automatically puts the code for recordsets immediately above the DOCTYPE declaration, so you will need to move it above the code for the Insert Record server behavior. So, it needs to be in this order:
Recordset to get user ID
Insert Record for child table

Similar Messages

  • 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?

  • Problem in inserting data into MySQL table

    Hi All,
    I have a table with just two fields FIRSTNAME and SECONDNAME in MySQL. I am accepting the First Name and Second Name in two text fields and then trying to insert them into the MySQL table. I have set the concurrency of the rowset to CONCUR_UPDATABLE and am using the code clip for Database row insert with the appropriate changes. When I run the application it doesnt give me any errors but the data is also not inserted in the table. Can someone pls help me out.
    Loneliness wins the race :-)

    This is my problem when inserting single row. What does it means ?
    MusicInsert: com.mysql.jdbc.NotUpdatable: Result Set not updatable.This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details

  • How to retrieve the Foreign key information in Oracle

    I want to know how to retrieve the Foreign Key information in Oracle while using SQL Statement?
    I have use three SQL statement to retrieve such information, but the performance is very bad.
    The three SQL Statements are:
    Select constraint_name, r_constraint_name from all_constraints where constraint_type = 'R' and table_name = table1;
    Select column_name from all_cons_columns where constraint_name = cons1;
    Select table_name, column_name from all_cons_columns where constraint_name = r_ccons1;
    Do anyone know another method to retrieve the Foreign Key information which has better performance?

    These sql-statements don't seem very performance intensive. My guess is something is wrong with your database (unless you have millions of constraints). How many constraints do you have? how many concurrent users? What is your dictionary cach hitratio? (other hitratio?) memory problems? other tasks of the computer? is this query the only one being slow? etc.

  • SSAS 2008 Linking two cubes on the foreign key between two fact tables

    Hi, all -- 
    I have two cubes:
    Cube 1 has Fact1 (F1, "Events") and 3 dimensions (D1, D2, D3)
    Cube 2 has Fact2 (F2, "Sales") and 3 dimensions (D4, D1, D6)
    As you can see, two cubes reuse D1 as their common dimension.  In addition, F2 foreign keys into F1, e.g. F1 is "Events", and F2 is "Sales".  Every "sale" is an "event", but not every "event" is
    a "sale".
    The question is, how to I link the two cubes and their two respective fact tables on the foreign key?
    Thanks, Austin.

    Hi Austin,
    According to your description, you want to retrieve data from two different cubes, right? In Analysis Services, to query multiple cubes from a single MDX statement you can use the LOOKUPCUBE function (you can't specify multiple cubes in your FROM statement).
    The LOOKUPCUBE function will only work on cubes that utilize the same source database as the cube on which the MDX statement is running. For the detail information about it, please refer to the link below to see the blog.
    Retrieving Data From Multiple Cubes in an MDX Query Using the Lookupcube Function
    If I have anything misunderstood, please point it out.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Cannot insert null into a Primary Key Column using Entity Framework

    I have to insert data into UserPreferences Table which has a primary key. This I am doing with Oracle Entity Framework Provider.
    It is unable to do it though i have set the StoreGeneratedPattern = "Identity". But while saving changes it is saying a null error is being inserted into the primary key.

    I exported the same package to BIDS and ran it but still unable to get the issue. It is running fine.
    Also then same package is running fine in other environments.
    Thanks
    Thats strange
    Are you pointing to same databases itself while executing from server?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Populate the foreign key automatically

    HI All!
    I have a form in which there are two data blocks One is emp_master and other is salary_details.I have a foreign key salary_code in Emp_master and similarly Salary_code as primary key in salary details.I have used two list item in place of Emp_id and Salary_code.I want that when I select the emp_id as 10 from the list automatically salary_code list item should get populated by 1 item in the list item.Similary the rest should follow .Please someone look into this matter it would be a gr8t help to me.
    Thanks

    Abha,
    I would not use list items for this. Instead, use a multi-record text box with a scroll bar. It looks and behaves like a t-list, but is much easier to code and manage.
    Use the datablock wizard to create the master-detail relationship. When you use the wizard, all the code will be generated for you. Then use the layout wizard, and display multiple records with scroll bars.
    BTW, it is customary to have the primary key in the master, and the foreign key in the details. In your case it is backwards.
    Also see
    http://www.oracle.com/technology/obe/obe_as_10g/bi/forms/formsmasterdetailobe.htm

  • I bought versions for iPad and for MacBook. At synchronization of documents on MacBook all smilies from the Emoji keyboard disappeared. It is impossible to insert them into the text manually. Smiles of Emoji are supported by the program for Mac? Help to s

    I bought versions for iPad and for MacBook. At synchronization of documents on MacBook all smilies from the Emoji keyboard disappeared. It is impossible to insert them into the text manually.
    Smiles of Emoji are supported by the program for Mac?
    Help to solve a problem, please.

    Same thing happened to me with my peruvian credit card in the peruvian app store, I want to buy an app, but it says that my credit card is "not supported in the Peruvian app store"

  • Problems turning bytes back into a des key

    hi there-
    i'm writing a client/server application the uses encryption to send files back and forth. i have been able to get my program to receive certificates from the client and server. i have generated a des key using:
    KeyGenerator kg = KeyGenerator.getInstance("DES");
    java.security.Key secretkey = kg.generateKey();
    and I want to send that to the server, encrypted with the public key. i'm trying to do it like this:
    Cipher cipher = Cipher.getInstance("RSA");
    cipher.init ( Cipher.ENCRYPT_MODE, key); //key is the public key
    theBytes [] = secretkey.getEncoded(); //send secretkey
    bytesEncrypted [] = cipher.doFinal(theBytes);
    outToServer.writeInt(bytesEncrypted.length);
    outToServer.write(bytesEncrypted);
    the problem is, once i transmit the des key and decrypt it with the private key, i dont know how to turn it back into a des key from the bytes. can someone help me out bigtime and let me know how i can go about doing this?
    thanks a bunch!

    In followup to my previous reply, here is the sample code.
    import java.security.spec.KeySpec;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.DESKeySpec;
    public class SecretKeyTest {
         public static void main(String[] args) throws Exception {
              System.out.println(System.getProperty("java.version"));
              KeyGenerator kg = KeyGenerator.getInstance("DES", "SunJCE");
              SecretKey sk1 = kg.generateKey();
              System.out.println(sk1);
              byte [] sk1Bytes = sk1.getEncoded();
              SecretKeyFactory skf = SecretKeyFactory.getInstance("DES");
              KeySpec spec = new DESKeySpec(sk1Bytes);
              SecretKey sk2 = skf.generateSecret(spec);
              System.out.println(sk1.equals(sk2) ? "Equal" : "Not Equal");
    }

  • I am making a calendar in iPhoto, picking photos from a folder, let's call it "2011 Pics," in iPhoto. After arranging all the photos and captions I decided I wanted to insert a new photo -- one that was not in "2011 Pics." So I inserted it into the folder

    Add new photo to existing calendar folder in iPhoto
    I am making a calendar in iPhoto, picking photos from a folder, let's call it "2011 Pics," in iPhoto. After arranging all the photos and captions I decided I wanted to insert a new photo -- one that was not in "2011 Pics." So I inserted it into the folder, but the picture does not show up on the scrolling menu of pictures at the left of the calendar-making page. This happened last year and in frustration I started all over again. But surely there is a way to add a new picture to a calendar that is already laid out.

    Yes, the Old Master file has a folder for each year where I find all photos from that specific year. I am attaching a screen shot of the file.
    In the meantime i have managed to download all photos (it did not download any video files though in mpg, avi, 3gp, m4v,mp4 and mov format) to a new iphoto library. Unfortunately the photos are quite mixed and often doubled up. I ma considering to purchase iphoto library which checks all duplicates in iphoto. this will save me a lot of time. What do you think?

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • I am unable to create the Foreign key

    Hi,
    I need to create the Foreign key which reffered to composite primary key.
    the following table structure
    Parent table
    DIVISION, PROJECT_NUMBER, COMPETITION_PROJECT_NUMBER, COMPETITIVE_STMT_TYPE, SEQUENCE, CATEGORY, STATEMENT, USER_ID, RECORD_MODIFICATION_DATE
    Here composite primary key columns(DIVISION, PROJECT_NUMBER, COMPETITION_PROJECT_NUMBER, COMPETITIVE_STMT_TYPE, SEQUENCE)
    Child Table
    DIVISION          VARCHAR2 (4)          
    PROJECT_NUMBER          NUMBER (10)COMPETITION_PROJECT_NUMBER     NUMBER (10)          
    COMPETITIVE_STMT_TYPE          VARCHAR2 (2)          
    SEQUENCE     NUMBER (2)          
    CATEGORY          VARCHAR2 (100)     
    STATEMENT     LONG          
    USER_ID     VARCHAR2 (100)          
    RECORD_MODIFICATION_DATE     DATE     
    ALTER TABLE COMPETITION_STMT ADD (CONSTRAINT COMPET_STMT_FK_PROJ_NUM foreign key
              (PROJECT_NUMBER) REFERENCES PROD_COMPET_XREF (PROJECT_NUMBER));
    when i am trying to create foreign key i got this error
    ORA-02270: no matching unique or primary key for this column-list
    this is production issue Please help me.
    Thanks in advance
    Regards
    Kumar.s

    ALTER TABLE PROD_COMPET_XREF ADD (
    CONSTRAINT PROD_COMP_XREF_PK_DPNCPNCT
    PRIMARY KEY
    (COMPETITION_PROJECT_NUMBER, PROJECT_NUMBER, DIVISION, PRODUCT_LOC_INDICATOR)
    When you create a foreign key, it must reference a unique or primary key. The primary or Unique key must consist ONLY of those columns upon which the Primary key is based.
    You must Alter the table and add a Unique key if you want to keep your compsite primary key constraint. The Unique key must be for only the column that your foreign key references. Then try to recreate your foreign key.
    I doubt you will be able to add a foreign key because I suspect you might have multiple rows with the same value for this column based on your composite key; however, if you only intend for the project number to be listed only once and to be unique for each row, then the unique key may work or you may want to revist your primary key on this table. Perhaps you don't need it to be a composite PK???
    If you can't work around that, one thing you can do is build a table based just on PROJECT_NUMBER that contains details about the project number and have other tables reference that. That is, if you have multiple rows with the same project number in that table. You may already have one? Perhaps you can build your foreign key to reference that?

  • Disable all the foreign keys in a database

    Hy, what sql to use to disable all the foreign keys in a database and how to enable all them again. Thanks

    select * from dba_constraints where constraint_type = 'R' and status = 'ENABLED'
    ALTER TABLE table_name
    disable CONSTRAINT constraint_name;
    ALTER TABLE table_name
    enable CONSTRAINT constraint_name;
    select
    'ALTER TABLE ' || OWNER || '.' || table_name || ' enable CONSTRAINT ' || constraint_name || ';'
    from dba_constraints where constraint_type = 'R' and status = 'ENABLED';
    Execute and save result for enable before disable
    select
    'ALTER TABLE ' || OWNER || '.' || table_name || ' disable CONSTRAINT ' || constraint_name || ';'
    from dba_constraints where constraint_type = 'R' and status = 'ENABLED';
    Execute result for disable.

  • Getting a Song into the Right Key?

    I'm trying to use GarageBand as an accompanying "band" for improvisation practice for myself and my students. I can't seem to figure out how to get a tune using only GB loops into the exact key I want. For example, I set the song to E major (and that shows as the master track), and put together some loops for a really nice track, but realized that it ended up being in G major (E natural minor).
    Any way to make sure any loops only are in that exact key, or to get them to transpose to that key? I'm sure I'm missing something simple.

    The simple solution, but it may not sound to good, is to simply to change the region pitch parameter, located in the editors, until you hit the correct key.
    HOWEVER, for audio loops, this ain't a gonna sound too good. My experience is that the loop engine sounds much better at transposition than simple rate conversion in the editor, assuming the use different technologies (the loop engine, same as in SoundTrack or Logic, being the one that transposes everything to the project key).
    You could get really tricky: copy all the loops you want to a new folder. Download and launch the Apple Loop Utility. Calculate what keys you need for each loop, set this in the utility and save. You've now just changed the 'native' key for a loop and GB will transpose it differently.
    For example if a loop was in C, and you've sinced moved your song up to the key of E, the loop is now a major third too high, so set the loops key (in the ALU) to G#/Ab. You can then of course in GB add this loop to your library.
    In the long run, you need loops that match your chord progressions - there's no substitute for that.
    AND it's best to always start out your song in the correct key. Susbsequent key changes then work better, since every track moves in sync.

  • Problem when we log into the Webclient with IC_AGENT business role

    Hello,
    We are facing a problem when we log into the interaction center ( with IC_AGENT business role) after the login screen ( we fill the correct user and password) then system starts the application, but a error appears.
    We dont knon why but it is happening only with IC_AGENT role, We have check the SICF and it is ok.
    Cannot display view ICCMP_HEADER/HeaderViewSet of UI Component ICCMP_HEADER
    An exception occurred during the internal HTTP communicationException Class CX_BSP_WD_HTTP_RESPONSE_ERROR
    Text:
    Additional Info: Business Server Page (BSP) Error
    Program: CL_BSP_WD_STREAM_LOADER=======CP
    Include: CL_BSP_WD_STREAM_LOADER=======CM002
    Source Text Row: 159
    Cannot display view CRM_UI_FRAME/WorkAreaViewSet of UI Component CRM_UI_FRAME
    An exception has occurredException Class CX_BSP_WD_RUNTIME_ERROR - View BPIDENT.MainWindow in component CRM_UI_FRAME could not be bound
    Method: CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW
    Source Text Row: 165
    Initialization of view CRM_UI_FRAME/WorkAreaViewSet of UI Component CRM_UI_FRAME failed
    An exception has occurredException Class CX_BSP_WD_RUNTIME_ERROR - View BSPWD_BASICS/WorkAreaHostViewSet in component CRM_UI_FRAME could not be bound
    Method: CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW
    Source Text Row: 165
    Cannot display view CRM_UI_FRAME/MainWindow of UI Component CRM_UI_FRAME
    An exception has occurredException Class CX_BSP_WD_RUNTIME_ERROR - View BSPWD_BASICS/WorkAreaHostViewSet in component CRM_UI_FRAME could not be bound
    Method: CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW
    Source Text Row: 165
    Initialization of view CRM_UI_FRAME/MainWindow of UI Component CRM_UI_FRAME failed
    An exception has occurredException Class CX_BSP_WD_RUNTIME_ERROR - View CRM_UI_FRAME/WorkAreaViewSet in component CRM_UI_FRAME could not be bound
    Method: CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW
    Source Text Row: 165
    Cannot display view Root.htm of UI Component CRM_UI_FRAME
    An exception has occurredException Class CX_BSP_WD_RUNTIME_ERROR - View CRM_UI_FRAME/WorkAreaViewSet in component CRM_UI_FRAME could not be bound
    Method: CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW
    Source Text Row: 165
    An error occurred during initialization of the application
    An exception has occurredException Class CX_BSP_WD_RUNTIME_ERROR - View CRM_UI_FRAME/MainWindow in component CRM_UI_FRAME could not be bound
    Method: CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW
    Source Text Row: 165  
    Any help thanks in advance.

    hi luis,
    your error description reminds me of an inactive SICF, but you wrote, that you checked this before.
    on this forum is an excellent entry with lots of hints and tipp for the IC WebUI:
    Documentation for Interaction Center (IC) WebClient
    Documentation for Interaction Center (IC) WebClient
    maybe this will help.
    best wishes,
    hakan

Maybe you are looking for