on 03-19-2012 8:58 AM
Hi guys,
There is a requirement in PI where we are passing a XML payload to one of the field in database..
For which, i have used "Return as XML" feature and passing the data to Field(type CLOB) at the database...our main intension of doing this to pass Huge volume of data at once....it wors fine for smaller volume of data..but when the volume is huge, it is giving this error
"structure 'StatementName'): java.sql.SQLException: ORA-01704: string literal too long" in Pi-adapter Engine..guess 4000 characters is the biggest size for a string..how can we insert the huge volume of data,may be more than 20,000 characters wiht the help of BLOB/CLOB and with "Return as XML" feature
thanks
Hi Smith,
You will have to change the datatype of the field. As per the error message, CLOB datatype can take maximum 4000 char only... Ask your DB team to change it to appropriate data type.
Regards,
Amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We had to deal with the same scenario
Even though the data type is CLOB on the database when u write an insert statement through XI receiver passing the huge xml in a string variable , it tries to do an insert as a string and that why it fails . Because string has a limit of 4000 char.
. The work around was to write a Stored Procedure . The SP will take the string value passed and assign it to a CLOB variable first and then does an insert command using the variable .
here is a small peek at the stored procedure .
declare
p_data_clob clob;
begin
p_data_clob := xmlString ;
INSERT
INTO tablename
(
column
)
VALUES
( p_data_clob
)
);
end;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The better approach is store huge data in the compressed format and decompress it while retrieveing. This is the feasible solution. Create clob or blob in the db end. When you send the data through PI use UDF to compress it.
Example:
http://java.sun.com/developer/technicalArticles/Programming/compression/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Smith
The error shows that this error is out of the length limit for CLOB type from Oracle DB.
refer below
http://forums.oracle.com/forums/thread.jspa?messageID=1138117&tstart=0
->Oracle DB limit,workaround by reducing characters;
http://www.evilcyborg.com/lounge/?id=1245->workaround by using the tag
"cfqueryparam";
the solution to the Oracle CLOB size restriction is to use bind variables inside a stored
procedure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You no need to do anything from your end, DB team has to take care about this, check with your DB team they can accept more than 20k characters also.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.