Oracle XMLtype data type
Latest Powerbuilder 12.5.2
Oracle 11g
How can I update a XMLType column?
can select it, but errors on update.
Sorry about that, I got the information from this link:
XMLType Operations
I guess we need to get the right syntax in sqlplus (or equivalent) then map that to PB.
The other alternative is to create a procedure to do the update for you, pass in a clob and convert that. The 4k limit you are seeing is the limit on a varchar2. All the xml work I have done has involved endless conversions.
CREATE OR REPLACE PROCEDURE xmlupdate (xmlin IN CLOB, xmlout OUT CLOB)
IS
txml XMLTYPE;
BEGIN
-- Convert Clob Received into an XML document
txml := xmltype (xmlin);
END;
Similar Messages
-
JDBC insert with XMLTYPE data type
Hi,
SOAP to JDBC scenario. Oracle 11G as a receiver.
Requirement is to insert whole xml payload message in one of Oracle table fields as a xml string. Target oracle DB table column is defined with XMLTYPE data type, it has capacity to hold xml data more than 4GB. I am using graphical mapping with direct INSERT statement.
When I try to insert xml payload with smaller size transaction goes through. However when the xml payload size increases it is giving following error in JDBC receiver communication channel monitoring.
Could not execute statement for table/stored proc. "TABLE_NAME" (structure "StructName") due to java.sql.SQLException: ORA-01704: string literal too long
Here is insert statement as in communication channel monitoring. (Note: XML payload with bold characters is truncated)
INSERT INTO TABLE_NAME (REQ_ID, OUTAGE_OBJ, TIMESTAMP, PROCESSED_FLAG) VALUES (VAL1, <?xml version="1.0" encoding="UTF-8"?>............</>, TO_DATE(2010-11-15 10:21:52,YYYY-MM-DD HH24:MI:SS), N)
Any suggestions to handle this requirement?
Thank you in advance.
Anand More.Hi Anand,
The problem here is definitely the length of the SQL query. i.e "INSERT INTO ......... VALUES......."
This is what i got when i searched for this ORACLE error code:
ORA-01704: string literal too long
Cause: The string literal is longer than 4000 characters.
Action: Use a string literal of at most 4000 characters. Longer values may only be entered using bind variables.
Please ask a ORACLE DB expert on how to handle this Also i am not sure how can we handle Bind Varibales in SAP PI.
I hope this helps.
Regards, Gaurav. -
ADF View Object query to use Oracle LONG data type
Hi,
I'm using a view object that uses Oracle LONG data type.The following exception is thrown
*"java.sql.SQLException: Stream has already been closed"* and it is not fetching the correct data.
I have searched in many forums,they suggested to use LOB instead of LONG as LONG is deprecated. But in my case I can't avoid using LONG as some of my legacy applications using the same DB.
Please suggest me a way
Thanks in Advance
FelixThanks for your reply Arun,
I have solved this problem using the solution suggested by this blog [AskTom-Link|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839298816582]
In the above blog link,they have suggested to convert Long to Varchar by functions and asked to use this function in the column.
Thank you all guys who have seen this post.
Regards,
Felix -
Problem loading PostgreSQL Bytea data type to Oracle Raw data type
We are migrating our database from PostgreSQL to Oracle. First, we convert the BYTEA data type in PostgreSQL to Oracle RAW. The BYTEA data type is variable bytes array. How can we load the BYTEA data type to Oracle RAW data type? Or I have to convert to different data type. thanks.
Peter,hi,
Instead of 'interval day to second' in method declaration use internal datatype 'DSINTERVAL_UNCONSTRAINED'.
There are more unconstrained types in oracle.
Bartek -
Oracle-specific data types vs Connection pool
Hi, using Oracle-specific data types such as
ArrayDescriptor and create it by a connection to an Oracle database from a WebSphere datasource throw a ClassCastException. There is no problem using these Oracle-specific data types when the connection is obtained via the DriverManager. WebSphere cannot fix the problem because these data types are
not part of the JDBC specification.
Some reply from Oracle?
Thank you very much.Thank you but I there is no solution in that thread.
Also, I know that WebLogic from BEA has a way around this issue... No Websphere work around ?
No Oracle fixing ?
Thanks. -
How could I Write data into a field in Oracle whose data type is VARCHAR2
The target data I want to write into Oracle is in http://tw.yahoo.com/info/utos.html.
Now, these data is stored in Mysql database and the field which stores these data uses "Text" as its data type.
I want to derive these data from mysql database and store them into a field of oracle database.
In oracle, I create field whose data type is varchar2(4000) to store these data.
I use JSP to derive data from mysql and insert into oracle through JDBC.
But the result of the page shows me that "javax.servlet.ServletException: Data size bigger than max size for this type: 25623".
Please anyone could help to resolve this problem?
Thank you very much.My hunch is that the problem is that VARCHAR2(4000), but default, allocates 4000 bytes of storage. Depending on your database character set, a single character may require up to 4 bytes of storage.
If you are on 9i, you can declare the column VARCHAR2(4000 CHAR) to allocate 4000 characters of storage. You can also set NLS_LENGTH_SEMANTICS to CHAR, which will cause Oracle to assume that your declarations are in characters rather than bytes.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Hi,
We are using for all Oracle number columns the Oracle parameter type OracleType.Number.
Now we have seen that we can also use the type OracleTyp.Int32.
Is it better or faster to use this type for columns
which can use this type.
Have anybody experience with using Oracle data types ??
Kind Regards
MartinIt really depends on what kind of data you're inserting or updating. If you've data that can be accomodated in an integer, you should use OracleDbType.Int32 over OracleDbType.Decimal. You get much better performance by using Byte, Int16, Int32, Single, Double over Decimal but these types can not hold the same precision and scale as Decimal type can.
-
How to avoid oracle implicit data type conversion
Hello,
i have a query like below..
SELECT EMP_NUM
FROM EMPLOYEE
WHERE EMP_NUM=SOURCE_EMP_NUM;
1. My SOURCE_EMP_NUM data type is varchar2.
2. My table EMP_NUM data type is number.
3. In one case my SOURCE_EMP_NUM value '00000123'
4. I have an entry in table for EMP_NUM as 123.
5. In this case my query is success and giving me row for 123, which i don't want it should compare with leading zeros. But due to oracle implicit conversion the comparision getting passed.
6. I have an index for this column, so i can't use "like" operator...
Can somebody help me.....
Thanks in adv....HI,
Just see this :---
SQL> select * from emp where deptno=00020;---------deptno is number, 00020 is number and its true
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7566 JONES MANAGER 7839 02-APR-81 2975 20
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
SQL> select * from emp where to_char(deptno)=00020;=-------------deptno is character type and 00020 is number so still it is leaving 0000 from 20 as it number and has no impact,
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7566 JONES MANAGER 7839 02-APR-81 2975 20
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
SQL> select * from emp where to_char(deptno)='00020';---now both are character and no row is selected.
no rows selected
So you can avoid the implicit conversion according to the requirements and in this case we are usin to_char function to avoid this.
Regards,
Navneet -
Oracle Object Data Type and EJB
Hi, All:
Has anyone implemented a project with Oracle user-defined data type (Object
Data Type) together
with EJB? That is, using ORDBMS (Object Relational Database) together with
EJB. I am thinking to use ORDBMS together with EJB. Any information, samples
and references to this direction is appreciated.
Thanks,
John Wen
RM2M, LLC
[email protected]I''ve got a solution! I've had sql in my query
SELECT
ltrim(OPERATIVE_REPORT."orderText",11),
OPERATIVE_REPORT."resolID",
COUNT(OPERATIVE_REPORT."(usrID)order_executionUser")
FROM
OPERATIVE_REPORT
GROUP BY
ltrim(OPERATIVE_REPORT."orderText",11),
OPERATIVE_REPORT."resolID"
where orderText has clob datatype. And the reason is GROUP BY. GROUP BY deny CLOB usage. -
Oracle apps data type number came over to disco as varchar
created custom foler ( fnd_flex_values_vl) using sql, one of DFF item ( original data type is number) shows as varchar. Anybody knows how to convert this to number , I tried to_number but still shows as text in Desktop.
Sorry, thought you'd said it was a function originally.
Okay, so as a custom folder, is it possible that there are NULLs being encountered in the attribute1 field?
ie:
select flex_value_set_id, flex_value_id,flex_value, description,
to_char(attribute1,'999,999,999') budget,to_number(attribute1,'999,999.99') Budget_amount_number
from fnd_flex_values_vl
where flex_value_set_id='1004012'
becomes:
select flex_value_set_id, flex_value_id,flex_value, description,
to_char(NVL(attribute1,'0'),'999,999,999') budget,to_number(NVL(attribute1,'0'),'999,999.99') Budget_amount_number
from fnd_flex_values_vl
where flex_value_set_id='1004012'
or is it something more difficult?
Russ -
Oracle Materialized view with xmltype data type
this the table having in db1 i need to create materialized view db2 for this table i have followed below steps..
create table WORKSHEETMASTER
METHODID NUMBER(10),
WORKSHEETCODE VARCHAR2(50 BYTE) not null,
WORKSHEET SYS.XMLTYPE);
create materialized view log on db1.WORKSHEETMASTER;
db2
CREATE MATERIALIZED VIEW WORKSHEETMASTER
REFRESH FAST ON DEMAND
AS
SELECT METHODID,
WORKSHEETCODE,
worksheet FROM db1.WORKSHEETMASTER@DBLINK;
when i was create materialized view above script in db2 iam getting error
ORA-22992:cannot use LOB locators selected from remote tables
like this when remove the worksheet column created succesfully may know how achieve this problem
my database version 11g iam searched some sceniour not full filled
need for help
thanksthis the table having with in DB1
create table WORKSHEETMASTER
METHODID NUMBER(10),
WORKSHEETCODE VARCHAR2(50 BYTE) not null,
WORKSHEET SYS.XMLTYPE,
WORKSHEETID NUMBER primary key,
CREATEDDATE DATE,
CREATEDBY VARCHAR2(50 BYTE),
WORKSHEETNAME VARCHAR2(50 BYTE),
UPDATEDDATE DATE,
UPDATEDBY VARCHAR2(50 BYTE),
NOOFROWS NUMBER(3),
NOOFCOLUMNS NUMBER(3),
WORKSHEETTYPE CHAR(1 BYTE),
SUBSTRATEUSED VARCHAR2(50 BYTE),
STATUS NUMBER(1),
APPROVEDBY VARCHAR2(50 BYTE),
APPROVED CHAR(1 BYTE) default 'N',
APPROVALREMARKS VARCHAR2(100 BYTE),
LNG_WORKSHEETNAME VARCHAR2(50)
iam trying to create materailzed view in db2
create materialized view WORKSHEETMASTER
refresh fast on demand
as
SELECT METHODID,
WORKSHEETCODE,
WORKSHEETID,
worksheet,
CREATEDDATE,
CREATEDBY,
WORKSHEETNAME,
UPDATEDDATE,
UPDATEDBY,
NOOFROWS,
NOOFCOLUMNS ,
WORKSHEETTYPE,
SUBSTRATEUSED,
STATUS,
APPROVEDBY,
APPROVED,
APPROVALREMARKS,
LNG_WORKSHEETNAME FROM db1.WORKSHEETMASTER@DBLINK; --remote database
iam creating above scriprt in db2 getting error this my total script -
Materialized view with xmltype data type
Hello to all,
I have a challenge with my 10g r2 database. I need to make a materialized view from a table in this format:
Name Null? Type
RECID NOT NULL VARCHAR2(200)
XMLRECORD XMLTYPE
,my problem is that (as i read from docs) i cant make the view refreshable on commit and also i cant refresh the mv in fast mode ( i dont need to refresh mv complete - takes too long).
Do you have a hint for this?
Thank you in advance.
Danielhi,
I cant upgrade to 11g.Also i cant change the table structure.
Here is a sample of xmltype field content:
RECID XMLRECORD
D00009999 <row id='D100009999'><c2>10000</c2><c3>xxxxx</c3><c5>xxxx..
And i need to extract in the mv the data from c2, c3 and so on.
Still waiting for a hint.
Thank you. -
Weblogic jpa and oracle xmltype column type
Hi,
i try to use jpa with a table with a column of "xmltype"
i use weblogic 10.3.2.0(eclipselink) and i got this error :
java.lang.NoClassDefFoundError: oracle/xdb/XMLType
Of course the xdb.jar and the xmlparverV2.jar are bundled in the ear with the others library,
and i also put them in the lib directory of the weblogic server.
In my persistence class the filed is declared as a "String".
I try also to use a DescriptorCustomizer with a DirectToXMLTypeMapping
to access to the value of the field as a string.
Thank you for your help.Option-1). If you want the classes to be loaded from inside your Application only then you can use ClassLoader filtering ...
That will be a best option ....Just put your Xdb.jar file inside your applications Lib directory and apply classloader filtering. Like this you need not to edit the Server Classpath....so other applications will not be forced to use the Jar which u want for a specific application.
Classloader filtering example demonstrated here: http://weblogic-wonders.com/weblogic/parsers_issues/
<font color=red>Below Option i think will work 95% in your case.</font><br>
Option-2). add the path of this Jar in *"setDomainEnv.cmd"* (This script is present in <DOMAIN_HOME>\bin directory) in the POST_CLASSPATH variable...
set POST_CLASSPATH=D:\oracle\Middleware\user_projects\domains\base_domain\config\lib\oracle.xdb_11.1.0.jar; -
Hi,
I am using ORACLE 7.3.4 database. I am having a problem in updating a column of long datatype in a table t1 with another column from table t2 of long datatype. I have tried setting LONG 1000000 also but this doesn't work. I appreciate any kind of suggestions.
The error it gives is ORA-00997: illegal use of LONG datatype.
Thanks
ReddyI had the same problem too with a newest thin driver. I found that I can read all my characters (bytes) using getBinaryStream() and single-byte read(), but read() never returns -1; instead reading the character before last causes the ArrayOutOfBoundsException you mentioned.
So I just blindly caught the exception and let it go to QA. (sort of
InputStream r = rs.getBinaryStream(field);
if(r == null) ...
StringBuffer sb = new StringBuffer();
try { for(int c = -1; (c = r.read()) != -1;) sb.append((char) c); }
catch(IndexOutOfBoundsException e)
{} // ignore Oracle idiosyncrazy.
finally { r.close(); }
). Please note that getCharacterStream() or getAsciiStream() did not work for me. I did not try deprecated getUnicodeStream(): I decided I would better correctly extract characters in Java from binary data myself if I need them rather than allowing this junky thin Oracle driver to do an extra thing for me. -
Can't update oracle Long data type
Hi All,
Setup
Weblogic 5.1.0sp11, oracle 8.1.6, Solaris8, classes12.zip,
Solaris_JDK_1.2.1_03a
ConnectionPool:
weblogic.jdbc.connectionPool.XXXDBPool=\
url=jdbc:oracle:thin:@10.2.30.50:1521:ZZZZ,\
driver=oracle.jdbc.driver.OracleDriver,\...etc
Problem
I can't seem to write to (insert/update) an oracle type Long column
using connections from the weblogic connection pool. Each entry(as
XML) into this column is fairly large (>1MB). Reading from works fine,
however.
The same configuration(minus connection pool and associated
code/config) via tomcat works fine(read/write), so I'm thinking the
weblogic connection pool is giving me a connection object which
doesn't update this Long column properly.
Using the usual(again works fine for tomcat) :-
//Url = jdbc:weblogic:pool:XXXDBPool
//driver = weblogic.jdbc.pool.Driver
stat = con.prepareStatement("UPDATE BM_RM_USER_DIARY set DIARY=? where
id=?");
//stat.setString(1,diaryData); //use an inputstream instead.
ByteArrayInputStream bais = new
ByteArrayInputStream(diaryData.getBytes());
//StringBufferInputStream bais = new
StringBufferInputStream(diaryData); //deprecated
stat.setAsciiStream(1, bais, bais.available());
stat.setLong(2,userId);
I'm not getting any errors from this update, so I can't really see
what I might be doing wrong. It just returns fine as if it has
succeeded (rows updated = 1)
Assuming I CAN NOT change these settings, are there any other ways I
can programmatically get these inserts working ? Is this even a known
issue ? as i can't find a problem in these postings that quite matches
mine.
Any help appreciated.
Cheers
AlkeshHi All
Just to follow up on this.
The problem was solved by explicitly calling commit() after
the update has taken place.
It seems as though my connection from the connection pool has
autocommit set to false.
Thanks
Alkesh
[email protected] (Alkesh) wrote in message news:<[email protected]>...
Hi All,
Setup
Weblogic 5.1.0sp11, oracle 8.1.6, Solaris8, classes12.zip,
Solaris_JDK_1.2.1_03a
ConnectionPool:
weblogic.jdbc.connectionPool.XXXDBPool=\
url=jdbc:oracle:thin:@10.2.30.50:1521:ZZZZ,\
driver=oracle.jdbc.driver.OracleDriver,\...etc
Problem
I can't seem to write to (insert/update) an oracle type Long column
using connections from the weblogic connection pool. Each entry(as
XML) into this column is fairly large (>1MB). Reading from works fine,
however.
The same configuration(minus connection pool and associated
code/config) via tomcat works fine(read/write), so I'm thinking the
weblogic connection pool is giving me a connection object which
doesn't update this Long column properly.
Using the usual(again works fine for tomcat) :-
//Url = jdbc:weblogic:pool:XXXDBPool
//driver = weblogic.jdbc.pool.Driver
stat = con.prepareStatement("UPDATE BM_RM_USER_DIARY set DIARY=? where
id=?");
//stat.setString(1,diaryData); //use an inputstream instead.
ByteArrayInputStream bais = new
ByteArrayInputStream(diaryData.getBytes());
//StringBufferInputStream bais = new
StringBufferInputStream(diaryData); //deprecated
stat.setAsciiStream(1, bais, bais.available());
stat.setLong(2,userId);
I'm not getting any errors from this update, so I can't really see
what I might be doing wrong. It just returns fine as if it has
succeeded (rows updated = 1)
Assuming I CAN NOT change these settings, are there any other ways I
can programmatically get these inserts working ? Is this even a known
issue ? as i can't find a problem in these postings that quite matches
mine.
Any help appreciated.
Cheers
Alkesh
Maybe you are looking for
-
I need help for all you wise Mac users... please
Yesterday, my beloved Mac started acting strangely. Just before that, I uploaded some photos my daughter emailed to my yahoo address. I placed the 8 photos in IPhoto, then tried to go back to Pogo.com where I spend most of my puter time. (Pogo is ver
-
Information on GoldenGate Monitor (12) and veridata (12) products
We are planning to use GoldenGate Monitor (12) and veridata (12) products. I found a nice note (Doc ID 1947045.1) for setting up GoldenGate Monitor. does anyone have more information/best practices for Monitor/Veridata setup. I have already gone thro
-
HI Guru, i have purchase the material via import purchase. i found some of the material are defect. now i want to return that material via export to same vendor. in this flow excise part also exsiste. please give the details about the return flow for
-
Access to Exchange email from smartphones
I am in the mioddle of a SBS 2003 to SBS 2011 migration. I have the Exchange Server running on the new server and have run into a problem with accessing some of the email accounts via smartphones. The email works fine from the deskop, as does the Re
-
I tried to run the example HelloWorld given in JNI tutorial. http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html But when I try to build dll I typed under dos C:\Program Files\Microsoft Visual Studio\VC98\Bin>cl -Ic:\jdk1.3.1\incl