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

Similar Messages

  • How to insert data into database table from a servlet? Help please.

    From a servlet I want to insert a message with some servlet parameters into an oracle database table by writing 'insert into tablename'. How shall I write the sql statement?

    simple suppose u wanned to insert user name and password into table user_info then this is a simple example .....
    Best Regds
    bondzoro
    [email protected]
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class tester extends HttpServlet {
    Connection con = null;
    public void init(ServletConfig sc){
    super.int(sc);
    Class.forName("oracle.jdbc.driver.OracleDriver");
    public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOE
    try {
    con=DriverManager.getConnection("jdbc:oracle:thin:@database_URL:1521:ORA8","username","pa
    String user = req.getParameter("username");
    String pass = req.getParameter("pass");
    PreparedStatement pst = con.prepareStatement("insert into user_info values(?,?)");
    pst.setString(1,user);
    pst.setString(2,pass);
    pst.executeQuery();
    pst.close();
    con.close();
    }catch(Exception _e){
    _e.printStackTrace(System.err);
    ~

  • Insert data into oracle table from XML file

    I need to insert data into oracle table from XML file
    If anybody handled this type of scenario, Please let me know how to insert data into oracle table from XML file
    Thanks in advance

    The XML DB forum provides the best support for XML topics related to Oracle.
    Here's the FAQ on that forum:
    XML DB FAQ
    where there are plenty of examples of shredding XML into Oracle tables and such like. ;)

  • How do I run a database procedure that inserts data into a table from withi

    How do I run a database procedure that inserts data into a table from within a Crystal report?
    I'm using CR 2008 with an Oracle 10i database containing a number of database tables, procedures and packages that provide the data for the reports I'm developing for my department.  However, I'd like to know when a particular report is run and by whom.  To do this I have created a database table called Report_Log and an associated procedure called prc_Insert_Entry that inserts a new line in the table each time it's called.  The procedure has 2 imput parameters (Report_Name & Username), the report name is just text and I'd like the username to be the account name of the person logged onto the PC.  How can I call this procedure from within a report when it's run and provide it with the 2 parameters?  I know the procedure works, I just can't figure out how to call it from with a report.
    I'd be grateful for any help.
    Colin

    Hi Colin, 
    Just so I'm clear about what you want: 
    You have a Stored procedure in your report.  When the report runs, you want that same procedure to write to a table called Report_Log. 
    If this is what you want the simple answer is cannot be done.  Crystal's fundamental prupose is to read only, not write.  That being said, there are ways around this. 
    One way is to have a trigger in your database that updates the Report_Log table when the Stored Procedure is executed.  This would be the most efficient.
    The other way would be to have an application run the report and manage the entry. 
    Good luck,
    Brian

  • Insert data into fact table from source database tables

    here i try to insert data into fact table from source database tables here is the query 
    ALTER procedure [dbo].[facttable]
    as
    insert into [pp dw].dbo.Dimfact(Prod_ID,Production_ID,Material_ID,Equip_ID,WC_ID,Recipe_ID,Quantity,costprice)
    select Products.[Product ID],[Production ID],Materials.[Material ID],[Equipment ID],[Work Centre ID],[Recipy ID],Quantity,[cost price]
    from
    [PRODUCTION PLANNING 2].dbo.[Products],
    [PRODUCTION PLANNING 2].dbo.[Production Detail],
    [PRODUCTION PLANNING 2].dbo.[Material category],
    [PRODUCTION PLANNING 2].dbo.[Materials],
    [PRODUCTION PLANNING 2].dbo.[Equipment],
    [PRODUCTION PLANNING 2].dbo.[Working Centre] ,
    [PRODUCTION PLANNING 2].dbo.[Recipies]
    where
    Products.[Product ID] in (13, 14, 15, 16, 17) and
    [Production Detail].[Production ID] in (1, 2, 3) and
    [Materials].[Material ID] in (1, 2, 3, 4, 5) and
    [Equipment].[Equipment ID] in (1, 2, 3, 4) and
    [Working Centre].[Work Centre ID] in (1, 2, 3) and
    [Recipies].[Recipy ID] in (1, 2, 3) and
    [Material category].[Category ID] in (8, 9, 10, 11, 12, 13)
    and when i execute query it shows me error 
    The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Dimfact_Dimproduct". The conflict occurred in database "pp dw", table "dbo.Dimproduct", column 'Prod_ID'.
    ERD IS
    HOW TO SOLVE THIS PROBLEM?

    I cant see any join conditions in your query posted. Whats the purpose of the query above. It will just bring you a cartesian product (cross join) of tables involved subjected to filters. Are you sure this is the correct query?
    The error you're getting may be because you've not yet populated DimProduct or may be because of logic you used in popultaing DimProduct causing it to miss some records which is what query is referring to in above case.
    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

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

  • 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 SQL SERVER FROM MS ACCESS TABLE??

    NEED TO INSERT DATA INTO SQL SERVER FROM MS ACCESS TABLE.

    this is another method
    http://www.mssqltips.com/sqlservertip/2484/import-data-from-microsoft-access-to-sql-server/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

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

  • 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 local database from oracle server

    I am new in C#.
    I am trying to design a local database in my C# project and I am trying to sync my database with our oracle server. I can login using oracle server. But I can't insert data into my local database from oracle server.
    anybody can help me ...............
    thanks..............................

    You can use SSIS package for that
    Start a new Integration Services project in Business  Intelligence Development Studio/ SSDT. Add a new SSIS package with a data flow task. Add a OLEDB source to connect to Oracle server and add a OLEDB Destination to connect to your local database.
    Select tables for source and destination. On executing package source data will get transferred to your local database.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Need to insert values into a table from a XML file

    Hi,
    I'm an Oracle 9i/10g DBA with quite a few years experience, but I'm new to XML and dealing with it in database terms. I've been given a project that entails pulling XML values out of a file (or 100's of them) and storing them in the database so that they are searchable by end-users. The project is classified as secret so I'm unable to upload the specific XML or any info relating to the structire of the XML or the table I will use to insert the values into - sorry!! So, I've created an XML file with a similar structure to help people understand my predicament.
    The end-users only need to search on a subset of the total amount of columns from the table I'll insert data into, although the XML file has a lot more, so I dont need to store the other values - but I will need to store the name of the XML file (or a pointer to it so I know what XML file a particular set of values belong to) in another column of the table along with its associated values.
    I've been using the XMLTABLE function with some degree of success, although I had better succes using the XMLSEQUENCE function. However, I found out this is deprecated in 10g and replaced with XMLTABLE, so I guess it's better if I use this in case we ever need to upgrade to 11g.
    The main problem I've been having is that some elements in the XML files have multiple values for the one record when all the other records are the same. In terms of storing this in the database, I guess it would mean inserting multiple rows in the table for each element where the value differs. Here is a dumbed down XML file similar to what I've got along with the other SQL I've used:
    +<?xml version="1.0" encoding="UTF-8"?>+
    +<House>+
    +<Warehouse>+
    +<WarehouseId>1</WarehouseId>+
    +<WarehouseName>+
    +<Town>Southlake</Town>+
    +<State>Texas</State>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>25000</Area>+
    +<Docks>2</Docks>+
    +<DockType>Rear load</DockType>+
    +<WaterAccess>true</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Street</Parking>+
    +<VClearance>10</VClearance>+
    +</Warehouse>+
    +<Warehouse>+
    +<WarehouseId>2</WarehouseId>+
    +<WarehouseName>+
    +<Town>Poole</Town>+
    +<State>Dorset</State>+
    +</WarehouseName>+
    +<WarehouseName>+
    +<Town>Solihull</Town>+
    +<County>West Midlands</State>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>40000</Area>+
    +<Docks>5</Docks>+
    +<DockType>Rear load</DockType>+
    +<WaterAccess>true</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Bay</Parking>+
    +<VClearance>10</VClearance>+
    +</Warehouse>+
    +<Warehouse>+
    +<WarehouseId>3</WarehouseId>+
    +<WarehouseName>+
    +<Town>Fleet</Town>+
    +<County>Hampshire</County>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>10000</Area>+
    +<Docks>1</Docks>+
    +<DockType>Side load</DockType>+
    +<WaterAccess>false</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Bay</Parking>+
    +<VClearance>20</VClearance>+
    +</Warehouse>+
    +</House>+
    CREATE TABLE xmltest OF XMLTYPE;
    INSERT INTO xmltest
    VALUES(xmltype(bfilename('XML_DIR', 'test.xml'), nls_charset_id('AL32UTF8')));
    Consequently, I need to...
    1) Retrieve the results from the XML file for all 3 warehouses where multiple values for the same sub-element are shown as 2 rowsthe result set. (I am guessing there will be 4 rows returned as warehouse sub-2 has 2 different elements for <WarehouseName>.
    2) Build a case statement into the query so that regardless of the sub-element name (i.e State or County), it is returned into the 1 column, for instance County.
    So, if I run a query similar to the following...
    select y.WarehouseId, y.Town, y.County, y.Area
    from xmltest x, xmltable('/House/Warehouse' .......
    I would like to get results back like this...
    ID Town County Area
    1 Southlake Texas 25000
    2 Poole Dorset 40000
    2 Solihull West Midlands 40000
    3 Fleet hampshire 10000
    Sorry for the non-formatting but I hope this all makessense to someone out there with what I'm trying to do.
    I appreciate any help whatsoever because, as i said before, I'm totally new to XML and trying to read the vast amount of information there is out there on XML is all a bit daunting.
    Many thanks in advance,
    Shaun.

    Hi again,
    Thanks for keeping the post open for me. I've had a look at the post illustrating the XFileHandler package, and tried to alter it to make it fit with my XML files. To help explain things, my XML file looks like this:
    <?xml version="1.0"?>
    <!DOCTYPE  CMF_Doc SYSTEM "CMF_Doc.dtd">
    <House>
        <Warehouse>
        <WarehouseId>1</WarehouseId>
        <WarehouseName>
           <Town>Southlake</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>House
        <WarehouseId>2</WarehouseId>
        <WarehouseName>
           <Town>Poole</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Solihull</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>40000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>3</WarehouseId>
        <WarehouseName>
           <Town>Fleet</Town>
           <County>Hampshire</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>
    <?xml version="1.0" encoding="UTF-8"?>
    <House>
        <Warehouse>
        <WarehouseId>4</WarehouseId>
        <WarehouseName>
           <Town>Dallas</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>5</WarehouseId>
        <WarehouseName>
           <Town>Dorchester</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Solihull</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>40000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>6</WarehouseId>
        <WarehouseName>
           <Town>Farnborough</Town>
           <County>Hampshire</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>
    <?xml version="1.0" encoding="UTF-8"?>
    <House>
        <Warehouse>
        <WarehouseId>7</WarehouseId>
        <WarehouseName>
           <Town>Southlake</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>8</WarehouseId>
        <WarehouseName>
           <Town>Bournemouth</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Shirley</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>30000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>9</WarehouseId>
        <WarehouseName>
           <Town>Clapham</Town>
           <County>London</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>And the XFilehandler package looks like this (I'm just trying to do a simple select only on WarehouseId & WaterAccess for the time being to keep things simple):
    create or replace package XFileHandler as
      TYPE TRECORD IS RECORD (
        WID     NUMBER(2)
      , WACCESS VARCHAR2(5)
      type TRecordTable is table of TRecord;
      function getRows (p_directory in varchar2, p_filename in varchar2) return TRecordTable pipelined;
    end;
    create or replace package body XFileHandler is
      function getRows (p_directory in varchar2, p_filename in varchar2)
       return TRecordTable pipelined
      is
        nb_rec          number := 1;
        tmp_xml        clob;
        tmp_file         clob;
        rec               TRecord;
      begin
        DBMS_LOB.CREATETEMPORARY(TMP_FILE, TRUE);
        tmp_file := dbms_xslprocessor.read2clob(p_directory, p_filename);
        LOOP
          tmp_xml := regexp_substr(tmp_file, '<\?xml[^?]+\?>\s*<([^>]+)>.*?</\1>', 1, nb_rec, 'n');
          exit when length(tmp_xml) = 0;
          --dbms_output.put_line(tmp_rec);
          nb_rec := nb_rec + 1;
        select y.WID, y.WACCESS
        into rec.WID, rec.WACCESS
        from xmltable('/House' passing xmltype(tmp_xml)
                      columns WID NUMBER(2) PATH 'Warehouse/WarehouseId',
                                  WACCESS VARCHAR2(5) PATH 'WaterAccess') y;
          pipe row ( rec );
        end loop;
        dbms_lob.freetemporary(tmp_file);
        return;
      end;
    end;Now, when I run the query:
    select * from table(XFileHandler.getRows('XML_DIR', 'XFileHandler_test.xml'));I get the error: ORA-00600: internal error code, arguments: [17285], [0x5CFE8DC8], [4], [0x45ABE1C8], [], [], [], []
    I had a look in the dump file for anything obvious, but nothing really stands out. Is there anything obvious in my code that I'm missing or something else which you may think could be causing this error, e.g in the regular expression regexp_substr?
    Many thanks,
    Shaun.

  • How to insert data into Oracle db from MySQL db through PHP?

    Hi,
    I want to insert my MySQL data into Oracle database through PHP.
    I can access Mysql database using mysql_conect() & Oracle database using oci_connect() through PHP.
    Now How can I insert my data which is in MySQL into Oracle table. Both table structure are exactly same.
    So I can use
    insert into Oracle_Table(Oracle_columns....) values(Select * from MySQL_Table);
    But again problem is I can't open both connections at the same time.
    So has anyone done this before or anyone having any other idea..
    Plz guide me...

    You can do it if you setup a ODBC Gateway between MYSQL and Oracle DB. Then you can directly read from MySQL table using DB links and insert into Oracle table in one single SQL Statement.
    Otherwise you need to fetch the data from MySQL Into variables in your PHP Program and then insert into Oracle after binding the variables to the insert statement for Oracle. Hope that is clear enough.
    Regards
    Prakash

  • How to insert date into database table

    Hi,
    i used date navigator in htmlb. i want toupdate date into the database table ystudetn_inf. and also please tell me how to insert that date into table.give me small example in stepby step.

    Hi,
      I am sure you have used htmlb:dateNavigator as follows
    <htmlb:dateNavigator id             = "myDateNavigator"
                               monthsPerRow    = "1"
                               onNavigate      = "myOnNavigate"
                               onDayClick      = "myOnDayClick"
                               onWeekClick     = "myOnWeekClick"
                               onMonthClick    = "myOnMonthClick">
          </htmlb:dateNavigator>
    Trap the onDayClick event in oninputprocessing
    date_event ?= cl_htmlb_manager=>get_data(
                                        request = runtime->server->request
                                             name     = 'inputField'
                                             id       = 'mydate'  ).
    date = datenavigator_event->day.
    and use date value to update your table.
    If found helpfull rewards points.
    Regards,
    Albert

Maybe you are looking for

  • XML NameSpace Issue Confused whether it is a bug

    Hi, The issue is that the generated XML and Actual XML vary as the following: - The namespace which is used in the Actual XML is globally used and whereas In the generated XML It is used locally wherever the corresponding element or type is used in t

  • Album list view for playlists

    When I select Music (under Library) and select the Grid view, then select Artists, then double click on an artist I am presented with a list view grouped by album with album artwork on the left. I would like to get the same view for a selected playli

  • Stop automatic creation of email links when @ is used

    Hi all - I need to use the @ symbol in a number of places in my PDF files - Unfortunately, the conversion to PDF process always calls words with @ symbols in front of them email links. I've gotten around it by bracketing the symbol, but the use of th

  • Can't import photos from Iphone to PC

    I was using Icloud until yesterday...suddenly the pics from the Iphone (photo streamer album) stopped to import to the PC (my picture)

  • Dynamic image(logo) in reports 6i

    Hi, I want to insert an image (logo of my company) in all my reports, from a location for example d:\abc.gif, so that if i replace the image from a new one the report show the new image (logo), I tried file --> import --> image already but it is stat