How to insert data into clob or xmltype column

when i am inserting to clob or xml type column i am getting error like ERROR at line 2:
ORA-01704: string literal too long
INSERT INTO po_clob_tab
values(100,'<TXLife>
     <UserAuthRequest>
          <UserLoginName>UserId</UserLoginName>
     </UserAuthRequest>
     <TXLifeRequest>
          <TransRefGUID>0099962A-BFF3-4761-4058-F683398D79F7</TransRefGUID>
          <TransType tc="186">OLI_TRANS_CHGPAR</TransType>
          <TransExeDate>2008-05-29</TransExeDate>
          <TransExeTime>12:01:01</TransExeTime>
          <InquiryLevel tc="3">OLI_INQUIRY_OBJRELOBJ</InquiryLevel>
          <InquiryView>
               <InquiryViewCode>CU186A</InquiryViewCode>
          </InquiryView>
          <ChangeSubType>
               <ChangeTC tc="32">Update / Add Client Object Information</ChangeTC>
               <!--TranContentCode tc = 1 (Add)
                                                       tc = 2 (Update)
                                                       tc = 3 (Delete)
               -->
               <TranContentCode tc="1">Add</TranContentCode>
          </ChangeSubType>
          <OLifE>
               <SourceInfo>
                    <SourceInfoName>Client Profile</SourceInfoName>
               </SourceInfo>
               <Activity id="Act1" PartyID="Party1">
                    <ActivityStatus tc="2">In Progress</ActivityStatus>
                    <UserCode>123456</UserCode>
                    <Opened>2010-08-17</Opened>
                    <ActivityCode>CP10001</ActivityCode>
                    <Attachment>
                         <Description>LastScreenName</Description>
                         <AttachmentData>CP Create</AttachmentData>
                         <AttachmentType tc="2">OLI_ATTACH_COMMENT </AttachmentType>
                         <AttachmentLocation tc="1">OLI_INLINE </AttachmentLocation>
                    </Attachment>
                    <OLifEExtension VendorCode="05" ExtensionCode="Activity">
                         <ActivityExtension>
                              <SubActivityCode>CP20001</SubActivityCode>
                         </ActivityExtension>
                    </OLifEExtension>
               </Activity>
               <Grouping id="Grouping1">
                    <Household>
                         <EstIncome>90000</EstIncome>
                    </Household>
               </Grouping>
               <Holding id="Holding1">
                    <HoldingTypeCode tc="2">Policy</HoldingTypeCode>
                    <Purpose tc="35">Accumulation</Purpose>
                    <Policy>
                         <ProductType tc="1009800001">AXA Network Non-Proprietary Variable Life Product</ProductType>
                         <ProductCode>Plus9</ProductCode>
                         <PlanName>Accumulator Plus 9.0</PlanName>
                         <Annuity>
                              <QualPlanType tc="45">Qualified</QualPlanType>
                         </Annuity>
                         <ApplicationInfo>
                              <ApplicationJurisdiction tc="35">New Jersey</ApplicationJurisdiction>
                              <OLifEExtension VendorCode="05" ExtensionCode="ApplicationInfo">
                                   <ApplicationInfoExtension>
                                        <FinancialPlanIInd tc="0">False</FinancialPlanIInd>
                                        <AgentVerifiesOwnersID tc="1">True</AgentVerifiesOwnersID>
                                   </ApplicationInfoExtension>
                              </OLifEExtension>
                         </ApplicationInfo>
                         <FinancialActivity>
                              <FinActivityType tc="7">Initial Payment</FinActivityType>
                              <FinActivityPct>10</FinActivityPct>
                              <Payment>
                                   <SourceOfFundsTC tc="18">Gift</SourceOfFundsTC>
                                   <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                        <PaymentExtension>
                                             <FundingDisclosureDetails>
                                                  <FundingDisclosureTC tc="1009800001">Cash</FundingDisclosureTC>
                                             </FundingDisclosureDetails>
                                        </PaymentExtension>
                                   </OLifEExtension>
                              </Payment>
                         </FinancialActivity>
                         <FinancialActivity>
                              <FinActivityType tc="7">Initial Payment</FinActivityType>
                              <FinActivityPct>10</FinActivityPct>
                              <Payment>
                                   <SourceOfFundsTC tc="8">Personal Loan</SourceOfFundsTC>
                                   <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                        <PaymentExtension>
                                             <FundingDisclosureDetails>
                                                  <FundingDisclosureTC tc="1009800002">Borrowing</FundingDisclosureTC>
                                             </FundingDisclosureDetails>
                                        </PaymentExtension>
                                   </OLifEExtension>
                              </Payment>
                         </FinancialActivity>
                         <FinancialActivity>
                              <FinActivityType tc="7">Initial Payment</FinActivityType>
                              <FinActivityPct>10</FinActivityPct>
                              <Payment>
                                   <SourceOfFundsTC tc="10">Withdrawal</SourceOfFundsTC>
                                   <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                        <PaymentExtension>
                                             <FundingDisclosureDetails>
                                                  <FundingDisclosureTC tc="1009800003">Policy Related</FundingDisclosureTC>
                                             </FundingDisclosureDetails>
                                        </PaymentExtension>
                                   </OLifEExtension>
                              </Payment>
                         </FinancialActivity>
                         <FinancialActivity>
                              <FinActivityType tc="7">Initial Payment</FinActivityType>
                              <FinActivityPct>10</FinActivityPct>
                              <Payment>
                                   <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                        <PaymentExtension>
                                             <FundingDisclosureDetails>
                                                  <FundingDisclosureTC tc="1009800005">Sale of 401(k) Mutual Fund Shares, Existing Pension Plan Assets, Stocks, Bonds, CD’s</FundingDisclosureTC>
                                             </FundingDisclosureDetails>
                                        </PaymentExtension>
                                   </OLifEExtension>
                              </Payment>
                         </FinancialActivity>
                         <FinancialActivity>
                              <FinActivityType tc="7">Initial Payment</FinActivityType>
                              <FinActivityPct>10</FinActivityPct>
                              <Payment>
                                   <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                        <PaymentExtension>
                                             <FundingDisclosureDetails>
                                                  <FundingDisclosureTC tc="1009800004">Sale of qualified or non-qualified Mutual Fund Shares</FundingDisclosureTC>
                                             </FundingDisclosureDetails>
                                        </PaymentExtension>
                                   </OLifEExtension>
                              </Payment>
                         </FinancialActivity>
                         <FinancialActivity>
                              <FinActivityType tc="7">Initial Payment</FinActivityType>
                              <FinActivityPct>20</FinActivityPct>
                              <Payment>
                                   <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                        <PaymentExtension>
                                             <FundingDisclosureDetails>
                                                  <FundingDisclosureTC tc="1009800006">Sale of Investment Advisory Assets</FundingDisclosureTC>
                                             </FundingDisclosureDetails>
                                        </PaymentExtension>
                                   </OLifEExtension>
                              </Payment>
                         </FinancialActivity>
                         <FinancialActivity>
                              <FinActivityType tc="7">Initial Payment</FinActivityType>
                              <FinActivityPct>20</FinActivityPct>
                              <Payment>
                                   <SourceOfFundsTC tc="1009800008">Car</SourceOfFundsTC>
                                   <OLifEExtension VendorCode="05" ExtensionCode="Payment">
                                        <PaymentExtension>
                                             <FundingDisclosureDetails>
                                                  <FundingDisclosureTC tc="2147483647">Other</FundingDisclosureTC>
                                             </FundingDisclosureDetails>
                                        </PaymentExtension>
                                   </OLifEExtension>
                              </Payment>
                         </FinancialActivity>
                    </Policy>
               </Holding>
               <Party id="Party1">
                    <PartyTypeCode tc="1">Person</PartyTypeCode>
                    <EstNetWorth>250000</EstNetWorth>
                    <LiquidNetWorthAmt>120000</LiquidNetWorthAmt>
                    <EstTotAssetsAmt>400000</EstTotAssetsAmt>
                    <Person>
                         <FirstName>John</FirstName>
                         <LastName>Doe</LastName>
                         <MarStat tc="1">Married</MarStat>
                         <Gender tc="1">Male</Gender>
                         <BirthDate>1965-05-07</BirthDate>
                         <EducationType tc="3">Associate Degree</EducationType>
                         <Citizenship tc="1">USA</Citizenship>
                         <NetIncomeAmt>70000</NetIncomeAmt>
                         <DriversLicenseNum>D123456789</DriversLicenseNum>
                         <DriversLicenseState tc="35">New Jersey</DriversLicenseState>
                         <ImmigrationStatus tc="8">Citizen</ImmigrationStatus>
                         <DriversLicenseExpDate>2012-05-25</DriversLicenseExpDate>
                         <OLifEExtension VendorCode="05" ExtensionCode="Person">
                              <PersonExtension>
                                   <NoDriversLicenseInd tc="0">False</NoDriversLicenseInd>
                              </PersonExtension>
                         </OLifEExtension>
                    </Person>
                    <Address>
                         <Line1>125 Finn Lane</Line1>
                         <City>North Brunswick</City>
                         <AddressStateTC tc="35">New Jersey</AddressStateTC>
                         <Zip>08902</Zip>
                    </Address>
                    <Phone>
                         <PhoneTypeCode tc="1">Home</PhoneTypeCode>
                         <DialNumber>732456789</DialNumber>
                    </Phone>
                    <Phone>
                         <PhoneTypeCode tc="2">Work</PhoneTypeCode>
                         <DialNumber>732987654</DialNumber>
                    </Phone>
                    <Attachment>
                         <Description>Comments</Description>
                         <AttachmentData>This is the comments entered for the client</AttachmentData>
                         <AttachmentType tc="2">OLI_ATTACH_COMMENT </AttachmentType>
                         <AttachmentLocation tc="1">OLI_INLINE </AttachmentLocation>
                    </Attachment>
                    <Attachment>
                         <AttachmentSysKey>1</AttachmentSysKey>
                         <Description>Additional Notes Important Considerations</Description>
                         <AttachmentData>This is the comments entered for the client</AttachmentData>
                         <AttachmentType tc="2">OLI_ATTACH_COMMENT </AttachmentType>
                         <AttachmentLocation tc="1">OLI_INLINE </AttachmentLocation>
                    </Attachment>
                    <Attachment>
                         <AttachmentSysKey>2</AttachmentSysKey>
                         <Description>Additional Notes Important Considerations</Description>
                         <AttachmentData>This is the comments entered for the client</AttachmentData>
                         <AttachmentType tc="2">OLI_ATTACH_COMMENT </AttachmentType>
                         <AttachmentLocation tc="1">OLI_INLINE </AttachmentLocation>
                    </Attachment>
                    <Client>
                         <NumRelations>1</NumRelations>
                         <EstTaxBracket>10</EstTaxBracket>
                         <BrokerDealerInd tc="1">True</BrokerDealerInd>
                         <EstIncomeAmt>90000</EstIncomeAmt>
                         <PrimaryInvObjective tc="8">Income and Growth</PrimaryInvObjective>
                         <InvHorizonRangeMin>5</InvHorizonRangeMin>
                         <OLifEExtension VendorCode="05" ExtensionCode="Client">
                              <ClientExtension>
                                   <RiskToleranceCode tc="3">Moderate</RiskToleranceCode>
                                   <FINRAAffiliationName>John Doe</FINRAAffiliationName>
                                   <Rank>
                                        <RankCategory tc="1009800001">Financial Goal</RankCategory>
                                        <TotalRankCode>5</TotalRankCode>
                                        <RankCode PurposeID="1009800016">6</RankCode>
                                        <RankCode PurposeID="35">6</RankCode>
                                        <RankCode PurposeID="2">6</RankCode>
                                        <RankCode PurposeID="1009800013">6</RankCode>
                                        <RankCode PurposeID="1009800014">6</RankCode>
                                        <RankCode PurposeID="5">6</RankCode>
                                        <RankCode PurposeID="1009800015">6</RankCode>
                                   </Rank>
                              </ClientExtension>
                         </OLifEExtension>
                    </Client>
                    <EMailAddress>
                         <EMailType tc="1">Business</EMailType>
                         <AddrLine>[email protected]</AddrLine>
                    </EMailAddress>
                    <Risk>
                         <HHFamilyInsurance>
                              <HHFamilyInsuranceSysKey>1</HHFamilyInsuranceSysKey>
                              <DeclinedInd tc="0">False</DeclinedInd>
                              <LineOfBusiness tc="1">Life Insurance</LineOfBusiness>
                         </HHFamilyInsurance>
                         <HHFamilyInsurance>
                              <HHFamilyInsuranceSysKey>2</HHFamilyInsuranceSysKey>
                              <DeclinedInd tc="0">False</DeclinedInd>
                              <LineOfBusiness tc="1">Life Insurance</LineOfBusiness>
                         </HHFamilyInsurance>
                         <HHFamilyInsurance>
                              <HHFamilyInsuranceSysKey>1</HHFamilyInsuranceSysKey>
                              <DeclinedInd tc="0">False</DeclinedInd>
                              <LineOfBusiness tc="3">Disability Insurance</LineOfBusiness>
                         </HHFamilyInsurance>
                         <HHFamilyInsurance>
                              <HHFamilyInsuranceSysKey>1</HHFamilyInsuranceSysKey>
                              <DeclinedInd tc="0">False</DeclinedInd>
                              <LineOfBusiness tc="5">LTC Insurance</LineOfBusiness>
                         </HHFamilyInsurance>
                         <FinancialExperience>
                              <InvestmentType tc="7">CD</InvestmentType>
                              <YearsOfInvestmentExperience>1</YearsOfInvestmentExperience>
                              <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                   <FinancialExperienceExtension>
                                        <AssetValue>30000</AssetValue>
                                   </FinancialExperienceExtension>
                              </OLifEExtension>
                         </FinancialExperience>
                         <FinancialExperience>
                              <InvestmentType tc="3">Stock</InvestmentType>
                              <YearsOfInvestmentExperience>1</YearsOfInvestmentExperience>
                              <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                   <FinancialExperienceExtension>
                                        <AssetValue>5000</AssetValue>
                                   </FinancialExperienceExtension>
                              </OLifEExtension>
                         </FinancialExperience>
                         <FinancialExperience>
                              <InvestmentType tc="2">Bond</InvestmentType>
                              <YearsOfInvestmentExperience>6</YearsOfInvestmentExperience>
                              <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                   <FinancialExperienceExtension>
                                        <AssetValue>50000</AssetValue>
                                   </FinancialExperienceExtension>
                              </OLifEExtension>
                         </FinancialExperience>
                         <FinancialExperience>
                              <InvestmentType tc="15">Variable Annuities</InvestmentType>
                              <YearsOfInvestmentExperience>4</YearsOfInvestmentExperience>
                              <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                   <FinancialExperienceExtension>
                                        <AssetValue>50000</AssetValue>
                                   </FinancialExperienceExtension>
                              </OLifEExtension>
                         </FinancialExperience>
                         <FinancialExperience>
                              <InvestmentType tc="6">Mutual Funds</InvestmentType>
                              <YearsOfInvestmentExperience>0</YearsOfInvestmentExperience>
                              <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                   <FinancialExperienceExtension>
                                        <AssetValue>0</AssetValue>
                                   </FinancialExperienceExtension>
                              </OLifEExtension>
                         </FinancialExperience>
                         <FinancialExperience>
                              <InvestmentType tc="1009800001">Cash</InvestmentType>
                              <YearsOfInvestmentExperience>20</YearsOfInvestmentExperience>
                              <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                   <FinancialExperienceExtension>
                                        <AssetValue>100000</AssetValue>
                                   </FinancialExperienceExtension>
                              </OLifEExtension>
                         </FinancialExperience>
                         <FinancialExperience>
                              <InvestmentType tc="2147483647">Other</InvestmentType>
                              <YearsOfInvestmentExperience>0</YearsOfInvestmentExperience>
                              <OLifEExtension VendorCode="05" ExtensionCode="FinancialExperience">
                                   <FinancialExperienceExtension>
                                        <AssetValue>0</AssetValue>
                                   </FinancialExperienceExtension>
                              </OLifEExtension>
                         </FinancialExperience>
                    </Risk>
                    <Employment EmployerPartyID="Party4">
                         <OccupClass tc="1009800001">Employed</OccupClass>
                         <Occupation>Solution Architect</Occupation>
                         <EmployerName>AXA</EmployerName>
                         <YearsAtEmployment>15</YearsAtEmployment>
                    </Employment>
                    <GovtIDInfo>
                         <GovtID>123456789</GovtID>
                         <GovtIDTC tc="17">Passport</GovtIDTC>
                         <GovtIDExpDate>2015-08-24</GovtIDExpDate>
                         <Nation tc="1">USA</Nation>
                         <Jurisdiction tc="35">New Jersey</Jurisdiction>
                    </GovtIDInfo>
               </Party>
               <Party id="Party2">
                    <PartyTypeCode tc="1">Person</PartyTypeCode>
                    <PartySysKey>ProfileID456</PartySysKey>
                    <Person>
                         <FirstName>Jacqueline</FirstName>
                         <LastName>Doe</LastName>
                         <MarStat tc="1">Married</MarStat>
                         <Gender tc="2">Female</Gender>
                         <BirthDate>1975-05-07</BirthDate>
                         <EducationType tc="3">Associate Degree</EducationType>
                         <Citizenship tc="1">USA</Citizenship>
                         <DriversLicenseNum>D987654321</DriversLicenseNum>
                         <DriversLicenseState tc="35">New Jersey</DriversLicenseState>
                         <ImmigrationStatus tc="8">Citizen</ImmigrationStatus>
                         <DriversLicenseExpDate>2012-05-25</DriversLicenseExpDate>
                         <OLifEExtension VendorCode="05" ExtensionCode="Person">
                              <PersonExtension>
                                   <NoDriversLicenseInd tc="0">False</NoDriversLicenseInd>
                              </PersonExtension>
                         </OLifEExtension>
                    </Person>
                    <Address>
                         <Line1>125 Finn Lane</Line1>
                         <City>North Brunswick</City>
                         <AddressStateTC tc="35">New Jersey</AddressStateTC>
                         <Zip>08902</Zip>
                    </Address>
                    <Phone>
                         <PhoneTypeCode tc="1">Home</PhoneTypeCode>
                         <DialNumber>732456789</DialNumber>
                    </Phone>
                    <Risk>
                         <HHFamilyInsurance>
                              <HHFamilyInsuranceSysKey>1</HHFamilyInsuranceSysKey>
                              <DeclinedInd tc="0">False</DeclinedInd>
                              <LineOfBusiness tc="1">Life Insurance</LineOfBusiness>
                         </HHFamilyInsurance>
                    </Risk>
                    <Employment>
                         <OccupClass tc="4">Unemployed</OccupClass>
                    </Employment>
                    <GovtIDInfo>
                         <GovtID>987654321</GovtID>
                         <GovtIDTC tc="17">Passport</GovtIDTC>
                         <GovtIDExpDate>2015-08-24</GovtIDExpDate>
                         <Nation tc="1">USA</Nation>
                         <Jurisdiction tc="35">New Jersey</Jurisdiction>
                    </GovtIDInfo>
               </Party>
               <Party id="Party3">
                    <PartyTypeCode tc="1">Person</PartyTypeCode>
                    <Person>
                         <FirstName>Joe</FirstName>
                         <LastName>Doe</LastName>
                         <Age>15</Age>
                    </Person>
               </Party>
               <Party id="Party4">
                    <Person/>
                    <Address>
                         <Line1>425 Washington Blvd.</Line1>
                         <City>Jersey City</City>
                         <AddressStateTC tc="35">New Jersey</AddressStateTC>
                         <Zip>07302</Zip>
                    </Address>
               </Party>
               <Relation OriginatingObjectID="Grouping1" id="Relation1" RelatedObjectID="Party1">
                    <OriginatingObjectType tc="16">Grouping</OriginatingObjectType>
                    <RelatedObjectType tc="6">Party</RelatedObjectType>
                    <RelationRoleCode tc="30">Member</RelationRoleCode>
               </Relation>
               <Relation OriginatingObjectID="Grouping1" id="Relation2" RelatedObjectID="Party2">
                    <OriginatingObjectType tc="16">Grouping</OriginatingObjectType>
                    <RelatedObjectType tc="6">Party</RelatedObjectType>
                    <RelationRoleCode tc="30">Member</RelationRoleCode>
               </Relation>
               <Relation OriginatingObjectID="Party1" id="Relation3" RelatedObjectID="Party3">
                    <OriginatingObjectType tc="6">Party</OriginatingObjectType>
                    <RelatedObjectType tc="6">Party</RelatedObjectType>
                    <RelationRoleCode tc="40">Dependant</RelationRoleCode>
               </Relation>
               <Relation OriginatingObjectID="Holding1" id="Relation4" RelatedObjectID="Party1">
                    <OriginatingObjectType tc="4">Holding</OriginatingObjectType>
                    <RelatedObjectType tc="6">Party</RelatedObjectType>
                    <RelationRoleCode tc="8">Owner</RelationRoleCode>
               </Relation>
               <Relation OriginatingObjectID="Holding1" id="Relation5" RelatedObjectID="Party2">
                    <OriginatingObjectType tc="4">Holding</OriginatingObjectType>
                    <RelatedObjectType tc="6">Party</RelatedObjectType>
                    <RelationRoleCode tc="184">Joint Owner</RelationRoleCode>
               </Relation>
               <Relation OriginatingObjectID="Form1" id="Relation6" RelatedObjectID="Party1">
                    <OriginatingObjectType tc="101">FormInstance</OriginatingObjectType>
                    <RelatedObjectType tc="6">Party</RelatedObjectType>
                    <RelationRoleCode tc="107">Form For</RelationRoleCode>
               </Relation>
               <FormInstance id="Form1">
                    <FormResponse>
                         <ResponseText>No</ResponseText>
                         <QuestionType tc="1009800001">Is the Client/Owner with an interest in the account either: (A) a senior military, governmental, or political official in a non-U.S. country, or (B) closely associated with or an immediate family member of such official?</QuestionType>
                    </FormResponse>
                    <FormResponse>
                         <ResponseText>Yes</ResponseText>
                         <QuestionType tc="1009800005">I am familiar with the product(s) being sold and have determined proper suitability. For deferred variable annuity purchases only: I have reasonable grounds for believing that the recommendations for this customer to purchase/exchange an annuity is suitable on the basis of the facts disclosed by the customer as to his/her investments, insurance products and financial situation and needs.</QuestionType>
                    </FormResponse>
               </FormInstance>
          </OLifE>
     </TXLifeRequest>
</TXLife>');
/

It's a really bad idea to assemble XML using strings and string concatenation in SQL or PL/SQL. First there is a 4K limit in SQL, and 32K limit in PL/SQL, which means you end up constructing the XML in chunks, adding uneccessary complications. 2nd you cannot confirm the XML is valid or well formed using external tools.
IMHO it makes much more sense to keep the XML content seperated from the SQL / PL/SQL code
When the XML can be stored a File System accessable from the database, The files can be loaded into the database using mechansims like BFILE.
In cases where the XML must be staged on a remote file system, the files can be loaded into the database using FTP or HTTP and in cases where this is not an option, SQLLDR.
-Mark

Similar Messages

  • How to insert  data into BLOB column  using sql

    Hi all,
    How to insert data into BLOB column directly using sql .
    create  table temp
      a blob,
      b clob);
    SQL> /
    Insert into temp  values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ;
    ERROR at line 1:
    ORA-01465: invalid hex number
    Please help in this.Thanks,
    P Prakash

    see this
    How to store PDF file in BLOB column without using indirect datastore

  • 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).

  • Its very urgent:how to insert data into database tables

    Hi All,
    I am very new to oaf.
    I have one requirement data insert into database tables.
    here createPG having data that data insert into one custom table.
    but i dont know how to insert data into database tables.
    i wrote the code in am,co as follows.
    in am i wrote the code:
    public void NewoperationManagerLogic()
    ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
    OADBTransaction oadbt=getOADBTransaction();
    if(!vo1.isPreparedForExecution())
    vo1.executeQuery();
    Row row=vo1.createRow();
    vo1.insertRow(row);
    in createPG processrequest co:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.NewoperationManagerLogic();
    process form request:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("Submit")!=null)
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.getOADBTransaction().commit();
    please help with an example(sample code).
    its very urgent.
    thanks in advance
    Seshu
    Edited by: its urgent on Dec 25, 2011 9:31 PM

    Hi ,
    1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
    2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
    3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
    You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
    Thanks
    Pratap

  • How to insert data into two tables linke with foreign key..

    I have two tables
    1)EMP(emp_ID,username,emp_type_code)
    emp_ID is primary key, emp_type_code is a foreign key references emptype table.
    2)emptype(emp_type_code,emp_type_descripton)
    emp_type_code is primary key
    Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..

    CREATE TABLE "CATDB"."DWDIMUSER"
    "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_ID" NUMBER(10,0),
    "FULLNAME" VARCHAR2(20 BYTE),
    "FNAME" VARCHAR2(20 BYTE),
    "LNAME" VARCHAR2(20 BYTE),
    "USER_SUBTYPE" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
    CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
    CREATE TABLE "CATDB"."DIMSPECIALTY"
    "SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_NAME" VARCHAR2(100 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
    SELECT DISTINCT
    Engineer AS FullName,
    regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
    regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
    'Engineer'
    FROM EMPLOYEELOOKUP;
    INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
    SELECT DISTINCT SPECIALITY
    FROM EMPLOYEELOOKUP;
    COMMIT;
    CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
    CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
    "EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ENGINEER" VARCHAR2(25 BYTE),
    "SPECIALTY" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    DATA IN EMPLOYEELOOKUP
    Engineer, Specialty,
    John, Dow, Electronis,
    Dow, Jons, Technician
    Stan Smithers Sales
    Mark, Richards Marketing
    Jenny, Lane Marketing
    John, Lee Sales
    I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
    BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.

  • How to insert large xml file to XMLType column?

    Hi,
    I have a table with one column as XMLType(Binary XML storage option and Free Text Indexing). When i try to insert a large XML as long as 8kb, i'm getting an error ORA-01704:string literal too long.
    Insert into TEST values(XMLTYPE('xml HERE'));
    How to insert large XML values to XMLType column?
    Regards,
    Sprightee

    For a large XML file, you basically have two options - you can load the string directly as an XMLType, or you can load the string as a CLOB and cast it on the database side to an XMLType.
    If you decide to load the XML as XmlType client-side, then you may be interested to know that versions of Oracle after 11.2.0.2 support the JDBC 4.0 SQLXML standard. See the JDBC driver release documentation here:
    http://docs.oracle.com/cd/E18283_01/java.112/e16548/jdbcvers.htm#BABGHBCC
    If you want to load as a CLOB, then you'll need to use PreparedStatement's setClob() method, or allocate an oracle.sql.clob object.
    For versions before 11.2.0.2, you can create an XMLType with a constructor that includes an InputStream or byte[] array.
    HTH
    Edited by: 938186 on Jun 23, 2012 11:43 AM

  • How to insert data to the specified row column of the multi column list box

    Hi All
    How do i insert data into the specified column of the multi cplumn list box?
    I have a table that containsall station nos and name.Then another table contains the data the various stations having at  for 24 hrs.That is 12 am to 11 pm.
    And i want to display each stations details as follows using a multi column list box/table
    My stationinfo table
    stnno   stnname......................
    s1           stn1
    s2            stn2
    s3             stn3
    The other table
    stnno      sysdatetime       data
    s1             12am                   1
    s2              12am                   4
    s1               1  am                 2
    So the station s1,s2.... will have data for 24 hrs.
    And i want to display it as follows using a multicolumn listbox
    stnname        12am   1 am ......................................11pm
    s1                   ...................
    s2                 ........................
    What i have in my  mind is to get all station nos
    and in a for loop get the station's data from 12 am to 11 pm
    or
    select every statios data for each hor.But in this case i have to query the database 24 times.So i dont think its a good way.
    Or any other better query available?
    Can anybody suggest me a good idea?
    One more thing...how to insert data into the specified field row or column of a multi column list box?
    Thanks in advance

    hi
    i want to know,,can u say ur need clearly...and i attached two image u see that one
    Indrajit
    | [email protected] | [email protected] .
    Attachments:
    station.JPG ‏35 KB
    station2.JPG ‏79 KB

  • How to insert data into a table from an xml document

    using the XmlSql Utility, how do I insert data into a table from an xml document, using the sqlplus prompt.
    if i use the xmlgen.insertXML(....)
    requires a CLOB file, which i dont have, only the xml doc.
    Cant i insert directly from the doc to the table?
    the xmlgen examples I have seen first convert a table to a CLOB xmlString and then insert it into another table.
    Isnt there any other way?

    Your question is little perplexing.
    If you're using XML SQL Utility from
    the commandline, just use putXML.
    java OracleXML putXML
    null

  • How to insert data into table control

    hi experts,,
           i have inserted data into data base table through table control .
    now i want to insert data into table control through database table.
      how to delete data from table control for selected row

    Hi
    go through this link.
    http://www.****************/Tutorials/ABAP/TableControl/Demo.htm

  • How to insert date into ms access database using sql query in servlet

    sir all thing is working well now only tell me how we can insert date into ms access database which is input by user .
    insert into db2(bookname,studentname,date) values('"+bname+"','"+sname+"',date_format)";{code}
    or either the system date is inserted with query .
      plz help me
    thanx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    bhavishya wrote:
    sir all thing is working well now only tell me how we can insert date into ms access database which is input by user .
    insert into db2(bookname,studentname,date) values('"+bname+"','"+sname+"',date_format)";{code}
    or either the system date is inserted with query .
    plz help me
    thanxAnd that SQL statement is another reason to use PreparedStatement. I assume bname and sname are input from some form? Well, if that's the case, simply inserting them into SQL by simple String concatenation is just begging for all sorts of problems. What if there is an apostrophe in the entry? Broken Statement. Worse, it's a wide open invitation to an SQL Injection attack.

  • How to insert data into two tables at once using XSJS

    Hello Experts,
    My requirement is to insert data into two tables at once. I have a XS JS app and want to update these tables via xsjs. How can I do this ?
    Is there any mechanism like sql 'transactions' also in Hana ? If yes, how can I call it via xsjs ? If not, what are the ways to populate two different tables at once.
    Please advice. Any help is really appreciated.
    Thanks !

    There is nothing special about inserting into two tables at once in XSJS. Just issue two separate SQL Statements.  Don't execute the COMMIT until after both commands.  That way they are all one transaction.

  • How to insert data into the BLOB column

    Hi All,
    Can anyone help me to insert data into the BLOB data type column?
    The table structure is
    CREATE TABLE XXATFL_DM_FORCAST_STG
    TASK_ID NUMBER,
    USER_ID NUMBER,
    CREATED_BY NUMBER(15),
    CREATION_DATE DATE,
    LAST_UPDATED_BY NUMBER(15),
    LAST_UPDATE_DATE DATE,
    LAST_UPDATE_LOGIN NUMBER(15),
    RECORD_STATUS VARCHAR2(1 BYTE),
    ERROR_MESSAGE VARCHAR2(4000 BYTE),
    DATA_FILE BLOB
    I want to insert data in the DATA_FILE column. and this insert statement will in inside a procedure.
    Please help me as soon as possible as this is very urgent for me
    Thanks & Regards,
    Chandan

    i tried like this
    sql> insert into tbl values(1, utl_raw.cast_to_raw('D:\pictures\pic2.bmp'));
    1 record created.
    sql>select * from tbl;
    sp2-0678:Column or attribute type can not be displayed by SQL*PLUS
    sql>
    is this saving only path or bmp file on that path?
    if it is saving bmp file, in which format and how can we retrive it?
    Edited by: user8967883 on Mar 31, 2010 12:57 PM

  • How to insert date into a table by selecting form sysdate

    Hi
    My Table format is like this
    SQL>desc log;
    Name Null? Type
    EMP_ID VARCHAR2(30)
    LOGIN DATE
    LOGOUT DATE
    now when ever an employee logs in i w'd like to insert date into the table.
    i put up the following query
    SQL> insert into log(emp_id,login)
    2 values
    3 ('Ed_01',
    4 select
    5 sysdate
    6 from dual
    7 );
    select
    ERROR at line 4:
    ORA-00936: missing expression
    I got the above error how can i rectify that plz suggest me very urgently as i have to submit my project very early to my boss.

    try this :
    insert into log(emp_id,login) values ('Ed_01', sysdate);

  • How to insert data into newly added column

    Hi all,
    i am having a doubt how to insert entries into newly added column..
    i created a table with two columns and inserted the data into them then i altered the table by adding additional column.now i want to insert data into that..plz tell me how to do that..??
    thanks in advance..help me

    Small example:
    [email protected]> create table t(id int, id2 int);
    Table created.
    [email protected]> insert into t values (1,2);
    1 row created.
    [email protected]> insert into t values (2,2);
    1 row created.
    [email protected]> alter table t add id3 int;
    Table altered.
    [email protected]> select * from t;
    ID ID2 ID3
    1 2
    2 2
    [email protected]> update t
    2 set id3 = 10
    3 where id = 1;
    1 row updated.
    [email protected]> select * from t;
    ID ID2 ID3
    1 2 10
    2 2
    Best Regards
    Krystian Zieja / mob

  • How to insert data into a table only when data has changed its value (when compared to the previous inserted value)

    I wish to insert data into a table only when the value of the inserted data has changed. Thus, in a time series, if the value of the data at time, t-1, is 206 then if the data to be inserted at time t is 206, then it is skipped (not entered).
    If the value of the data at time t+1 is 206, it is skipped also; until the value changes, so if the value at t+1 was 205, then that would be inserted, and if at time t+2 the data is 206, it would be inserted too.
    What is the best way to do it without increasing overheads?

    This view works:
    SELECT
    i.IDNO,i.[Date],i.[Level]
    FROM
    mytable i
    INNER
    JOIN mytable
    d
    ON
    d.IDNO
    = i.IDNO-1
    WHERE
    i.[Level]
    <> d.[Level]
    on this mytable below.  A trigger could be quite useful here although I am cautious using them. However I wish to avoid the overhead by not having a temp table (which could be sizable).  mytable below
    should give 3 lines. The IDNO is an identity column.
    IDNO
    Item
    Date
    Level
    1
    X24
    12/23/13 10:41
    22996
    2
    X24
    12/23/13 10:41
    22996
    3
    X24
    12/23/13 9:21
    23256
    4
    X24
    12/23/13 9:21
    23256
    5
    X24
    12/23/13 9:22
    23256
    6
    X24
    12/23/13 9:22
    23256
    7
    X24
    12/23/13 9:22
    22916

Maybe you are looking for

  • Error while transporting 0MAT_PLANT

    Hi Experts I am getting error while transporting 0MAT-PLANT to Prod System.It going fine to QA system. it is giving the follwoing error with return code 8 Characteristic 0MAT_PLANT: Master data has to be activated before conversion Start of the after

  • Create directory on SAP application server with blanks

    Hi, is it possible and if so how to create within ABAP a directory on a Linux based SAP application server that contains blanks. We've tested with SXPG_COMMAND_EXECUTE but didn't succeeded. A working code snippet would be great. Thanks and kind regar

  • I am unable to load new version of firefox. I get error message.

    I get a message saying you can't open the document.icn or something like that. I go through whole installation process but when it asks to keep duplicate or replace it then gives me error message. Very frustrating. Happened with an earlier version bu

  • Dynamic variant for select option High value

    Hi , Please help me in creating dynamic variable for a select option date field high value. II tried the following method: 1. Enter the values in the selection screen 2. Save the variant using the SAVE button 3. In the next screen for the date variab

  • Problem with dual sim adapter! HELP!!!

    Hi everyone, I have dual sim adapter witch require sim cutting. So on my nokia 2600 it runs fine but on my nokia 6500 slide, it just wont work! Version of software on nokia 6500 slide is:v 06.60; 07-03-08; RM-240c) Nokia. The 6500 slide is runing fin