Error inserting XML records 4000 bytes through Pro*C

Hi,
I am seeing the following error while trying to insert XML records > 4000 bytes (Records < 4000 bytes get inserted without any issues). Any help in resolving the issue would be highly appreciated.
ORA return text: ORA-01461: can bind a LONG value only for insert into a LONG column.
I am also able to insert records > 4000 bytes using the following query, But, I want to insert the records through a C application (using Pro*C) that is not running on the database server.
INSERT INTO MY_XML_TABLE
VALUES (XMLType(bfilename('XML_DIR', 'MY_FILE.XML'),
nls_charset_id('AL32UTF8')));
Oracle Version
===============
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Solaris: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Pro*C/C++ version:
====================
Pro*C/C++ RELEASE 11.2.0.0.0 - PRODUCTION
Schema registration:
====================
begin
DBMS_XMLSCHEMA.registerSchema (
SCHEMAURL => 'MY_XML_SCHEMA.xsd',
SCHEMADOC => bfilename ('ENG_REPORTS', 'MY_XML_SCHEMA.xsd'),
GENTYPES => FALSE,
OPTIONS => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
CSID =>nls_charset_id ('AL32UTF8'));
end;
Table creation
===============
CREATE TABLE MY_XML_TABLE (
MY_XML_RECORD XmlType )
XMLTYPE MY_XML_RECORD STORE AS BINARY XML
XMLSCHEMA "MY_XML_SCHEMA.xsd" ELEMENT "MYXMLTAG" ;
Record Insertion (Pro*C generated code):
=========================================
/* EXEC SQL FOR :l_sizeof_array_togo
insert INTO MY_XML_TABLE
(MY_XML_RECORD )
VALUES( XMLTYPE(:l_XML_ptr INDICATOR :l_XML_indicators )); */
struct sqlexd sqlstm;
sqlstm.sqlvsn = 12;
sqlstm.arrsiz = 1;
sqlstm.sqladtp = &sqladt;
sqlstm.sqltdsp = &sqltds;
sqlstm.stmt = "insert into MY_XML_TABLE (MY_XML_RECORD) values (XMLTYPE(:s1\
:s2 ))";
sqlstm.iters = (unsigned int )l_sizeof_array_togo;
sqlstm.offset = (unsigned int )20;
sqlstm.cud = sqlcud0;
sqlstm.sqlest = (unsigned char *)&sqlca;
sqlstm.sqlety = (unsigned short)4352;
sqlstm.occurs = (unsigned int )0;
sqlstm.sqhstv[0] = (unsigned char *)&l_XML_ptr->xml_record;
sqlstm.sqhstl[0] = (unsigned long )8002;
sqlstm.sqhsts[0] = ( int )sizeof(struct xml_rec_definition);
sqlstm.sqindv[0] = ( short *)&l_XML_indicators->XML_record_ind;
sqlstm.sqinds[0] = ( int )sizeof(struct XML_indicator);
sqlstm.sqharm[0] = (unsigned long )0;
sqlstm.sqadto[0] = (unsigned short )0;
sqlstm.sqtdso[0] = (unsigned short )0;
sqlstm.sqphsv = sqlstm.sqhstv;
sqlstm.sqphsl = sqlstm.sqhstl;
sqlstm.sqphss = sqlstm.sqhsts;
sqlstm.sqpind = sqlstm.sqindv;
sqlstm.sqpins = sqlstm.sqinds;
sqlstm.sqparm = sqlstm.sqharm;
sqlstm.sqparc = sqlstm.sqharc;
sqlstm.sqpadto = sqlstm.sqadto;
sqlstm.sqptdso = sqlstm.sqtdso;
sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}

After selecting data from xmltab table I just received first line of xmldata file. i.e
<?xml version="1.0" encoding="WINDOWS-12 52"?> <BAROutboundXM L xmlns="http://BARO
That must be a display issue.
What client tool are you using, and what version?
If SQL*Plus, you won't see the whole content unless you set some options :
{code}
SET LONG <value>
SET LONGCHUNKSIZE <value>
{code}
Could you try the following?
{code}
SET LONG 10000
SELECT t.object_value.getclobval() FROM xmltab t;
-- to force pretty-printing :
SELECT extract(t.object_value, '/*').getclobval() FROM xmltab t;
{code}
Edited by: odie_63 on 16 févr. 2011 08:58

Similar Messages

  • Insert multiple records into database through internal table

    Hi
      please help me how to insert multiple records into database through internal table

    Hi,
    Welcome to SCN.
    Press F1 on INSERT statement and you will teh syntax as well the docu for the same.

  • How to insert more than 4000 bytes in BLOB column

    Hi all,
    My oracle version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0.
    I have checked in google and in this forum also, but did not find the answer.
    When inserting into less than 4000 bytes, it is inserting without any issues. If i am inserting more than that, it is throwing
    error like this ORA-01460: unimplemented or unreasonable conversion requested.
    Can anybody guide me how to do this or link.
    Thanks in advance.
    Thanks,
    Pal

    user546710 wrote:
    Hi,
    Thank you very much for your reply.
    Before, I have not worked with BLOB column, so I don't know much about its using. Currently, I am using direct
    insert statement only. Its a normal stored procedure written in a package. I am calling this SP with other columns and
    with this BLOB column. I am able to insert into table, if the inserted file is less than 4000 bytes. If it is more than that,
    I am getting that problem.
    Thanks,
    VenuSQL variables can only hold 4000 bytes.
    PL/SQL can hold up to 32767
    I am getting that problem. 100% lacking in actionable detail
    post code & COMPLETE error message & code

  • Error : idoc xml record in segment attribute instead of SEGMENT

    hi friends
    can any one solve my problem. In message mapping I mapped with a IDOC. In message mapping I Mapped all the fields. Still I am getting the error as "IDOC XML RECORD IN SEGMENT ATRIBUTE INSTEAD OF SEGMENT" I dont know about this error.
    can any one solve this problem please . I am doing this scenario since 5 days. help me..
    thanks in advance
    Vasu

    Hi Vasudeva,
    Can you pls provide little more details on the scenario ?
    Also at which place are you getting this error ?
    Assuming that you have created a message mapping for some source message to target IDoc message, here are some suggestions.
    1) Test the message mapping. (are you getting the error in testing itself ?)
    2) Apart from mandatory fields' mapping, are there any constants to be assigned to some IDoc fields ? Or any node to be disabled ? Or any such additional things...
    Regards,

  • IDVD Error: "Insert a recordable DVD disc"

    I created a project in iDVD ready to be burned but each time I insert a disc, before any burning begins, it is ejected with this error message: "Insert a recordable DVD disc". I have tried several different DVDs but nothing works. I came across this problem in a lot of forums but with no successful answer. Does anyone know what to do in this situation???

    iMovie doesn't do any authoring of the disks, so of course it has 'no issue.' iDVD is the authoring program that actually accesses the DVD disk with a direct burn. Disk Utility recognizes almost any disk, but it also is not an authoring program. When using DU for burning, you are burning from the disk image created by iDVD.
    For the best burn success, follow all the others' advice. I use only Verbatim DVD-R disks, burn at 4x or less and have never had a burn issue. My disks play on all DVD players that I have tried. The only issue has been a particular brand of DVD player that misreads some audio tracks, but the other players read all of it just perfectly.

  • Insert a record into UDO through DI API

    Dear All,
    I have a UDO with the type document created. I would like to insert records through DI (Document header and Document Rows). Can you please guide me how to do it?
    Thanks,
    Tamizh

    Hi Tamizh,
    Please have a look at this article:
    /people/daniel.wroblewski/blog/2009/03/26/udo-access-via-di-api-in-pl46
    It should have everything you need to insert and update UDO data. You need to be using SBO 2007A Patch 46 or higher to use this object in the DI API.
    Kind Regards,
    Owen

  • XMLDB-HOWTO  : backup inserted xml-record within database trigger ???

    Given :
    - i've create an xmltype table based on an xsd-schema
    - i've created a relational view on this table
    Everytime a new xml-file is inserted into the xmltype-table, i would want to make a backup of the relation data into a backup-table.
    I've tried to create a database-trigger on the relational view, but i can't use :new.rowid as a reference to the current row.
    Any idea's ?

    Have you tried :new.sys_nc_oid$

  • Cannot insert varchar2 4000 bytes correctly in asp

    I tried to insert 4000 bytes into a filed of varchar2 type
    in an ASP page using bind variables.
    After inserting, I cannot fetch the column correctly. Result was only 2000 bytes.
    In sqlplus I verified that the inserted data was 4000 bytes but a wrong character at 2001 th byte.
    I use oracle 8.1.6.
    This problem is not occurring in JSP.
    Thanks...

    Have you solved your problem yet?
    I think you are experiencing the auto-magical characterset conversions in Windows applications.
    SQL*Plus is still using those non-Unicode Win APIs; on the contrary, your C# application is very probably using the Unicode Win APIs. That means, no matter how you input (Big5 ones, unicode ones, cut-and-paste, .... ), SQL*Plus receives the characters in Big5 form and your C# application receives them in Unicode form. Windows does all the conversions transparently.
    In the SQL*Plus case, the HKSCS characters are in their Big5 UDA/VDA codes. Since both your server and client have NLS_LANG set as ZHT16MSWIN950, these HKSCS Big5 codes are stored in your database intact w/o any conversion. When these characters are displayed, no matter in SQL*Plus or your C# application, they are retrieved in Big5 form and passed to Windows for display. Hence, there is no problem.
    However, when you input these HKSCS characters through your C# application, they are received in Unicode form. I believe that your application is storing these Unicode characters in DB directly and, therefore, they must be converted to "MSWIN950" form by some Oracle components who lacks the full conversion table of Windows. Naturally, HKSCS characters become "??".
    I am not familiar with C# and Windows APIs so I dunno the exact way to solve the problem. Still, the rule-of-thumb is to let Windows does the character set conversions and ensure that the converted data are stored in Oracle w/o further conversions. I think your C# applications should convert the text data from Unicode to Big5 (under Windows) and then save the Big5 data to the “ZHT16MSWIN950” database in Big5 context. This will probably solve your problem.

  • Error in inserting XML document

    I'm trying to insert into a table from an HTML form.
    Here's the table I'm trying to insert into
    TABLE employee
    name VARCHAR2(40),
    ssnum NUMBER NOT NULL
    Note: even though SSNUM is number I take it as a string and I
    have a before insert trigger that converts it to number. Works
    from SQL plus if entry is number.
    Here's the testxsql.html
    <html>
    <body>
    Input your name and ssnumber ..
    <form action="testxsql.xsql" method="post">
    Name<input type="text" name="name_field" size="30">
    SSNUM<input type = "text" name="ssnum_field" size="10">
    <input type="submit">
    </form>
    </body>
    </html>
    it calls testxsql.xsql which is
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="employee.xsl"?>
    <page connection="demo">
    <insert table="employee" transform="testxsql.xsl"/>
    <content>
    <query tag-case="lower" max-rows="5" rowset-element=""
    row-element="emp" >
    select *
    from employee
    order by ssnum desc
    </query>
    </content>
    </page>
    and testxsql.xsl is
    <?xml version = '1.0'?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:for-each select="request">
    <ROW>
    <NAME><xsl:value-of select="name_field"/></NAME>
    <SSNUM><xsl:value-of select="ssnum_field"/></SSNUM>
    <SOURCE>User-Submitted</SOURCE>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    I get the following error while trying to insert
    XSQL-015: Error inserting XML Document
    invalid LABEL name in XML doc-
    If I remove the insert tag, the query portion works fine.
    I'm new to XML so I've already pulled all the hair that I can
    muster. Thanks
    null

    Kumar Pandey (guest) wrote:
    : I'm trying to insert into a table from an HTML form.
    : Here's the table I'm trying to insert into
    : TABLE employee
    : name VARCHAR2(40),
    : ssnum NUMBER NOT NULL
    : Note: even though SSNUM is number I take it as a string and I
    : have a before insert trigger that converts it to number. Works
    : from SQL plus if entry is number.
    : Here's the testxsql.html
    : <html>
    : <body>
    : Input your name and ssnumber ..
    : <form action="testxsql.xsql" method="post">
    : Name<input type="text" name="name_field"
    size="30">
    : SSNUM<input type = "text" name="ssnum_field"
    size="10">
    I'm using apache web and JServ and 8i as db
    : <input type="submit">
    : </form>
    : </body>
    : </html>
    : it calls testxsql.xsql which is
    : <?xml version="1.0"?>
    : <?xml-stylesheet type="text/xsl" href="employee.xsl"?>
    : <page connection="demo">
    : <insert table="employee" transform="testxsql.xsl"/>
    : <content>
    : <query tag-case="lower" max-rows="5" rowset-element=""
    : row-element="emp" >
    : select *
    : from employee
    : order by ssnum desc
    : </query>
    : </content>
    : </page>
    : and testxsql.xsl is
    : <?xml version = '1.0'?>
    : <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    : <xsl:for-each select="request">
    : <ROW>
    : <NAME><xsl:value-of select="name_field"/></NAME>
    : <SSNUM><xsl:value-of select="ssnum_field"/></SSNUM>
    : <SOURCE>User-Submitted</SOURCE>
    : </ROW>
    : </xsl:for-each>
    : </ROWSET>
    : I get the following error while trying to insert
    : XSQL-015: Error inserting XML Document
    : invalid LABEL name in XML doc-
    : If I remove the insert tag, the query portion works fine.
    : I'm new to XML so I've already pulled all the hair that I can
    : muster. Thanks
    null

  • Error saving xml from model to file

    Hello.
    I am trying to create an xml file based on example GEO_DIM.dtd
    I have a dataserver
    jdbc:snps:xml?d=/oracle/product/odi_1/oracledi/demo/xml/GEO_DIM.dtd&s=MY_GEO_SCHEMA&lf=/logs/demo_geo_dim.log&ll=31
    xml model works fine. I can do Insert into and populate the whole model with data.
    When I try to save it on the disk using (on target)
    create xmlfile ' /tmp/test_demo_geo.xml' from schema MY_GEO_SCHEMA
    I get an error
    ODI-1272: The Logical Schema has not been set on source for populate_demo_geo.
    Caused By: java.lang.NullPointerException
    at com.sunopsis.jdbc.driver.xml.SnpsXmlPreparedStatementRedirector.executeUpdate(SnpsXmlPreparedStatementRedirector.java:625)
    What this driver wants from me?
    I just want to write the xml I’ve created to the disk.
    I’ve tried to do this CREATE XMLFILE command on source, but, it doesn’t help either. I just receive
    java.lang.NullPointerException
    at com.sunopsis.jdbc.driver.xml.SnpsXmlPreparedStatementRedirector.executeUpdate(SnpsXmlPreparedStatementRedirector.java:625)
    at com.sunopsis.jdbc.driver.xml.SnpsXmlPreparedStatement.executeUpdate(SnpsXmlPreparedStatement.java:113)
    Please, It just makes me mad, sorry…

    Hi Lembit,
    Thanks for posting current syntax to write the xml file.
    Even i am triying the same to write out an xml file from my xml schema.
    I executed my interface which inserted 3 records into target XML schema and inserted data i can in the XML model data store.
    I wrote a procedure to write XML schema data including newly inserted 3 records, i went through,but all record of XML model is written into file.
    my create xml command looks like create xml file "D:\temp\XML\gan_out.xml" from schema DEPT_TRG_SCH.
    Now i have around 10 records in the XML datastore in target XML model. I want to write an XML file each record from XML data store.
    Please help,
    Thanks,

  • Inserting a record through XML into the tbale

    Hi,
    When i insert a record into a table through XML data which is through CLOB,
    the data gets inserted and when i commit the ransaaction and check in my table, the data gets inserted for only few feilds and the remaining feilds will be blank , though the value in the field is inserted through XML.
    please get back to me at the earliest.

    are you sure you can see the hole content?
    increase the maximum width for displaying CLOB:
    SQL> desc test
    Name Null? Typ
    DATA CLOB
    SQL> insert into test values ('<EMPS><EMPLOYEE_ID>200</EMPLOYEE_ID>
    2 <FIRST_NAME>Jennifer</FIRST_NAME>
    3 <LAST_NAME>Whalen</LAST_NAME>
    4 <EMAIL>JWHALEN</EMAIL>
    5 <PHONE_NUMBER>515.123.4444</PHONE_NUMBER>
    6 <HIRE_DATE>17-SEP-87</HIRE_DATE>
    7 <JOB_ID>AD_ASST</JOB_ID>
    8 <SALARY>4400</SALARY>
    9 <MANAGER_ID>101</MANAGER_ID>
    10 <DEPARTMENT_ID>10</DEPARTMENT_ID></EMPS');
    1 row created
    SQL> select * from test;
    DATA
    <EMPS><EMPLOYEE_ID>200</EMPLOYEE_ID>
    <FIRST_NAME
    SQL> set long 500
    SQL> select * from test;
    DATA
    <EMPS><EMPLOYEE_ID>200</EMPLOYEE_ID>
    <FIRST_NAME>Jennifer</FIRST_NAME>
    <LAST_NAME>Whalen</LAST_NAME>
    <EMAIL>JWHALEN</EMAIL>
    <PHONE_NUMBER>515.123.4444</PHONE_NUMBER>
    <HIRE_DATE>17-SEP-87</HIRE_DATE>
    <JOB_ID>AD_ASST</JOB_ID>
    <SALARY>4400</SALARY>
    <MANAGER_ID>101</MANAGER_ID>
    <DEPARTMENT_ID>10</DEPARTMENT_ID></EMPS
    SQL>

  • How to insert External XML file content into XMLTYPE through Pro*c

    Could any one sugest me how to insert a external XML file content into Db
    into XMLTYPE datatype through Pro*c program.
    Thanks for any help...... who has done this
    Ghanta Tagore

    Hi
    After some good fight of 3 days, I have done it through Pro*c
    This is the way to handle this
    Buffer-->Temporary Clob-->XMLTYPE(using CreateXml)
    Pasting my piece o code to do this
    ===============
    OCIClobLocator *license_txt;
    varchar h_ttt[1024] = {'\0'};
    ub4 amt;
    int i;
    EXEC SQL ALLOCATE :license_txt;
    EXEC SQL LOB CREATE TEMPORARY :license_txt ;
    GetName(name); /*Gets Name to insert into name column in License Table*/
    for(i=0; i<4;i++)
    GetXMLL((char *)h_ttt.arr); /*Gets a string value of XML into this example*/
    /*<Tagore>Is From TCS Delhi</Tagore>*/
    /*This can be changed to get buffer from FILE */
    h_ttt.len = strlen((char *)h_ttt.arr);
    amt = sizeof(char) * h_ttt.len ;
    EXEC SQL LOB WRITE APPEND :amt FROM :h_ttt INTO :license_txt;
    EXEC SQL
    INSERT INTO license_table VALUES (:sss, :name, sys.xmltype.createXML(:license_txt))
    ================
    Thanks For ur Help
    Tagore Ghanta

  • Error in inserting a record in to table

    hi..
    i created a trigger....when i am trying to insert new record in to table i am getting the fallowing error...plz kindly help me out from this...
    SQL> create or replace trigger secure_emp
    2 before insert on employees begin
    3 if(to_char('sysdate','DY') in ('SAT','SUN')) or
    4 (to_char('sysdate','HH24:MI') not between '8:00' and '18:00') then
    5 raise_application_error(-20500,'error');
    6 end if;
    7 end;
    8 /
    Trigger created.
    SQL> insert into employees(employee_id,last_name,first_name,email,hire_date,job_id,salary,department
    _id)
    2 values (300,'smith','jack','SJACK',sysdate,'IT_PROG',4500,60);
    insert into employees(employee_id,last_name,first_name,email,hire_date,job_id,salary,department_id)
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "SCOTT.SECURE_EMP", line 2
    ORA-04088: error during execution of trigger 'SCOTT.SECURE_EMP'

    Yeah. Whenever Oracle sees TO_CHAR('string_literal1', 'string_literal2), it implicitly converts it to TO_CHAR(TO_NUMBER('string_literal1'), 'string_literal2). That's why an error in trigger occurs.
    SQL> explain plan for
      2  select null
      3    from dual
      4   where dummy = to_char('A', 'DY');
    Explained
    SQL> @utlxpls
    Cannot SET MARKUP
    PLAN_TABLE_OUTPUT
    Plan hash value: 397561404
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"=TO_CHAR(TO_NUMBER('A'),'DY'))
    13 rows selected

  • Receiver JDBC: Error while doing the Deleting and Inserting new records

    Hi All,
              I am doing Idoc to JDBC scenario. In this I am collecting & bundling different type of Idocs and then sending to the JDBC receiver. My requirement is to delete the existing records in the database and insert the new records. I have configures as mentioned in the link
    Re: Combining DELETE and INSERT statements in JDBC receiver
    In the above link its shows for single mapping. In my scenario I am using multi mapping for collecting idocs in BPM. If I configured for normal mapping then it is working fine(Deleting existing records and Inserting new record). Whenever I am using multi mapping then I am getting following error in the receiver JDBC communication channel u201CError while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)u201D . Can you please tell me what might be the problem.
    Thanks & Regards,
    T.Purushotham

    Hi !
    check this out:
    JDBC - No 'action' attribute found in XML document - error
    JDBC receiver adapter: No 'action' attribute found in XML document
    It appears that the inbound payload (the one that is going from XI to the JDBC adapter) does not have the requiered tag to specify which SQL action to execute in the receiver system. Maybe the multimapping is not creating the desired output message format.
    Regards,
    Matias.

  • Trying To Insert XML String Greater Than 4000 Characters in PHP Fails

    Dear Sir,
    Subject:-Trying To Insert XML String Greater Than 4000 Characters in PHP Fails ORA-01704.
    In an attempt to design web app in PHP and inserting data into "CLOB" field of "articles" table associated with it, returning ORA-01704: string literal too long error.
    Platform: OEL5
    Database 11g(11.0.7.0)
    php : 5.2
    I refer to oracle document ID: [ID 336888.1] it is asking to contact support.
    Please help us in this regards.
    Many Thanks,
    mkyazdani

    Hi,
    I appreciate you, yes it is similar i have referred that manual and also inform to our php developer about the changes we need to make in our php script.
    Regards,
    mkyazdani

Maybe you are looking for

  • Can't use my iPhone 3GS after trying to download iOS6?

    I do I Reset my iPhone 3GS after trying to download iOS6?

  • Can you use an ActiveX in PL/SQL

    I am trying to find a way to start email from within a database trigger. Someone told me I could use an ActiveX Control (custom made by a colleague). Although I have never worked with ActiveX or OLE, I know that it is possible to use them in Forms. I

  • When I try to close one tab, the tabs dissapear

    When I have "Always show the tab bar" checked, tabs work normally. However, when I turn "Always show the tab bar" off, I get this problem: If I have a bunch of tabs open and I close one, it leaves the next one open, but the tab bar dissapears, making

  • Problem with wifi connection ever since I upgraded to ios 6?!

    My wifi isn't working right and I just upgraded to ios about an hour ago. I clicked on the wifi network I wanted to join, and I have a connection but when I click on it, apple.com comes up and asks me to "Log In" but on the page it says "Sorry the pa

  • Importing Email Contacts

    Why can't I successfully import my gmail contacts? I export them from Gmail as directed but when I try to import them, I get one contact only