Unable to register XSD into Oracle using trigger / procedure

Hi,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.
I have a table which stores XSD and i need to register this XSD. I am able to register the XSD if dbms_schema is executed from PLSQL anonymous block. But if i mention the same code in trigger / procedure is not working . Getting the error as insufficient privileges.
Table, trigger and procedure are in same schema. This schema has all the privs required for XSD registration globally.
create table t_vkk ( n number, xsd xmltype)
alter table t_vkk add active varchar2(1)
create sequence seq_vkk start with 1 increment by 1
CREATE OR REPLACE TRIGGER TRG_t_vkk_xsd
AFTER INSERT OR UPDATE
ON t_vkk
REFERENCING OLD AS old NEW AS new
FOR EACH ROW
BEGIN
IF INSERTING AND :new.active = 'Y'
THEN
prc_reg_xsd(:new.n, :new.xsd);
END IF;
-- Applied when updating rows in the table
IF UPDATING
THEN
IF :new.active = 'Y' -- XSD re-registration since template id is still active
THEN
prc_reg_xsd(:old.n, :old.xsd);
ELSIF :new.active = 'N' -- XSD de-registration
THEN
BEGIN
dbms_xmlschema.deleteschema (
schemaurl => :old.n
, delete_option => dbms_xmlschema.delete_cascade_force
EXCEPTION
WHEN OTHERS
THEN
NULL; -- This XSD was not registered
END;
END IF;
END IF;
END TRG_t_vkk_xsd;
This fails -
insert into t_vkk
values (0,XMLTYPE(
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:books" xmlns:bks="urn:books">
<xsd:element name="books" type="bks:BooksForm"/>
<xsd:complexType name="BooksForm">
<xsd:sequence>
<xsd:element name="book" type="bks:BookForm" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="BookForm">
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="genre" type="xsd:string"/>
<xsd:element name="price" type="xsd:float"/>
<xsd:element name="pub_date" type="xsd:date"/>
<xsd:element name="review" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
</xsd:complexType>
</xsd:schema>'
), 'Y')
This works :
After inserting the record into t_vkk (Trigger is disabled)
declare
begin
for x in (select * from t_vkk)
loop
dbms_output.put_line (x.xsd.getstringval());
BEGIN
dbms_xmlschema.deleteschema (
schemaurl => x.n
, delete_option => dbms_xmlschema.delete_cascade_force
EXCEPTION
WHEN OTHERS
THEN
NULL; -- This XSD was not registered
END;
dbms_xmlschema.registerschema (schemaurl => x.n
, schemadoc => x.xsd
, local => false);
end loop;
end;
This Fails:
create or replace procedure prc_reg_xsd
as
begin
for x IN (select * from t_vkk)
loop
BEGIN
dbms_xmlschema.deleteschema (
schemaurl => x.n
, delete_option => dbms_xmlschema.delete_cascade_force
EXCEPTION
WHEN OTHERS
THEN
NULL; -- This XSD was not registered
END;
dbms_xmlschema.registerschema (schemaurl => x.n
, schemadoc => x.xsd
, local => false);
end loop;
end;
BEGIN
prc_reg_xsd;
END;
-Vinod K

Thanks everyone. I got the solution from one of my colleague. I can invoke dbms_xmlschema.registerschema through my standalone procedure by using current_user authid.
create or replace procedure prc_reg_xsd
(in_id IN NUMBER
, in_xsd IN XMLTYPE)
authid current_user
as
begin
dbms_output.put_line (' startd');
BEGIN
dbms_xmlschema.deleteschema (
schemaurl => in_id
, delete_option => dbms_xmlschema.delete_cascade_force
EXCEPTION
WHEN OTHERS
THEN
dbms_output.put_line (' Failed'); -- This XSD was not registered
END;
dbms_xmlschema.registerschema (schemaurl => in_id
, schemadoc => in_xsd
, local => false);
dbms_output.put_line (' done');
end;
DECLARE
x number:=9;
t xmltype := XMLTYPE(
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:books" xmlns:bks="urn:books">
<xsd:element name="books" type="bks:BooksForm"/>
<xsd:complexType name="BooksForm">
<xsd:sequence>
<xsd:element name="book" type="bks:BookForm" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="BookForm">
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="genre" type="xsd:string"/>
<xsd:element name="price" type="xsd:float"/>
<xsd:element name="pub_date" type="xsd:date"/>
<xsd:element name="review" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
</xsd:complexType>
</xsd:schema>');
BEGIN
prc_reg_xsd(x,t);
END;
This worked for me. The procedure is in the same schema which has XDBADMIN role. So i am able to register the XSD.
Vinod

Similar Messages

  • How to import csv data into Oracle using c#

    Hello,
    How to import csv data into Oracle using c #. Where data to be imported 3GB in size and number of rows 7512263. I've managed to import csv data into Oracle, but the time it takes about 1 hour. How to speed up the time it takes to import csv data into oracle. Thank you.
    This is my code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    using System.Threading;
    using System.Text.RegularExpressions;
    using System.IO;
    using FileHelpers;
    using System.Data.OracleClient;
    namespace sqlloader
    class Program
    static void Main(string[] args)
    int jum;
    int i;
    bool isFirstLine = false;
    FileHelperEngine engine = new FileHelperEngine(typeof(XL_XDR));
    //Connect To Database
    string constr = "Data Source=(DESCRIPTION=(ADDRESS_LIST="
    + "(ADDRESS=(PROTOCOL=TCP)(HOST= pt-9a84825594af )(PORT=1521 )))"
    + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=o11g)));"
    + "User Id=xl;Password=rahasia;";
    OracleConnection con = new OracleConnection(constr);
    con.Open();
    // To Read Use:
    XL_XDR[] res = engine.ReadFile("DataOut.csv") as XL_XDR[];
    jum = CountLinesInFile("DataOut.csv");
    FileInfo f2 = new FileInfo("DataOut.csv");
    long s2 = f2.Length;
    int jmlRecord = jum - 1;
    for (i = 0; i < jum; i++)
    ShowPercentProgress("Processing...", i, jum);
    Thread.Sleep(100);
    if (isFirstLine == false)
    isFirstLine = true;
    else
    string sql = "INSERT INTO XL_XDR (XDR_ID, XDR_TYPE, SESSION_START_TIME, SESSION_END_TIME, SESSION_LAST_UPDATE_TIME, " +
    "SESSION_FLAG, VERSION, CONNECTION_ROW_COUNT, ERROR_CODE, METHOD, HOST_LEN, HOST, URL_LEN, URL, CONNECTION_START_TIME, " +
    "CONNECTION_LAST_UPDATE_TIME, CONNECTION_FLAG, CONNECTION_ID, TOTAL_EVENT_COUNT, TUNNEL_PAIR_ID, RESPONSIVENESS_TYPE, " +
    "CLIENT_PORT, PAYLOAD_TYPE, VIRTUAL_TYPE, VID_CLIENT, VID_SERVER, CLIENT_ADDR, SERVER_ADDR, CLIENT_TUNNEL_ADDR, " +
    "SERVER_TUNNEL_ADDR, ERROR_CODE_2, IPID, C2S_PKTS, C2S_OCTETS, S2C_PKTS, S2C_OCTETS, NUM_SUCC_TRANS, CONNECT_TIME, " +
    "TOTAL_RESP, TIMEOUTS, RETRIES, RAI, TCP_SYNS, TCP_SYN_ACKS, TCP_SYN_RESETS, TCP_SYN_FINS, EVENT_TYPE, FLAGS, TIME_STAMP, " +
    "EVENT_ID, EVENT_CODE) VALUES (" +
    "'" + res.XDR_ID + "', '" + res[i].XDR_TYPE + "', '" + res[i].SESSION_START_TIME + "', '" + res[i].SESSION_END_TIME + "', " +
    "'" + res[i].SESSION_LAST_UPDATE_TIME + "', '" + res[i].SESSION_FLAG + "', '" + res[i].VERSION + "', '" + res[i].CONNECTION_ROW_COUNT + "', " +
    "'" + res[i].ERROR_CODE + "', '" + res[i].METHOD + "', '" + res[i].HOST_LEN + "', '" + res[i].HOST + "', " +
    "'" + res[i].URL_LEN + "', '" + res[i].URL + "', '" + res[i].CONNECTION_START_TIME + "', '" + res[i].CONNECTION_LAST_UPDATE_TIME + "', " +
    "'" + res[i].CONNECTION_FLAG + "', '" + res[i].CONNECTION_ID + "', '" + res[i].TOTAL_EVENT_COUNT + "', '" + res[i].TUNNEL_PAIR_ID + "', " +
    "'" + res[i].RESPONSIVENESS_TYPE + "', '" + res[i].CLIENT_PORT + "', '" + res[i].PAYLOAD_TYPE + "', '" + res[i].VIRTUAL_TYPE + "', " +
    "'" + res[i].VID_CLIENT + "', '" + res[i].VID_SERVER + "', '" + res[i].CLIENT_ADDR + "', '" + res[i].SERVER_ADDR + "', " +
    "'" + res[i].CLIENT_TUNNEL_ADDR + "', '" + res[i].SERVER_TUNNEL_ADDR + "', '" + res[i].ERROR_CODE_2 + "', '" + res[i].IPID + "', " +
    "'" + res[i].C2S_PKTS + "', '" + res[i].C2S_OCTETS + "', '" + res[i].S2C_PKTS + "', '" + res[i].S2C_OCTETS + "', " +
    "'" + res[i].NUM_SUCC_TRANS + "', '" + res[i].CONNECT_TIME + "', '" + res[i].TOTAL_RESP + "', '" + res[i].TIMEOUTS + "', " +
    "'" + res[i].RETRIES + "', '" + res[i].RAI + "', '" + res[i].TCP_SYNS + "', '" + res[i].TCP_SYN_ACKS + "', " +
    "'" + res[i].TCP_SYN_RESETS + "', '" + res[i].TCP_SYN_FINS + "', '" + res[i].EVENT_TYPE + "', '" + res[i].FLAGS + "', " +
    "'" + res[i].TIME_STAMP + "', '" + res[i].EVENT_ID + "', '" + res[i].EVENT_CODE + "')";
    OracleCommand command = new OracleCommand(sql, con);
    command.ExecuteNonQuery();
    Console.WriteLine("Successfully Inserted");
    Console.WriteLine();
    Console.WriteLine("Number of Row Data: " + jmlRecord.ToString());
    Console.WriteLine();
    Console.WriteLine("The size of {0} is {1} bytes.", f2.Name, f2.Length);
    con.Close();
    static void ShowPercentProgress(string message, int currElementIndex, int totalElementCount)
    if (currElementIndex < 0 || currElementIndex >= totalElementCount)
    throw new InvalidOperationException("currElement out of range");
    int percent = (100 * (currElementIndex + 1)) / totalElementCount;
    Console.Write("\r{0}{1}% complete", message, percent);
    if (currElementIndex == totalElementCount - 1)
    Console.WriteLine(Environment.NewLine);
    static int CountLinesInFile(string f)
    int count = 0;
    using (StreamReader r = new StreamReader(f))
    string line;
    while ((line = r.ReadLine()) != null)
    count++;
    return count;
    [DelimitedRecord(",")]
    public class XL_XDR
    public string XDR_ID;
    public string XDR_TYPE;
    public string SESSION_START_TIME;
    public string SESSION_END_TIME;
    public string SESSION_LAST_UPDATE_TIME;
    public string SESSION_FLAG;
    public string VERSION;
    public string CONNECTION_ROW_COUNT;
    public string ERROR_CODE;
    public string METHOD;
    public string HOST_LEN;
    public string HOST;
    public string URL_LEN;
    public string URL;
    public string CONNECTION_START_TIME;
    public string CONNECTION_LAST_UPDATE_TIME;
    public string CONNECTION_FLAG;
    public string CONNECTION_ID;
    public string TOTAL_EVENT_COUNT;
    public string TUNNEL_PAIR_ID;
    public string RESPONSIVENESS_TYPE;
    public string CLIENT_PORT;
    public string PAYLOAD_TYPE;
    public string VIRTUAL_TYPE;
    public string VID_CLIENT;
    public string VID_SERVER;
    public string CLIENT_ADDR;
    public string SERVER_ADDR;
    public string CLIENT_TUNNEL_ADDR;
    public string SERVER_TUNNEL_ADDR;
    public string ERROR_CODE_2;
    public string IPID;
    public string C2S_PKTS;
    public string C2S_OCTETS;
    public string S2C_PKTS;
    public string S2C_OCTETS;
    public string NUM_SUCC_TRANS;
    public string CONNECT_TIME;
    public string TOTAL_RESP;
    public string TIMEOUTS;
    public string RETRIES;
    public string RAI;
    public string TCP_SYNS;
    public string TCP_SYN_ACKS;
    public string TCP_SYN_RESETS;
    public string TCP_SYN_FINS;
    public string EVENT_TYPE;
    public string FLAGS;
    public string TIME_STAMP;
    public string EVENT_ID;
    public string EVENT_CODE;
    I hope someone can give me a solution. Thanks

    The fastest way is to use external tables or sql loader (sqlldr). (If you use external tables or sql loader, you don't use C# at all).

  • I cannot log into oracle using the user scott

    I installed oracle, but I did not go through the underlined step. I am not sure if I skipped or it was not there during the installation
    The Database Configuration Assistant will provide installation summary
    and list the accounts that are unlocked. It will ask you for password management. Sys
    and System accounts would be already unlocked.  Unlock HR and Scott accounts,
    and for these two accounts also specify the same password that you had given before.
    When I test logging into Oracle using the user Scott, it shuts down.
    I am using windows 7, and I installed Oracle Database 10g Release 2 (10.2.0.1.0)
    Enterprise/Standard Edition for Microsoft Windows (32-bit)
    How can I log into oracle using the user Scott?

    Hi,
    Welcome to the forum,
    After installing Oracle 10g SCOTT user will be in locked, you should unlock it.
    Login as sysdba using the below command
    sqlplus sys as sysdba
    password:<ur password>
    after connecting as sysdba use the below command to unlock the SCOTT user
    ALTER USER SCOTT ACCOUNT UNLOCK;
    Now connect as scott you will bw able to connect.
    hari

  • I have brought ipad 2 from USA to INDIA(32 GB WIFI). I am unable to register with app store using my credit card using india details. Pls help.

    I have brought ipad 2 from USA to INDIA(32 GB WIFI). I am unable to register with app store using my credit card using india details. Pls help.

    You cannot. To open an account on a different iTunes country you must have a valid credit card issued from a bank in that country. You must have a billing address in that country, as well.
    There are reasons why some apps are not available in all iTunes stores.

  • How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?

    Hi
    How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
    This is my Input data.
    11/25/2007.
    By using below query, it is inserted into database.
    sql>Insert into tblname values(to_date('11/25/2007','MM/DD/YYYY'));
    But using stored procedure, the same query is not running.
    It shows error like
    ORA-01843: not a valid month ORA-06512: at line 1
    Procedure:
    create or replace procedure Date_Test(datejoin in DATE) is
    begin
    insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    end Date_Test;
    I had used 'nls_date_language = american' also.
    Prcodeure is created but not worked in jsp. The same error is thrown.
    Pls provide a solution

    This might help you....
    SQL> Create Table DateTest(col1 Date);
    Table created.
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    BEGIN Date_Test('11/25/2007'); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    BEGIN Date_Test(To_Date('11/25/2007','mm/dd/yyyy')); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at "CTBATCH.DATE_TEST", line 3
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(datejoin);
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> Select * from DateTest;
    COL1
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in VarChar2) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'mm/dd/yyyy'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select * from DateTest;
    COL1
    25-NOV-07
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL>

  • Unable to register ORACLE_HOME into global orainventory

    Hi,
    I am unable to register my rdbms_oracle_home in global orainventory.
    I am getting the velow error.
    ERROR: Error in fixing ORACLE_HOME index
    java.io.FileNotFoundException: /u04/Rel11i/devdb/9.2.0/inventory/ContentsXML/comps.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:91)
    at java.io.FileInputStream.<init>(FileInputStream.java:54)
    at oracle.apps.ad.util.OUISetup.fixHomeIdx(OUISetup.java:293)
    at oracle.apps.ad.util.OUISetup.main(OUISetup.java:1347)
    Removing OUI entries from the global inventory: /etc/oraInventory/ContentsXML/comps.xml
    Registering the OUI component with local inventory...
    ERROR: Exception while registering OUI 2.2 Component in the inventory.
    java.io.FileNotFoundException: /u04/Rel11i/devdb/9.2.0/inventory/ContentsXML/comps.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:91)
    at oracle.apps.ad.util.OUISetup.registerOuiComp(OUISetup.java:913)
    at oracle.apps.ad.util.OUISetup.main(OUISetup.java:1349)
    The error is due to missing "inventory" directory in RDBMS $ORACLE_HOME.
    But the IAS$ORACLE_HOME is fine.
    Is there any way to create this directory or we need to reinstall Oracle_home. if yes then how do we do that. Currently we are on 9.2.0.6. Do I need to reinstall it ?
    Regards,
    Farhat

    So, what is the difference between this and using 'rapidwiz -techstack'? We never discussed this option in this thread ? Moreover what's the point in installing and redoing the work just for Inventory? Can you explain, if I can do the task in 5 min, why should I spend 50 min on it. Anyways that's my opinion.
    Thanks

  • Bulk insert into oracle using ssis

    Hi ,
    Can someone please suggest me the way to Bulk insert data into oracle database? I'm using oledb which doesnt support bulk insert into oracle.
    Pls note I cant use Oracle ATTUnity as it requires enterprise edition but i have only Standard edition and hence that option is ruled out.
    Is there any other way that I can accompolish BULK insert?
    Please help me out.
    Thanks,
    Prabhu

    Hi Prabhu,
    I am very late to help you solve the query but following is the solution to 'Bulk Insert into Oracle' that worked for me.
    To use below code for SSIS 2008 R2 in a
    Script Task component you would need following API references.
    Prerequisites:
    1. C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.DTSRuntimeWrap.dll
    2. Install "Oracle Data Provider For .NET 11.2.0.1.0" and add a reference to
    Oracle.DataAccess.dll.
       Microsoft SQL Server Integration Services Script Task
       Write scripts using Microsoft Visual C# 2008.
       The ScriptMain is the entry point class of the script.
     *  Description : SQL to Oracle Bulk Copy/Insert
     *  Created By  : Mitulkumar Brahmbhatt
     *  Created Date: 08/14/2014
     *  Modified Date   Modified By     Description
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    using Oracle.DataAccess.Client;
    using Microsoft.SqlServer.Dts.Runtime.Wrapper;
    using System.Data.OleDb;
    namespace ST_6e18a76102dd4312868504c4ef95279d.csproj
        [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
        public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
            #region VSTA generated code
            enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
                Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
            #endregion
            public void Main()
                ConnectionManager cm;
                IDTSConnectionManagerDatabaseParameters100 cmParams;
                OleDbConnection oledbConn;
                DataSet ds = new DataSet();
                string sql;
                try
                    /********** Pull Sql Source Data into a Dataset *************/
                    cm = Dts.Connections["SRC_CONN"];
                    cmParams = cm.InnerObject as IDTSConnectionManagerDatabaseParameters100;
                    oledbConn = (OleDbConnection)cmParams.GetConnectionForSchema() as OleDbConnection;
                    sql = @"Select * from [sourcetblname]'';
                    OleDbCommand sqlComm = new OleDbCommand(sql, oledbConn);
                    OleDbDataAdapter da = new OleDbDataAdapter(sqlComm);
                    da.Fill(ds);
                    cm.ReleaseConnection(oledbConn);
                    /***************** Bulk Insert to Oracle *********************/
                    cm = Dts.Connections["DEST_CONN"];
                    cmParams = cm.InnerObject as IDTSConnectionManagerDatabaseParameters100;
                    string connStr = ((OleDbConnection)cmParams.GetConnectionForSchema() as OleDbConnection).ConnectionString;
                    cm.ReleaseConnection(oledbConn);
                    sql = "destinationtblname";
                    using (OracleBulkCopy bulkCopy = new OracleBulkCopy(connStr.Replace("Provider=OraOLEDB.Oracle.1", "")))
                        bulkCopy.DestinationTableName = sql;
                        bulkCopy.BatchSize = 50000;
                        bulkCopy.BulkCopyTimeout = 20000;
                        bulkCopy.WriteToServer(ds.Tables[0]);
                    /***************** Return Result - Success *********************/
                    Dts.TaskResult = (int)ScriptResults.Success;
                catch (Exception x)
                    Dts.Events.FireError(0, "BulkCopyToOracle", x.Message, String.Empty, 0);
                    Dts.TaskResult = (int)ScriptResults.Failure;
                finally
                    ds.Dispose();
    Mitulkumar Brahmbhatt | Please mark the post(s) that answered your question.

  • I want to load data into Oracle using XML & Java - hints??

    I have a XML files that are created on a timed basis....they describe a photo and point to a dir where the photo is stored...like...
    <image>
    <user>bill</user>
    <img>photo.jpg</img>
    <img_dir>'/tmp/photos'</img_dir>
    </image>
    I'd like to write a Java program that parses the XML and loads the images, data into Oracle.
    Suggestions on Oracle tools, downloads that will help me accomplish this???
    Thanks!

    Depending on whether you want assistance in doing the insert into the database or whether you don't mind writing the JDBC code to perform the insert, you can get by with only our XML Parser for Java v2, which implements SAX, DOM, XPath, and XSLT standards. The latest beta release (2.1.0) supports SAX2 and DOM2.
    If you want help inserting the XML into tables, then in addition to this, you might want our XML SQL Utility as well.
    http://technet.oracle.com/tech/xml
    Steve Muench
    Lead Product Manager for BC4J and Lead XML Evangelist
    Author, Building Oracle XML Applications
    null

  • How to pass xml data as objects into Database using store procedures

    Hi All,
         I don't have much knowledge on store procedure,can anybody help how to pass the xml as objects in Database using store procedure.
    My Requirement is I have a table with three fields EMPLOYEE is table name and the fields are EMP_ID,EMP_TYPE AND EMP_DET,I have to insert the employees xml data into corresponding fields in the table.
    Input Data
    <ROWSET>
       <ROW>
         <EMP_ID>7000</EMP_ID>
          <EMP_TYPE>TYPE1</EMP_TYPE>
         <EMP_DET>DEP</EMP_DET>
      <ROW>
      <ROW>
         <EMP_ID>7000</EMP_ID>
         <EMP_TYPE>TYPE2</EMP_TYPE>
        <EMP_DET>DEP2</EMP_DET>
    <ROW>
    <ROW>
         <EMP_ID>7000</EMP_ID>
         <EMP_TYPE>TYPE3</EMP_TYPE>
        <EMP_DET>DEP3</EMP_DET>
    <ROW>
    <ROWSET>
    So each row values has to inserted into resp fields in the table.
    Regards
    Mani

    Do you have a similar structure in your stored procedure ?
    In that case you can simply call the procedure from soa using db adapter and do a mapping to assign the values.

  • Unable to insert rows into ORACLE database using ABAP code

    Hai,
    I am facing problem while creating a table in Oracle database with 15 attributes in a table. To create a table I am using the classes:
                      cl_sql_connection  -
    > to create the connection           
                      cl_sql_statement  -
    > to execute the query
    This I used by reffering the SAP program ADBC_DEMO. Without any trouble I am able to create a Table with 6 attributes by following the same procedure in ABCD_DEMO program but the same is not working for the table with 15 attributes .
    Please help me.
    Regards,
    Swetha

    Hai,
    here is my code.
    DATA: V_con_name TYPE dbcon-con_name,
          con_ref TYPE REF TO cl_sql_connection,
          sqlerr_ref TYPE REF TO cx_sql_exception,
          c_tabname  TYPE string VALUE `TO_DETAILS`,
          c_coldefs  TYPE string.
    DATA: IT_ORA LIKE ZVOP_X_ORA_UPDATE OCCURS 0 WITH HEADER LINE.
       V_CON_NAME = 'TVL-DSS-01'.
       concatenate '(LGNUM CHAR(3) primary key,'
                     'TANUM VARCHAR2(10),'
                     'FLAG  CHAR(1),'
                     'BDATU timestamp(3),'
                     'TAPOS VARCHAR2(4),'
                     'MATNR CHAR(18))'
                      'VLQNR VARCHAR2(10),'
                      'VLPLA CHAR(10),'
                      'VLBER CHAR(3),'
                      'NLPLA CHAR(10),'
                      'NLBER CHAR(3),'
                      'VDATE DATE(3) ,'
                      'BNAME CHAR(12),'
                      'VTIME DATE(4),'
                      'PROTYPEFLAG CHAR(1),'
                      'PROCOMFLAG  CHAR(1))'
                into c_coldefs separated by space  .
      TRY.
        PERFORM: CONNECT USING V_CON_NAME CON_REF,
                 CREATE_TABLE USING con_ref c_tabname c_coldefs.
          CATCH cx_sql_exception INTO sqlerr_ref.
            TB_ERROR-MESSAGE = SQLERR_REF->SQL_MESSAGE.
            APPEND TB_ERROR. CLEAR TB_ERROR.
    ENDTRY.
    form create
    form CONNECT using   p_con_name TYPE dbcon-con_name
                         p_con_ref  TYPE REF TO cl_sql_connection
                 RAISING cx_sql_exception.
      p_con_ref = cl_sql_connection=>get_connection( p_con_name ).
    endform.                    " CONNECT
    form create
    form   CREATE_TABLE USING   p_con_ref TYPE REF TO cl_sql_connection
                              p_tabname TYPE string
                              p_coldefs TYPE string
                      RAISING cx_sql_exception.
       DATA:
            l_sqlerr_ref TYPE REF TO cx_sql_exception,
            l_stmt       TYPE string,
            l_stmt_ref   TYPE REF TO cl_sql_statement.
    create a statement object
       l_stmt_ref = p_con_ref->create_statement( ).
    create the statement string
       CONCATENATE
         'create table' p_tabname p_coldefs
         INTO l_stmt SEPARATED BY space.
    execute the DDL command; catch the exception in order to handle the
    case if the table already exists
        TRY.
          l_stmt_ref->execute_ddl( l_stmt ).
        CATCH cx_sql_exception INTO l_sqlerr_ref.
          IF l_sqlerr_ref->dbobject_exists = 'X'
             OR l_sqlerr_ref->internal_error = 1024.
          table already exists => drop it and try it again
            PERFORM:
              drop_table   USING p_con_ref p_tabname,
              create_table USING p_con_ref p_tabname p_coldefs.
          ELSE.
            RAISE EXCEPTION l_sqlerr_ref.
          ENDIF.
      ENDTRY.
    endform.                    " CREATE_TABLE
    please do help me
    Regards,
    Swetha

  • Unable to load entities into Planning using OutlineLoad utitlity

    Good day all,
    One of our Planning admins needs us to load some new entities for her. We've done this off and on with her Planning app for the last year without a problem. However, over the last couple of days we have not been able to load her latest metadata. She's massaged the load file almost half a dozen times and we get the same error message every time. If anyone has any ideas what it does not like about the header values, I would very much appreciate any feedback.
    We are currently running EPM Planning 11.1.1.3.04
    Successfully logged into "HPEGGD" application, Release 11.113, Adapter Interface Version 5, Workforce supported and not enabled, CapEx not supported and not enabled, CSS Version 3
    [Wed Nov 23 09:47:30 CST 2011]Successfully located and opened input file "D:\FILES\Entity_ISG_11_23_11.txt".
    [Wed Nov 23 09:47:30 CST 2011]Header record fields: Parent, Entity, Alias: Default, Alias: Member-Alias, Aggregation (HPEGGD), Aggregation (HPEGGD2), Aggregation (HPEGGD3), Two Pass Calc, Expense, Time Balance, Time Balance Skip, Data Storage, Level Number, Attributed, WF_Group, Shared_Projects, Contract_Type, Agency, Bus_CC_Mgr, Dom-Intl, ID_Number, Segment, Source_System
    [Wed Nov 23 09:47:30 CST 2011]Located and using "Entity" dimension for loading data in "HPEGGD" application.
    [Wed Nov 23 09:47:30 CST 2011]Unable to obtain dimension information and/or perform a data load: Unrecognized column header value(s), refer to previous messages. (Note: column header values are case sensitive.)
    [Wed Nov 23 09:47:30 CST 2011]Examine the Essbase log files for status if Essbase data was loaded.
    [Wed Nov 23 09:47:30 CST 2011]Planning Outline data store load process finished with exceptions: not all input records were read due to errors (or an empty input file). 0 data records were read, 0 data records were processed, 0 were successfully loaded, 0 were rejected.
    Thanks in advance for the assistance.
    Regards,
    -Bob

    One more massage did the trick.

  • Executing CVS files into Oracle using JDeveloper

    I am incredibly impressed with JDeveloper (11.1.1.4), and am working through a process walk through for our current development groups. We using CVS as our SCM, and I was able to easily connect and navigate the CVS directories.
    I can open the CVS file and view it, but I cannot seem to figure out how to execute/compile that file into a database. For example, when I'm working in development, I want to be able to open files from CVS, edit them, compile them, and then check them back in. Can someone please point out how this is accomplished? I'm sorry - this seems like an easy/silly question, but in all my searching, I'm unable to find the answer.
    Thank you for your time!
    T.j.
    Here is a screenshot of what I see, if that helps.
    Edited by: 910514 on Apr 5, 2012 6:53 AM

    ADF7 wrote:above toolbar from 7 of the last there sql icon. hit it to open the sql workesheet. or else press (alt+f10).Thank you for your quick response!
    This is my issue - I don't want to have to open a separate editor. Here is the process:
    1. Navigate the CVS repository for a file. Open that file for editing. (currently opens as read-only - I'm assuming this is a setting that I need to change)
    2. Make changes and compile into the database.
    3. When finished, commit those changes back into CVS. (this part I can see with the 'Pending Changes' tab)
    Does your response me that I have to copy the code into a SQL Worksheet, do my work, and then copy the changes back into the file?
    Thank you again!

  • Insert multiple records into Oracle using Java

    Hi,
    Has anyone tried to insert multiple records into an Oracle table from Java? I have my data in a Java collection.Can I send a Java Collection to an Oracle Package as a PL/SQL Table Type? My problem is I dont want to instantiate a CallableStatement object everytime I do an insert. Instead I want to do that only once and then insert multiple records in one operation.
    Any suggestions will be appreciated,
    Thanks,
    Alex

    Hi Mensa,
    I went thru the code example in your book in chapter 8 (downloaded it from OTN). It looks like the java code for "public class myPLSQLIndexTab" might be a java stored procedure stored in the oracle database?
    Pardon my ignorance because I've never worked on java code in the oracle database itself but how would I call such a program outside the oracle database? For example say I have a batch job that downloads data from a webservice and that batch job is written in java and its sitting on a batch server somewhere on the network. But the java program that inserts data into the database is sitting in the oracle database (also somewhere in the same network). How can the java code sitting on the batch server talk to the java code sitting on the oracle server? Is it the same as calling a pl/sql package using CallableStatement?
    Thanks
    Alex

  • Unable to export table into oracle 9i

    Hi all
    While exporting tables from SQL Server 2000 using DTS Export, after successfully exporting tables into oracle9i in Windows, now I am getting following error.
    [Oracle][ODBC][Ora]ORA-01740:missing double quote in identifier
    Any suggestions to resolve the problem.
    Regards
    Vijay Kumar

    Hi,
    My objective is to port data from legacy database in SQL Server to oracle database
    After 10 tables if you are getting the Error means you can trace out the problem.
    When you go for SQL Server 2000 DTS, you can find from Diagramatic Representation that the process is going on.
    I mean if process of porting or transfer of data is happened successfully then you can see the GREEN Color for the process if completed from one table to another.
    So check the Error for which table you are facing this error.
    Then, check the Column mappings between the table.
    If there is any data with single quote then you need append single quote before that other wise you will face this issue.
    The problem is there is some data in your SQL Server table with single quote.that's why ORACLE is raising and issue.
    Check the data in the table (SQL Server database).
    Thanks
    Pavan Kumar N
    Message was edited by:
    Pavan Kumar

  • Unable to sign in into iMessage using my apple id

    I have turned off iMessage on my iPhone 4 device then turned it back on again to activate it asks to sign in usin Apple ID account. I enter the User name/Password correctly it return back a messge saying the username or passwrod for the account is in correct. While I can sign in to the Apple Store and iCloud services with no issues using the same credentials.
    I have tried resetting the password but still the same issue.
    Please assist on resolving the issue.
    Regard....
    Basil A. Ansari

    I searched for you and found this answer:
    com.apple.appleaccount error 403 is the "best guess" error presented by IOS 7 when it see's the 3 user creation limit is reached and you attempt to create a new ICloud account by logging into ICloud on phone that has used all 3 account creation limit set by Apple.
    Fix: go to a different Apple device that has not burned up its 3 per device ICloud account creations and setup the account there.
    NOTE: you will use up one of the 3 maximum ICloud account creations on the device you use.

Maybe you are looking for

  • BI Publisher - PO_DISPATCH Error generating report output

    Hi everyone, Sorry for my bad english... having said that... I need to modify the Purchase Order print. First, I wanted to see the standard version to get an idea of how much different it was. Well, I don't know because it doesn't work. Error: Error

  • How to get source table inside Template Mapping code template

    Hi guys, I have the following scenario, I have an table from external database and want to map it to an oracle table. This is done with Template mapping and I selected an Load code template on the execution unit that holds only the external table, th

  • SCCM query not returning the results I want

    I would like to use a query that will query my systems that have a particular piece of software (Flash), but I do not want it to include servers that are in a particular group. Explanation: I have about 20 servers with Flash installed that require it

  • Display record details

    I created a program that saves an entry to a customer table, ztable. Now I want to edit any entries from that table and I need to display the details. Ex. If I select record1 on in the first parameters, all other parameters will show the other detail

  • BAPI/Function Module for approve Appropriation Request?

    Hi Friends, Please guide me for BAPI/Function Module for approve Appropriation Request? Regards Ricky