XMLGen problem (or me :)

I've a little problem for exemple when I execute the pl/sql proc I can't retrieve all the data in the table :
DECLARE
     xmlCTX     DBMS_XMLGen.ctxHandle;
     xmlDoc     CLOB;
     big     BOOLEAN;
BEGIN
     xmlCTX      := DBMS_XMLGen.newContext('SELECT * FROM EMP');
     DBMS_XMLGen.setConvertSpecialChars(xmlCTX, False);
     xmlDoc      := DBMS_XMLGen.getXML(xmlCTX);
     delete from clob_test;
     insert into clob_test values (xmlDoc);
END;
The result table is :
XMLDOC
<?xml version="1.0"?>
<ROWSET>
<ROW>
<EMPNO>7369</EMPNO>
<ENAME>SMITH</ENAM
I don't understand (I'm a newbie in XML with Oracle). My Oracle version is 9ir2 and my database is in UTF8.
Thanks in advance.

How you see the result? In SQL*plus? Did you run the following SQL*plus command:
set long 100000

Similar Messages

  • UTF8 problem with XMLGEN

    Hi All,
    I'm having problems with the XML generation. The problem is that when we try to generate XML using a query, such as:
    select xmlgen.getXML('select content_id, locale_id, content from bc_content_local where delete_p = ''0''',1) from dual;
    It works fine so long as of the information retrieved by the query is ASCII. But if there are UTF8 characters in there, the
    generation of the XML fails.
    I wasn't actually getting an error message. It would work and return XML but as soon as the first UTF-8 character was encountered,
    the XML just stopped.
    Two questions:
    1) Does the XML generation support UTF-8? 2)
    If it does (I seem to remember hearing that it did) what has to be done so that this
    works correctly?
    We are using a UTF8 characterset we set during database creation. I have also tried setting up NLS_LANG in the client registrty to american_america.utf8 - but in both client and server I get teh same message.
    Database: Oracle 8.1.7 Standard Edition on Sun-Solaris 2.8
    Any help greatly appreciated,
    Nilendu Misra
    [email protected]

    Ok, I found we have DBMS_XMLQUERY installed on the schema other than SYS too. But when I issue the same statement using this package I get a different error:
    SQL> select dbms_xmlquery.getXML('select content_id, locale_id, content
    2 from bc_content_local where delete_p = ''0''',1) from dual;
    select dbms_xmlquery.getXML('select content_id, locale_id, content
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NullPointerException
    ORA-06512: at "SYSTEM.DBMS_XMLQUERY", line 212
    ORA-06512: at "SYSTEM.DBMS_XMLQUERY", line 220
    ORA-06512: at "SYSTEM.DBMS_XMLQUERY", line 210
    ORA-06512: at "SYSTEM.DBMS_XMLQUERY", line 228
    ORA-06512: at line 1
    I tried searching the XML forum and Metalink but I found most of the reports on this nature of problem are still unanswered.
    Thanks in appreciation,
    Nilendu
    null

  • PL/SQL & xmlgen.getXML problem

    Hi All.
    I am just starting to investigate options with regards to procedures which return the results of queries, in XML format.
    I have written the following function:
    CREATE OR REPLACE FUNCTION returnXML(id NUMBER) RETURN CLOB IS
    query VARCHAR2(100);
    BEGIN
    query := 'SELECT *
    FROM test_table
    WHERE id = '||id;
    RETURN xmlgen.getXML(query);
    END;
    I am then calling this as such:
    SQL> SELECT returnXML(1) FROM dual;
    My problem is that when I call this function, it seems to only produce some of the output ! ie. I get the XML header, first ROWSET and ROW tags, but then a number of chars further inot my output it stops ! I have also tried calling thsi function from within another PL/SQL block, and the same thing happens. No error is generated at all.
    Does anyone have any ideas, or has anyone seen this problem before ?
    Thanks,
    Kristian.

    It just might be that SQL Plus is not printing out all the contents of the CLOB.
    You can do:
    SQL> set LONG 1000
    and run your query again. Or you can create a function similar to this one (from Oracle XDK Documentation):
    CREATE OR REPLACE PROCEDURE printClobOut(result IN OUT NOCOPY CLOB) is
    xmlstr varchar2(32767);
    line varchar2(2000);
    begin
    xmlstr := dbms_lob.SUBSTR(result,32767);
    loop
    exit when xmlstr is null;
    line := substr(xmlstr,1,instr(xmlstr,chr(10))-1);
    dbms_output.put_line('| '||line);
    xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
    end loop;
    end;
    To use:
    set serveroutput on
    declare
    result CLOB;
    begin
    -- get the result
    result := returnXML(<some ID>);
    -- print the result
    printClobOut(result);
    end;

  • Problem in use xmlgen.insertXML to insert XML file to Object Viewse

    I am trying to update XML file to Object View but it failed. Refer to the steps that I was doing.
    1) Use utl_file.get_line to read XML file which I generated (It is no problem)
    2)The xml data is
    <?xml version="1.0" ?>
    - <ROWSET>
    - <ROW num="1">
    <PK_NO>305</PK_NO>
    <ACC_NAME>PAPERS AND CLIPS</ACC_NAME>
    <FROM_NAME>MB METAL PTE LTD</FROM_NAME>
    <MAS_NO>990015</MAS_NO>
    <MAS_DATE>2000-04-07 15:47:52.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>WRFQ</MAS_CODE>
    <REMARK>SADKJAS</REMARK>
    - <LINEITEMLIST_NTAB>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>1</ITEM_NO>
    <STK_C>2506401</STK_C>
    <SP_STK_C>H282828</SP_STK_C>
    <STK_NAME>STICK-ON-NOTES - 11110 1.5, 12 100 SHEET PADS</STK_NAME>
    <UOM>SET</UOM>
    <QTY>10</QTY>
    <SALES_PRICE>95.50</SALES_PRICE>
    <REMARK>SADKJAS</REMARK>
    </LINEITEMLIST_NTAB_ITEM>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>2</ITEM_NO>
    <STK_C>7706001</STK_C>
    <SP_STK_C>H282828</SP_STK_C>
    <STK_NAME>FACESHIELD/EYE PROT CLEAR GLASS WTR PLATE, STANDARD DREW</STK_NAME>
    <UOM>PCS</UOM>
    <QTY>1</QTY>
    <SALES_PRICE>100</SALES_PRICE>
    <REMARK>SADKJAS</REMARK>
    </LINEITEMLIST_NTAB_ITEM>
    </LINEITEMLIST_NTAB>
    </ROW>
    </ROWSET>
    3) From Object View, I generated xml file is
    - <ROWSET>
    - <ROW num="1">
    <PK_NO>2</PK_NO>
    <ACC_NAME>PAPERS AND CLIPS</ACC_NAME>
    <FROM_NAME>MB METAL PTE LTD</FROM_NAME>
    <MAS_NO>990015</MAS_NO>
    <MAS_DATE>2000-06-07 00:00:00.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>WRFQ</MAS_CODE>
    - <LINEITEMLIST_NTAB>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>1</ITEM_NO>
    <STK_C>2506401</STK_C>
    <STK_NAME>STICK-ON-NOTES - 11110 1.5,X2 12 100 SHEET PADS</STK_NAME>
    <UOM>SET</UOM>
    <QTY>1</QTY>
    <SALES_PRICE>10</SALES_PRICE>
    </LINEITEMLIST_NTAB_ITEM>
    </LINEITEMLIST_NTAB>
    </ROW>
    - <ROW num="2">
    <PK_NO>4</PK_NO>
    <ACC_NAME>ABC</ACC_NAME>
    <FROM_NAME>VBF</FROM_NAME>
    <MAS_NO>99200</MAS_NO>
    <MAS_DATE>2000-01-04 00:00:00.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>DSDS</MAS_CODE>
    <REMARK>WRFQ</REMARK>
    <LINEITEMLIST_NTAB />
    </ROW>
    </ROWSET>
    3) I use INSTEAD OF trigger for Object View to insert the data to database.
    I got the message is:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:5.
    Anybody can give me the advise for that.
    null

    If you have the ftp server at 8080 running (9iR2 only) the simples way is to upload it to the database through that server. You can then do whatever you want using the xdburitype() procedure.
    Below is an excerpt of a script I use to register XML schema's (I've got some very long ones, about 150K). It should work with "any" file..
    begin
         dbms_xmlschema.registerSchema (
              schemaURL => 'http://www.agralin.nl/WebQuery/ns/&1',
              schemaDoc => xdburitype('/age/&1..xsd'),
              local => TRUE,
              genTables => FALSE,
              genbean => FALSE,
              genTypes => TRUE,
              force => FALSE,
              owner => 'AGE'
    end;

  • Problem with generating xml and nested cursor (ora-600)

    I have a problem with generating xml (with dbms_xmlquery or xmlgen) and nested cursors.
    When I execute the following command, I get a ORA-600 error:
    select dbms_xmlquery.getxml('select mst_id
    , mst_source
    , cursor(select per.*
    , cursor(select ftm_fdf_number
    , ftm_value
    from t_feature_master
    where ftm_mstr_id = pers_master_id ) as features
    from t_person per
    where pers_master_id = mst_id ) as persons
    from f_master
    where mst_id = 3059435')
    from dual;
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: ORA-00600: internal error code, arguments: [kokbnp2], [1731], [], [], [], [], [], []
    </ERROR>
    The problem is the second cursor (t_feature_master).
    I want to generate this:
    <master>
    <..>
    <persons>
    <..>
    <features>
    <..>
    </features>
    </persons>
    <persons>
    <..>
    <features>
    <..>
    </features>
    </persons>
    </master>
    If i execute the select-statement in sql-plus, then I get the next result.
    MST_ID MST_SOURCE PERSONS
    3059435 GG CURSOR STATEMENT : 3
    CURSOR STATEMENT : 3
    PERS_MASTER_ID PERS_TITLE PERS_INITI PERS_FIRSTNAME PERS_MIDDL PERS_LASTNAME
    3059435 W. Name
    CURSOR STATEMENT : 15
    FTM_FDF_NUMBER FTM_VALUE
    1 [email protected]
    10 ....
    I use Oracle 8.1.7.4 with Oracle XDK v9.2.0.5.0.
    Is this a bug and do somebody know a workaround?

    Very simple...Drop all type objects and nested tables and create them again. You will get no error. I'll explain the reason later.

  • XML load using PL/SQL (XSU) problem with dtd file.

    Hi,
    I'm trying to load a xml file and receives this errormassage:
    SQL> exec loadxml;
    In Exception
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: Error opening external DTD
    'Businesscard.DTD'.
    Any idea what I can change? Below is the things I've done and also how the xml file looks
    and the dtd file.
    Regards
    Jorgen
    CREATE DIRECTORY XML_DIR AS 'C:\XML';
    CREATE TABLE XML_TEMP (key NUMBER, f_lob BFILE);
    INSERT INTO XML_TEMP VALUES (1,BFILENAME('XML_DIR','TeleAdressVKI0209021728.xml'));
    CREATE TABLE XML_DOC (
    Key1 VARCHAR2(32),
    Key2     VARCHAR2(32),
    Key3 VARCHAR2(32),
    Terminate     VARCHAR2(3),
    LegalName     VARCHAR2(420),
    PopName          VARCHAR2(420),
    StreetName     VARCHAR2(60),
    StreetNumber     VARCHAR2(10),
    PostNumber     VARCHAR2(10),
    PostAdress VARCHAR2(30),
    CordinateLevel     VARCHAR2(32),
    xCor          VARCHAR2(10),
    yCor VARCHAR2(10),
    PoiCategory VARCHAR2(32),
    Telephone VARCHAR2(30));
    CREATE OR REPLACE PROCEDURE loadxml AS
    fil BFILE;
    buffer RAW(32767);
    len INTEGER;
    insrow INTEGER;
    BEGIN
    SELECT f_lob INTO fil FROM xml_temp WHERE key = 1;
    DBMS_LOB.FILEOPEN(fil,DBMS_LOB.FILE_READONLY);
    len := DBMS_LOB.GETLENGTH(fil);
    DBMS_LOB.READ(fil,len,1,buffer);
    xmlgen.resetOptions;
    insrow := xmlgen.insertXML('xml_doc',UTL_RAW.CAST_TO_VARCHAR2(buffer));
    DBMS_OUTPUT.PUT_LINE(insrow);
    IF DBMS_LOB.FILEISOPEN(fil) = 1 THEN
    DBMS_LOB.FILECLOSE(fil);
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('In Exception');
    DBMS_OUTPUT.PUT_LINE(SQLERRM(SQLCODE));
    IF DBMS_LOB.FILEISOPEN(fil) = 1 THEN
    DBMS_LOB.FILECLOSE(fil);
    END IF;
    end;
    The xml file look like this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE Cards SYSTEM 'Businesscard.DTD'>
    <Cards>
    <Comment>TeleAdress initial</Comment>
    <OldFile>xxxx</OldFile>
    <NewFile>xxxx</NewFile>
    <Card>
    <Key1>95352</Key1>
    <Key2>159651</Key2>
    <Key3>3807868</Key3>
    <Terminate>no</Terminate>
    <Cardholder>
    <LegalName>
    <Name>
    <Full>AXFOOD DIREKT AB</Full>
    </Name>
    </LegalName>
    <PopName>
    <Name>
    <Full>WILLYS LEGPRIS AB</Full>
    </Name>
    </PopName>
    </Cardholder>
    <Location>
    <Address>
    <StreetInfo>
    <StreetName>BAGARBYVDGEN</StreetName>
    <StreetNumber>61</StreetNumber>
    </StreetInfo>
    <ZipCode>19134</ZipCode>
    <City>SOLLENTUNA</City>
    <Coordinate>
    <Level>1</Level>
    <xCor>1620480</xCor>
    <yCor>6592717</yCor>
    </Coordinate>
    </Address>
    <Business>
    <POI>
    <POIId>46</POIId>
    <POIId>84</POIId>
    </POI>
    <InfoRow>
    <Subscriptions>
    <TelAddress>08 6234540</TelAddress>
    </Subscriptions>
    </InfoRow>
    </Business>
    </Location>
    </Card>
    <Card_Count>1</Card_Count>
    </Cards>
    the dtd file looks like this:
    <!-- BusinessCard.dtd -->
    <!-- History:          See end of this file -->
    <!-- Description:      This DTD is used for transferring business cards-->
    <!--               from TeleAdress Information AB to its customers. -->
    <!--===================== Root Element ===========================-->
    <!ELEMENT     Cards     (Comment,OldFile?,NewFile,Card*,Card_Count)>
         <!ELEMENT     Comment                         (#PCDATA)>
         <!ELEMENT     OldFile                         (#PCDATA)>
         <!ELEMENT     NewFile                         (#PCDATA)>
    <!--===================== Card ============================-->
    <!ELEMENT     Card     (Key1, Key2, Key3, Terminate, (RegNo?, Cardholder, Row*)?)>
         <!ELEMENT     Key1          (#PCDATA)>
         <!ELEMENT     Key2          (#PCDATA)>
         <!ELEMENT     Key3          (#PCDATA)>
         <!ELEMENT     Terminate     (#PCDATA)> <!-- Values can be yes or no-->
    <!--====================== Cardholder ============================-->
    <!ELEMENT     Cardholder     (RegNo, OrgType, LegalName, PopName?, Location)     >
         <!ELEMENT     RegNo          (#PCDATA)>
         <!ELEMENT     OrgType          (#PCDATA) >
    <!--====================== RegName ==================================-->
    <!ELEMENT     LegalName          (Name)>
    <!--====================== PopName ==================================-->
    <!ELEMENT     PopName          (Name+)>
    <!--====================== Location ==================================-->
    <!ELEMENT     Location          (Adress+, Unit*, Business)>
    <!--====================== Unit ==================================-->
    <!ELEMENT     Unit          (UnitNo, UnitName?, Status, HQ, SNI1?, SNI2?, SNI3?, WorkPlaceNo, WorkPlaceName?)>
         <!ELEMENT     UnitNo          (#PCDATA)>
         <!ELEMENT     UnitName     (#PCDATA)>
         <!ELEMENT     Status          (#PCDATA)>
         <!ELEMENT     HQ          (#PCDATA)> <!-- Values can be yes or no-->
         <!ELEMENT     SNI1          (#PCDATA)>
         <!ELEMENT     SNI2          (#PCDATA)>
         <!ELEMENT     SNI3          (#PCDATA)>
         <!ELEMENT     WorkPlaceNo     (#PCDATA)>
         <!ELEMENT     WorkPlaceName     (#PCDATA)>
    <!--====================== Business ==================================-->
    <!ELEMENT     Business          (POI?, InfoRow*)>
    <!--====================== POI =======================================-->
    <!ELEMENT     POI          (POIId+)>
         <!ELEMENT     POIId          (#PCDATA)>
    <!--====================== InfoRow ===================================-->
    <!ELEMENT     InfoRow          (Number,Heading*,Name?, Address?, Text?, HomePageAddresses?, EMailAddresses?, Subscriptions?)>
         <!ELEMENT     Number          (#PCDATA)>
    <!--====================== Heading =================================-->
    <!ELEMENT     Heading          (LevelNo, LevelName)>
         <!ELEMENT      LevelNo          (#PCDATA)>
         <!ELEMENT     LevelName     (#PCDATA)>
    <!--====================== Name =================================-->
    <!ELEMENT     Name          (Full,First?,Middle?,Last?)>
         <!ELEMENT      Full          (#PCDATA)>
         <!ELEMENT     First          (#PCDATA)>
         <!ELEMENT     Middle          (#PCDATA)>
         <!ELEMENT     Last          (#PCDATA)>
    <!--====================== Address ==============================-->
    <!ELEMENT     Address               (Type, StreetInfo?,TextBeforeZipCode?,ZipCode?,City?,AReg?,
                             Municipality?,County?,Country?,Coordinate?)>
         <!ELEMENT     Type               (#PCDATA)>     
         <!--====================== StreetInfo ==============================-->
         <!ELEMENT     StreetInfo          (PostBox?, StreetName?,StreetNumber?,Entrance?, CO?)>
              <!ELEMENT     PostBox               (#PCDATA)>
              <!ELEMENT     StreetName          (#PCDATA)>
              <!ELEMENT     StreetNumber          (#PCDATA)>
              <!ELEMENT     Entrance          (#PCDATA)>
              <!ELEMENT     Co               (#PCDATA)>
         <!ELEMENT     TextBeforeZipCode     (#PCDATA)>
         <!ELEMENT     ZipCode               (#PCDATA)>
         <!ELEMENT     City               (#PCDATA)>
         <!ELEMENT     AReg               (#PCDATA)>     
         <!ELEMENT     Municipality          (#PCDATA)>
         <!ELEMENT     County               (#PCDATA)>
         <!ELEMENT     Country               (#PCDATA)>
         <!--====================== Coordinate ==============================-->
         <!ELEMENT     Coordinate          (Level, xCor,yCor)>
              <!ELEMENT     Level          (#PCDATA)>
              <!ELEMENT     xCor          (#PCDATA)>
              <!ELEMENT     yCor          (#PCDATA)>
    <!--====================== Text =================================-->
    <!ELEMENT     Text          (InfoText+)>
         <!ELEMENT     InfoText          (#PCDATA)>     
    <!--====================== HomePageAddresses =================================-->
    <!ELEMENT     HomePageAddresses          (HomePage+)>
         <!ELEMENT     HomePage          (#PCDATA)>     
    <!--====================== EMailAddresses =================================-->
    <!ELEMENT     EMailAddresses          (EMail+)>
         <!ELEMENT     EMail          (#PCDATA)>     
    <!--======================= Subscriptions ===========================-->
    <!ELEMENT     Subscriptions     (ClassifiedCode?, Type, TelAddress, TextAfter?)     >
         <!ELEMENT     TelAddress     (#PCDATA)>
         <!ELEMENT     TextAfter     (#PCDATA)>
    <!ELEMENT     Card_Count               (#PCDATA)>
    <!--==============================================================-->
    <!-- History:          2002-06-06 created this file -->
    <!--                2002-07-04 Added Source on Coordinates -->
    <!--               2002-08-15 Changed Source to Level -->
    <!--               2002-08-15 Changed RegName to LegalName-->

    I've got the same problem,
    How to define the directory in witch the DTD is????
    We need something like DBMS_XMLSave.setdirectoryDTD, that doesn't exist.
    ben
    ERREUR ` la ligne 1 :
    ORA-29532: appel Java arrjti par une exception Java non interceptie :
    oracle.xml.sql.OracleXMLSQLException: Error opening external DTD
    'annoncesv22.dtd'.
    ORA-06512: ` "SDEV.SIMPORT", ligne 205
    ORA-06512: ` ligne 1

  • Error with PL/SQL xmlGen if unlimited rows

    If I run xmlgen server side from pl/sql and I dont specify a limit on the rows I get the following error
    xml version=1.0
    ERROR
    oracle.xml.sql.OracleXMLSQLEception
    ORA-00600: internal error code, arguments: [kdlseek-kgbtnscb]
    ERROR
    If limit the rows it works ok, the generated xml is not that big only about 600 rows
    Any ideas on whast the problem
    Rob

    I too get the same problem. Has anyone come up with a solution, not a workaround?
    SQL> select xmlgen.getXML('select * from dict where table_name like ''%ROLE%''') from dual;
    XMLGEN.GETXML('SELECT*FROMDICTWHERETABLE_NAMELIKE''%ROLE%''')
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <TABLE_NAME>DBA_ROLES</T
    SQL> select xmlgen.getXML('select * from dict') from dual;
    select xmlgen.getXML('select * from dict') from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: ORA-00600: internal error code,
    arguments: [kdlseek-kgbtnscb], [], [], [], [], [], [], []
    ORA-06512: at "SCOTT.XMLGEN", line 465
    ORA-06512: at "SCOTT.XMLGEN", line 456
    ORA-06512: at line 1
    SQL> select count(*) from dict;
    COUNT(*)
    851
    SQL> describe dict;
    Name Null? Type
    TABLE_NAME VARCHAR2(30)
    COMMENTS VARCHAR2(4000)
    SQL>
    shared_pool_size = 52428800 # 50MB
    large_pool_size = 614400
    java_pool_size = 41943040 # 40MB
    W2K V5 SP1, 8.1.6 RLSE2 & XSU1.2
    Steve.
    null

  • Using xmlgen in Job - Urgent

    We are having aproblem calling xmlgen from a job submitted using dbms_job.
    We are trying to set up a background job to process new records in a table and create an xml doc and store this in another table.
    When the job executes it fails without any specfic reason. I have tried force the job to run from my session using "run" and it also fails. I have tried removing things from the procedure to see what causes the problem and it is specifically the xmlgen.
    It is the call to xmlgen specifically that causes the job to fail.
    Does anyone have a solution or has anyone used xmlgen inside of a systen job?
    Thanks
    Rob
    null

    If you JavaBean does not use any kind of connection pooling, your site performance is not going to be good. However, you probably don't need to worry about deadlocks on the JSP end if you don't have connection pooling, since you are likely not to have shared objects/variables among the different JSP threads. If you site experiences heavy load, the probablility of your database crashing would be significantly higher if you don't have database connection pooling

  • Temp Tablespace Goes Berzerk using XMLGEN

    The following procedure seems to maxout my temporary tablespace (2G!!!!)
    I use this procedure to pump XML to a client given a sql statement and a few parameters.
    I am using the plxmlparser_v1_0_2 release and the XSU12_ver1_2_1 release.
    There seems to be some discussion concerning this in other threads but no soloution seems to be forth coming. Any advice?
    PS I am also having a problem with XMLGEN returning XML datasets >90k. Methinks the two issues are related.
    Regards
    James Crockart
    [email protected]
    procedure createDynamicXML(
    sql_string varchar2,
    result_name varchar2 default 'results',
    row_name varchar2 default 'row',
    error_name varchar2 default 'error_results',
    rowid_name varchar2 default null,
    rowid_col varchar2 default null,
    useLowerCase boolean default true,
    useNullAttrib boolean default false)
    is
    no_sql exception;
    --XML Variables
    xmlString CLOB := null;
    amount integer:= 255;
    position integer := 1;
    charString varchar2(255);
    begin
    if sql_string is null then
    raise no_sql;
    end if;
    --Set XML preferences
    xmlgen.resetOptions;
    xmlgen.setErrorTag(error_name);
    xmlgen.setRowsetTag(result_name);
    xmlgen.setRowTag(row_name);
    if rowid_name is not null then
    xmlgen.setRowIdAttrName(rowid_name);
    end if;
    if rowid_col is not null then
    xmlgen.setRowIdColumn(rowid_col);
    end if;
    if useLowerCase then
    xmlgen.useLowerCaseTagNames();
    end if;
    xmlgen.useNullAttributeIndicator(useNullAttrib);
    --Set mime header
    --owa_util.mime_header('text/xml');
    --Generate XML
    xmlString := xmlgen.getXML(sql_string);
    --Output XML
    dbms_lob.open(xmlString,DBMS_LOB.LOB_READONLY);
    loop
    dbms_lob.read(xmlString,amount,position,charString);
    htp.prn(charString);
    position := position + amount;
    end loop;
    dbms_lob.close(xmlString);
    dbms_lob.freetemporary(xmlString);
    exception
    when no_data_found then
    dbms_lob.close(xmlString);
    dbms_lob.freetemporary(xmlString);
    end createDynamicXML;
    null

    The user the xml sdk was installed in and its privs is:
    CREATE USER "XML" PROFILE "DEFAULT"
    DEFAULT TABLESPACE "USERS"
    TEMPORARY TABLESPACE "TEMP"
    ACCOUNT UNLOCK;
    grant connect to XML;
    grant resource to XML;
    grant javauserpriv to XML;
    grant javasyspriv to XML;
    I suppose I can give the XML user it's own temp tablespace to save the rest of the production environment from going down.
    But does not solve the problem :(
    -James
    null

  • Generate XML using package xmlgen

    I have the following query:
    select employ_id, last_name, first_name, salary from employ;
    I need generate xml like this:
    <row>
    <employ>
    <employ_id last_name="Dennis" First_name="david">1</employ>
    <salary>6</salary>
    </employ>
    </row>
    How can I get it using xmlgen package? Thanks.
    null

    No, you will not be able to do that. The
    problem is that the columns of the db table
    are mapped to XML elements rather then
    attributes. Your best bet at achieving your
    goal is that after you get your xml document
    from the XSU, you transform it using XSLT.
    The Oracle Parser does include the xsl processor.
    visar
    ps.: Today, when using XSU's java API, you can directly get a DOM tree representation of the XML document, which then you can pass directly to the XSL processor and transform it; unfortunately, the PL/SQL API (i.e. xmlgen) doesn only return a string (i.e. lob) representation of the XML doc. So you have to use the PL/SQL Parser to parse it, get it in the DOM format, and only then can you transform it. The good news is that I was assured that in the future the XMLGEN will have a call to get the XML doc in DOM rep.

  • Using xmlgen in a trigger -HELP

    We are trying to use xmlgen in a trigger, actually a insteadOf on a view but that is really secondary.
    The problem we have is that xmlgen doesnt seem to work from a trigger or any other background process. There is no reall erro messgae it just fails.
    Has anyone used xmlgen from a trgigger??
    Rob

    Can't this be done.....
    create or replace trigger audit_EMP_DTL
    before update or delete or insert
    on EMP_DTL
    for each row
    declare
    pragma autonomous_transaction;
    v_blockexists number := 0;
    no_lock exception;
    ReturnExp EXCEPTION;
    begin
    select     count(a.sid) into v_blockexists
    from     v$session a
    where     a.sid=(select     tab1.sid
              from     v$lock tab1, v$lock tab2
              where     tab1.block =1
              and     tab2.request > 0
              and     tab1.id1=tab2.id1
              and     tab1.id2=tab2.id2
    if v_blockexists = 0 then
    insert into audit_blocks(program_name) values ('No block yet');
    commit;
    RAISE ReturnExp;
    end if;
    EXCEPTION
    WHEN ReturnExp THEN
    NULL;
    END;

  • Size Limits to xmlgen.insertXML and Steves XMLLoader

    Hi,
    What are the size limits are for xmlgen.insertXML? Can you only insert a varchar sized document? i.e. not a clob directly? - It always seems to fail past a certain document size (about 1600 records of a table with one number column)
    I've also tried using XMLLoader from Steves book - but that failed on large tables too. (12,000 records and 20 columns).
    Any help much appreciated!
    Simon.
    null

    Hi,
    As everyone knows ;-) there is no memory probems in java, but...
    I was able load clobs and long varchar2 columns into the database, but it used to hung from time to time - I'm using the XSQL commandLine and servlet on both unix and NT.
    I've found out that some of the problems are related to the jdk, the hunging problem on mass load was solved when I moved to jdk 1.2.2... and no version earlier, also I think I've installed a solaris patch relating to java, but I don't realy remember.
    By the way, If you are using clobs try using thin driver instead of oci8 driver it solve some problems for me.
    It it always worse checking your rollback segments and so.
    Hadar

  • Xmlgen.SetbindValue example

    Can someone give me a code example of using xmlgen.setbindvalue and the proper format of the xmlgen.getxml() method.
    Thanks

    I'm not exactly sure what your problem is. You are able to bind the same value to another variable with a different name. If you won't know how many variables will appear in your select statement then you have a problem with how the XSU works. The XSU requires you know the structure of the SQL statement you pass it.
    You could execute v_query using Native Dynamic SQL in 8i with a using clause containing your bind values. This should allow you to dynamically build your query with n amount of bind variables.
    Also, you really should be using DBMS_XMLQUERY instead of XMLGEN. XMLGEN is there for backward compatibility, but DBMS_XMLQUERY is the latest and greatest XSU.
    See the Oracle XML Portal website for more info at www.webspedite.com/oracle.
    Regards,
    Jason M Cohen

  • MissingResourceException with XMLGEN

    When creating an XML doc in a stored procedure using the XMLGEN call, I get the
    following error message:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.util.MissingResourceException: can't find resource for oracle.xml.sql.mesg.XSUMessages_en_US
    ORA-06512: at "DBADUDE.XMLGEN", line 465
    ORA-06512: at "DBADUDE.XMLGEN", line 456
    ORA-06512: at "USERDUDE.MY_QUERY", line 85
    ORA-06512: at line 25
    I think there is a lower level problem
    that is trying to be reported here, but since
    the message class doesn't appear to be
    available, I don't know. This error occurs
    when I try a query that should return about
    180 rows (each row is not very large). It
    does not occur what I do "select sysdate from
    dual". But, once it does occur, I get it
    on my sysdate query too. I have to close
    the connection and reopen to clear the
    error.
    Thanks,
    Gary Corsar
    [email protected]
    null

    We're using xsu 1.2. I looked in the xsu12.jar and didn't find the XSUMessages_en_US file anywhere. There is XSUMesages.properties in the oracle.xml.sql.mesg directory, but nothing else. Could this be what it wants or is this a leftover from an earlier release? Is there any way to at least determine at this point what the error code is? There's a very good chance it is trying to tell me there is no more memory.

  • Please,I Can't deploy Union Comand in SQL Stament With XMLGEN

    I Have a Problem in SQL Stament
    I Traying execute this SQL Stament With XMLGEN
    Select
    Number as "@Number",
    NumRow as "@NumRow"
    from
    NewTable1
    Union
    Number as "@Number",
    NumRow as "@NumRow"
    from
    NewTable2
    Result: Show only NewTabla1 Rows.
    How I Can Solution This Problem

    Unless you're using the max-rows property which might be restricting the total number of rows, there's no way that XSU itself could affect the query outcome.
    If you reverse the order of the queries
    in the UNION, do you only get the rows from TABLE2 instead? Or regardless of order, you only get them from TABLE1?

Maybe you are looking for

  • Transferring music from hard drive to new macbook

    So here is my situation I can't seem to figure out. On my old imac, I kept all  of my music on an external hard drive. Now that I have a new macbook pro, I would like to transfer the libary on to the itunes, while keeping it on the external hard driv

  • How to assign theme for a particular user

    Hi All, I am new to portal development. I have make one theme Kuldeep_theme. I have already assign the rules and pages. But still its not working for the user given. Kindly give the instruction to apply the theme to a user. Thanks in advance Regards,

  • Like and NCHAR

    Hi, I have a column with Nchar(12) datatype. Values in the columns are numbers and stored with leading spaces DDMCU 40303 40304 40304 10555 This column is used in a query where user is allowed to pass the value user is allowed to enter '%40303%,'%403

  • Freely programed F4 help

    Hello Experts, i want to create a freely programed F4 help for one of the attribute in my context. can anyone tell me how to go about it step by step. Thanks, gunjan

  • What are the actions required immediately?

    DB: 10.2 Hello All, I had some issues. I used rman utility to run the backup after that I run CROSSCHECK command. rman> CROSSCHECK copy; rman> CROSSCHECK backup; & rman> DELETE EXPIRED backup; I am getting following output. logged as a sys (sysdba) S