Slicing a CLOB
I am pulling from what is equivalent to a CLOB in Oracle from a Sybase table.
Is there a way I can select only part of the CLOB for a particular id?
This CLOB has comments for all ids. However I need to be able to pull a comment for each id. I have a table in Oracle with a column name of COMMENTS.
I need to map the comment with the id it belongs too. Is it possible?
Are you working with a Sybase database? Or an Oracle database?
Does the COMMENTS table have a single row in it? Or does it have one row per "particular id"?
If there is a single CLOB with comments for all id's, you would have to parse the CLOB-- the DBMS_LOB package has a number of functions to do this assuming you are using Oracle. But this package is not available in Sybase. And you'd need to know the internal structure of your data to know how to write the logic to go about parsing the data.
Justin
Similar Messages
-
Clob DataType, NULL and ADO
Hello,
First, I'm french so my english isn't very good
I have a problem with Oracle Clob DataType. When I try to put NULL value to
CLOB DataType with ADO, changes aren't not made.
rs.open "SELECT ....", adocn, adOpenKeyset, adLockOptimistic
rs.Fields("ClobField") = Null ' In this case, the Update doesn't work
rs.update
rs.Close
This code works if I try to write a value which is different than Null but
not if is equal to Null. Instead of having Null, I have the old value
(before changes), the update of the field doesn't work.I experience the same, did you find a solution to your problem?
Kind regards,
Roel de Bruyn -
How to load a client file in a clob using sqlcl
How to load a client file in a clob using sqlcl
You don't "load" jars. If it's on the classpath, you can obtain individual resources from it using various methods on either Class or ClassLoader. Do you mean "how to add a jar to the classpath at runtime"? Can't be done without using a classloader, typically URLClassLoader or a subclass thereof. Why you want to not use the proven method is beyond me. Presumably because you don't understand classloading. In which case, forget it.
-
Hi all,
I am trying to use UTL_FILE.PUT_LINE to output an XML file. This xml file is the result of a select query. Hence converting the result of the select query into xml format using dbms_xmlgen.getxml and storing it in a variable. But the resultant xml data > 32k . What would be the best way to store it in variable? When using CLOB datatype, getting a numeric value error.
Thanks in advance.As you didn't post the code, nor included a four digit database version, you are asking someone to look in a crystal ball.
Sorry, they are out for repair.
Also the XDB forum would be more appropriate.
Sybrand Bakker
Senior Oracle DBA -
String literal too long error while invoking a package with clob variable
I have a package.One of the input variables of the procedure in packae is clob.
I want to invoke this package with a huge clob as input.
when i invoke this package like that i am getting following error
PLS-00172 string literal too long
can't we pass clob(huge clob) as input .is there any solution for that ?
Thanks
Pramod Garre842802 wrote:
If insert this data into a table , from sql prompt still i get the same error.Do you mean SQL*Plus? Then there is buffer limitation and it is better to split literal into, let say 1000 character chunks:
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Mar 29 16:17:26 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
6 from dual;
TO_CLOB('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
SQL> SY. -
How to find out list of clob/blob tables in a schema
Hi,
I have tricky situation...i have 119 tables out of which 11 tables are clob/blob tables...is there any view where i can find out list of tables are clob/blob tables? (at schema level view means user_<>)
-- Raman.USER_TAB_COLS includes the data type, column name, and table name for each column in each table in the system. You could query that looking for columns with a DATA_TYPE of CLOB or BLOB. If some tables have multiple LOB columns and you want them to appear only once, you'd have to throw a DISTINCT on the table name.
Justin -
Can't fetch clob and long in one select/query
I created a nightmare table containing numerous binary data types to test an application I was working on, and believe I have found an undocumented bug in Oracle's JDBC drivers that is preventing me from loading a CLOB and a LONG in a single SQL select statement. I can load the CLOB successfully, but attempting to call ResultSet.get...() for the LONG column always results in
java.sql.SQLException: Stream has already been closed
even when processing the columns in the order of the SELECT statement.
I have demonstrated this behaviour with version 9.2.0.3 of Oracle's JDBC drivers, running against Oracle 9.2.0.2.0.
The following Java example contains SQL code to create and populate a table containing a collection of nasty binary columns, and then Java code that demonstrates the problem.
I would really appreciate any workarounds that allow me to pull this data out of a single query.
import java.sql.*;
This class was developed to verify that you can't have a CLOB and a LONG column in the
same SQL select statement, and extract both values. Calling get...() for the LONG column
always causes 'java.sql.SQLException: Stream has already been closed'.
CREATE TABLE BINARY_COLS_TEST
PK INTEGER PRIMARY KEY NOT NULL,
CLOB_COL CLOB,
BLOB_COL BLOB,
RAW_COL RAW(100),
LONG_COL LONG
INSERT INTO BINARY_COLS_TEST (
PK,
CLOB_COL,
BLOB_COL,
RAW_COL,
LONG_COL
) VALUES (
1,
'-- clob value --',
HEXTORAW('01020304050607'),
HEXTORAW('01020304050607'),
'-- long value --'
public class JdbcLongTest
public static void main(String argv[])
throws Exception
Driver driver = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
DriverManager.registerDriver(driver);
Connection connection = DriverManager.getConnection(argv[0], argv[1], argv[2]);
Statement stmt = connection.createStatement();
ResultSet results = null;
try
String query = "SELECT pk, clob_col, blob_col, raw_col, long_col FROM binary_cols_test";
results = stmt.executeQuery(query);
while (results.next())
int pk = results.getInt(1);
System.out.println("Loaded int");
Clob clob = results.getClob(2);
// It doesn't work if you just close the ascii stream.
// clob.getAsciiStream().close();
String clobString = clob.getSubString(1, (int)clob.length());
System.out.println("Loaded CLOB");
// Streaming not strictly necessary for short values.
// Blob blob = results.getBlob(3);
byte blobData[] = results.getBytes(3);
System.out.println("Loaded BLOB");
byte rawData[] = results.getBytes(4);
System.out.println("Loaded RAW");
byte longData[] = results.getBytes(5);
System.out.println("Loaded LONG");
catch (SQLException e)
e.printStackTrace();
results.close();
stmt.close();
connection.close();
} // public class JdbcLongTestThe problem is that LONGs are not buffered but are read from the wire in the order defined. The problem is the same as
rs = stmt.executeQuery("select myLong, myNumber from tab");
while (rs.next()) {
int n = rs.getInt(2);
String s = rs.getString(1);
The above will fail for the same reason. When the statement is executed the LONG is not read immediately. It is buffered in the server waiting to be read. When getInt is called the driver reads the bytes of the LONG and throws them away so that it can get to the NUMBER and read it. Then when getString is called the LONG value is gone so you get an exception.
Similar problem here. When the query is executed the CLOB and BLOB locators are read from the wire, but the LONG is buffered in the server waiting to be read. When Clob.getString is called, it has to talk to the server to get the value of the CLOB, so it reads the LONG bytes from the wire and throws them away. That clears the connection so that it can ask the server for the CLOB bytes. When the code reads the LONG value, those bytes are gone so you get an exception.
This is a long standing restriction on using LONG and LONG RAW values and is a result of the network protocol. It is one of the reasons that Oracle deprecates LONGs and recommends using BLOBs and CLOBs instead.
Douglas -
Query to read XML from CLOB table column
Hi
I want an SQL to get the following information extract from a CLOB table column.
MasterReport/sg:RptDef/sg:RptCell@RealDesc MasterReport/sg:RptDef/sg:RptCell@RealNum
credits 100
debits 100
Sample XML data from table column is:
<?xml version="1.0" encoding="UTF-8" ?>
<MasterReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sg="http://www.oracle.com/fsg/2002-03-20/" xsi:schemaLocation="http://www.oracle.com/2002-03-20/fsg.xsd">
<sg:LDGName>Vision Portugal</sg:LDGName>
<sg:SOBName>Vision Portugal</sg:SOBName>
<sg:DataAccessSetName>Vision Portugal</sg:DataAccessSetName>
<sg:InternalReportName>Model 30 Report</sg:InternalReportName>
<sg:CustomParam10 />
<sg:RowContext RowId="r100001">
<sg:RowName />
<sg:RowLineItem>Litigation Credits- Total amount from previous period</sg:RowLineItem>
<sg:RowDispUnit>1</sg:RowDispUnit>
<sg:RowDispFormat />
<sg:RowUnitOfMeasure>EUR</sg:RowUnitOfMeasure>
<sg:RowLedgerCurrency>ANY</sg:RowLedgerCurrency>
<sg:RowCurrencyType>T</sg:RowCurrencyType>
<sg:RowChangeSign>0</sg:RowChangeSign>
<sg:RowSeq>1.0000000000000</sg:RowSeq>
</sg:RowContext>
<sg:RowContext RowId="r100002">
<sg:RowName />
<sg:RowLineItem>Litigation credits- Taxed amounts from column2 for Previous period</sg:RowLineItem>
<sg:RowDispUnit>1</sg:RowDispUnit>
<sg:RowDispFormat />
<sg:RowUnitOfMeasure>EUR</sg:RowUnitOfMeasure>
<sg:RowLedgerCurrency>ANY</sg:RowLedgerCurrency>
<sg:RowCurrencyType>T</sg:RowCurrencyType>
<sg:RowChangeSign>0</sg:RowChangeSign>
<sg:RowSeq>2.0000000000000</sg:RowSeq>
</sg:RowContext>
<sg:ColContext ColId="c1000">
<sg:ColAmountType />
<sg:ColPeriod />
<sg:ColPerOffset />
<sg:ColChangeSign />
<sg:ColPosition />
<sg:ColSeq />
<sg:ColWidth>100</sg:ColWidth>
</sg:ColContext>
<sg:ColContext ColId="c1001">
<sg:ColName>Total</sg:ColName>
<sg:ColDescr />
<sg:ColDispUnit>1</sg:ColDispUnit>
<sg:ColUnitOfMeasure>EUR</sg:ColUnitOfMeasure>
<sg:ColLedgerCurrency>ANY</sg:ColLedgerCurrency>
<sg:ColCurrencyType>T</sg:ColCurrencyType>
<sg:ColDispFormat>999999999.99</sg:ColDispFormat>
<sg:ColAmountType>YTD-Actual</sg:ColAmountType>
<sg:ColPerOffset>0</sg:ColPerOffset>
<sg:ColAmntId>14</sg:ColAmntId>
<sg:ColParamId>-1</sg:ColParamId>
<sg:ColType>A</sg:ColType>
<sg:ColStyle>B</sg:ColStyle>
<sg:ColPeriod>10-08</sg:ColPeriod>
<sg:ColPeriodYear>2008</sg:ColPeriodYear>
<sg:ColPeriodNum>11</sg:ColPeriodNum>
<sg:ColPeriodStart>2008-10-01T00:00:00</sg:ColPeriodStart>
<sg:ColPeriodEnd>2008-10-31T00:00:00</sg:ColPeriodEnd>
<sg:ColChangeSign>0</sg:ColChangeSign>
<sg:ColHeadLine1>Totals</sg:ColHeadLine1>
<sg:ColHeadLine2 />
<sg:ColHeadLine3 />
<sg:ColHeadLine4 />
<sg:ColHeadLine5 />
<sg:ColHeadLine6 />
<sg:ColHeadLine7 />
<sg:ColHeadLine8 />
<sg:ColHeadLine9 />
<sg:ColPosition>99</sg:ColPosition>
<sg:ColSeq>1.0000000000000</sg:ColSeq>
<sg:ColWidth>14</sg:ColWidth>
</sg:ColContext>
<sg:RptDef RptId="p1001" RptDetName="Ledger=Vision PT (Vision Portugal)" RptPESegm="" RptPEVal="" RptTabLabel="Output 1 (Vision PT)">
<sg:RptLine RptCnt="p1001" RowCnt="r100001" LineRowSeq="1.0000000000000" LinCnt="l100001">
<sg:RptCell ColCnt="c1000" RealDesc="debits">debits</sg:RptCell>
<sg:RptCell ColCnt="c1001" RealNum="100.000000">100.00</sg:RptCell>
</sg:RptLine>
<sg:RptLine RptCnt="p1001" RowCnt="r100002" LineRowSeq="2.0000000000000" LinCnt="l100002">
<sg:RptCell ColCnt="c1000" RealDesc="creditsd">credits</sg:RptCell>
<sg:RptCell ColCnt="c1001" RealNum="100.000000">100.00</sg:RptCell>
</sg:RptLine>
</sg:RptDef>
<sg:TabCount>1</sg:TabCount>
</MasterReport>
Please help me.
Regards
Giri
Edited by: user576087 on Mar 18, 2012 11:54 PMI'm not sure if you want the values from the attribute or the element, but this should give you a good start :
SQL> alter session set nls_numeric_characters = ".,";
Session altered
SQL>
SQL> select x.*
2 from my_table t
3 , xmltable(
4 xmlnamespaces('http://www.oracle.com/fsg/2002-03-20/' as "sg")
5 , '/MasterReport/sg:RptDef/sg:RptLine'
6 passing xmltype(t.xmldoc)
7 columns type varchar2(30) path 'sg:RptCell[1]'
8 , amount number path 'sg:RptCell[2]'
9 ) x
10 ;
TYPE AMOUNT
debits 100
credits 100 -
Help with regular expression to find a pattern in clob
can someone help me writing a regular expression to query a clob that containts xml type data?
query to find multiple occurrences of a variable string (i.e <EMPID-XX> - XX can be any number). If <EMPID-01> appears twice in the clob i want the result as EMPID-01,2 and if EMPID-02 appears 4 times i want the result as EMPID-02,4.with
ofx_clob as
(select q'~
<EMPID>1
< UNQID>123456
< TIMESTAMP>...
< ADDRINFO>
< TITLE>^@~*
< FIRST>ABCD
< MI>
< LAST>EFGH
< ADDR1>ADDR1
< ADDR2>^@~*
< CITY>CITY
<EMPID>2
< UNQID>123457
< TIMESTAMP>...
< ADDRINFO>
< TITLE>^@~*
< FIRST>ABCD
< MI>
< LAST>EFGH
< ADDR1>ADDR1
< ADDR2>^@~*
< CITY>CITY
<EMPID>1
< UNQID>123458
< TIMESTAMP>...
< ADDRINFO>
< TITLE>^@~*
< FIRST>ABCD
< MI>
< LAST>EFGH
< ADDR1>ADDR1
< ADDR2>^@~*
< CITY>CITY
~' ofx from dual
select '<EMPID>' || to_char(ids) || '(' || to_char(count(*)) || ')' multi_empid
from (select replace(regexp_substr(ofx,'<EMPID>\d*',1,level),'<EMPID>') ids
from ofx_clob
connect by level <= regexp_count(ofx,'<EMPID>')
group by ids having count(*) > 1
MULTI_EMPID
<EMPID>1(2)
with
ofx_clob as
(select q'~
<EMPID>1
< UNQID>123456
< TIMESTAMP>...
< ADDRINFO>
< TITLE>^@~*
< FIRST>ABCD
< MI>
< LAST>EFGH
< ADDR1>ADDR1
< ADDR2>^@~*
< CITY>CITY
<EMPID>2
< UNQID>123457
< TIMESTAMP>...
< ADDRINFO>
< TITLE>^@~*
< FIRST>ABCD
< MI>
< LAST>EFGH
< ADDR1>ADDR1
< ADDR2>^@~*
< CITY>CITY
<EMPID>1
< UNQID>123456
< TIMESTAMP>...
< ADDRINFO>
< TITLE>^@~*
< FIRST>ABCD
< MI>
< LAST>EFGH
< ADDR1>ADDR1
< ADDR2>^@~*
< CITY>CITY
<EMPID>2
< UNQID>123456
< TIMESTAMP>...
< ADDRINFO>
< TITLE>^@~*
< FIRST>ABCD
< MI>
< LAST>EFGH
< ADDR1>ADDR1
< ADDR2>^@~*
< CITY>CITY
<EMPID>1
< UNQID>123458
< TIMESTAMP>...
< ADDRINFO>
< TITLE>^@~*
< FIRST>ABCD
< MI>
< LAST>EFGH
< ADDR1>ADDR1
< ADDR2>^@~*
< CITY>CITY
~' ofx from dual
select '<EMPID>' || listagg(to_char(ids) || '(' || to_char(count(*)) || ')',',') within group (order by ids) multi_empid
from (select replace(regexp_substr(ofx,'<EMPID>\d*',1,level),'<EMPID>') ids
from ofx_clob
connect by level <= regexp_count(ofx,'<EMPID>')
group by ids having count(*) > 1
MULTI_EMPID
<EMPID>1(3),2(2)
Regards
Etbin
Message was edited by: Etbin
used listagg to report more than one multiple <EMPID> -
Not able to display and search on CLOB attribute in default search screen
Hi,
My requirement:
I have three VARCHAR attributes and 1 CLOB attribute. i need to search the values on these 4 attributes.
Created View crieteria on these 4 attributes and created default ADF search screen. but not able to add the CLOB attribute as search attribute.
is there any solution for this or we can't search on CLOB attribute.
FYI: i have created Converter using ClobDomain and and using this converted for editing the CLOB data.
If i try adding the CLOB attribute in view criteria with ClobDomain and not able to see that attribute on search panel.
Please help on this.
Thanks in advance!!
Thanks & Reagrds,
MadhuMadhu, please tell us your jdev version!
The search is done on the DB (query) so the converter is not used. To search clob columns you can use special SQL statements called contains or catsearch. These are using special index to find the data in blob or clob columns.
Check my blog on how to integrate this into VC: http://tompeez.wordpress.com/2011/08/21/extending-viewcriteria-to-use-sql-contains-4/
Timo -
Data of column datatype CLOB is moved to other columns of the same table
Hi all,
I have an issue with the tables having a CLOB datatype field.
When executing a simple query on a table with a column of type CLOB it returns error [POL-2403] value too large for column.
SQL> desc od_stock_nbcst_notes;
Name Null? Type
OD_STOCKID N NUMBER
NBC_SERVICETYPE N VARCHAR(40)
LANGUAGECODE N VARCHAR(8)
AU_USERIDINS Y NUMBER
INSERTDATE Y DATE
AU_USERIDUPD Y NUMBER
MODIFYDATE Y DATE
VERSION Y SMALLINT(4)
DBUSERINS Y VARCHAR(120)
DBUSERUPD Y VARCHAR(120)
TEXT Y CLOB(2000000000)
NBC_PROVIDERCODE N VARCHAR(40)
SQL> select * from od_stock_nbcst_notes;
[POL-2403] value too large for column
Checking deeply, some of the rows have got the data of the CLOB column moved in another column of the table.
When doing select length(nbc_providercode) the length is bigger than the datatype of the field (varchar(40)).
When doing substr(nbc_providercode,1,40) to see the content of the field, a portion of the Clob data is retrieved.
SQL> select max(length(nbc_providercode)) from od_stock_nbcst_notes;
MAX(LENGTH(NBC_PROVIDERCODE))
162
Choosing one random record, this is the stored information.
SQL> select length(nbc_providerCode), text from od_stock_nbcst_notes where length(nbc_providerCode)=52;
LENGTH(NBC_PROVIDERCODE) | TEXT
-------------------------+-----------
52 | poucos me
SQL> select nbc_providerCode from od_stock_nbcst_notes where length(nbc_providerCode)=52;
[POL-2403] value too large for column
SQL> select substr(nbc_providercode,1,40) from od_stock_nbcst_notes where length(nbc_providercode)=52 ;
SUBSTR(NBC_PROVIDERCODE
Aproveite e deixe o seu carro no parque
The content of the field is part of the content of the field text (datatype CLOB, containts an XML)!!!
The right content of the field must be 'MTS' (retrieved from Central DB).
The CLOB is being inserted into the Central DB, not into the Client ODB. Data is synchronized from CDB to ODB and the data is reaching the client in a wrong way.
The issue can be recreated all the time in the same DB, but between different users the "corrupted" records are different.
Any idea?939569 wrote:
Hello,
I am using Oracle 11.2, I would like to use SQL to update one column based on values of other rows at the same table. Here are the details:
create table TB_test (myId number(4), crtTs date, updTs date);
insert into tb_test(1, to_date('20110101', 'yyyymmdd'), null);
insert into tb_test(1, to_date('20110201', 'yyyymmdd'), null);
insert into tb_test(1, to_date('20110301', 'yyyymmdd'), null);
insert into tb_test(2, to_date('20110901', 'yyyymmdd'), null);
insert into tb_test(2, to_date('20110902', 'yyyymmdd'), null);
After running the SQL, I would like have the following result:
1, 20110101, 20110201
1, 20110201, 20110301
1, 20110301, null
2, 20110901, 20110902
2, 20110902, null
Thanks for your suggestion.How do I ask a question on the forums?
SQL and PL/SQL FAQ -
Can not Load CLOB data 32k to target table
SQL> DESC testmon1 ;
Name Null? Type
FILENAME VARCHAR2(200)
SCANSTARTTIME VARCHAR2(50)
SCANENDTIME VARCHAR2(50)
JOBID VARCHAR2(50)
SCANNAME VARCHAR2(200)
SCANTYPE VARCHAR2(200)
FAULTLINEID VARCHAR2(50)
RISK VARCHAR2(5)
VULNNAME VARCHAR2(2000)
CVE VARCHAR2(200)
DESCRIPTION CLOB
OBSERVATION CLOB
RECOMMENDATION CLOB
SQL> DESC test_target;
Name Null? Type
LOCALID NOT NULL NUMBER
DESCRIPTION NOT NULL CLOB
SCANTYPE NOT NULL VARCHAR2(12)
RISK NOT NULL VARCHAR2(6)
TIMESTAMP NOT NULL DATE
VULNERABILITY_NAME NOT NULL VARCHAR2(2000)
CVE_ID VARCHAR2(200)
BUGTRAQ_ID VARCHAR2(200)
ORIGINAL VARCHAR2(50)
RECOMMEND CLOB
VERSION VARCHAR2(15)
FAMILY VARCHAR2(15)
XREF VARCHAR2(15)
create or replace PROCEDURE proc1 AS
CURSOR C1 IS
SELECT FAULTLINEID,VULNNAME,scanstarttime, risk,
dbms_lob.substr(DESCRIPTION,dbms_lob.getlength(DESCRIPTION),1) "DESCR",dbms_lob.substr(OBSERVATION,dbms_lob.getlength(OBSERVATION),1) "OBS",
dbms_lob.substr(RECOMMENDATION) "REC",CVE
FROM testmon1;
c_rec C1%ROWTYPE;
descobs clob;
FSCAN_VULN_TRANS_REC VULN_TRANSFORM_STG%ROWTYPE;
TIMESTAMP varchar2(50);
riskval varchar2(10);
pCTX PLOG.LOG_CTX := PLOG.init (pSECTION => 'foundscanVuln Procedure',
pLEVEL => PLOG.LDEBUG,
pLOG4J => TRUE,
pLOGTABLE => TRUE,
pOUT_TRANS => TRUE,
pALERT => TRUE,
pTRACE => TRUE,
pDBMS_OUTPUT => TRUE);
amount number;
buffer varchar2(32000);
BEGIN
---INITIALIZE THE LOCATOR FOR CLOB DATA TYPE
select observation into descobs from testmon1 where rownum=1;
OPEN C1;
loop
fetch C1 INTO c_rec;
exit when C1%NOTFOUND;
--LOAD THE DESCRIPTION FIELD FROM CURSOR AND WRITE IT TO THE CLOB LOCATOR descobs.
dbms_lob.Write(descobs,dbms_lob(c_rec.DESCR),1,c_rec.DESCR);
------APPEND THE OBSERVATION FIELD FROM CURSOR TO THE CLOB LOCATOR descobs.
dbms_lob.Writeappend(descobs,dbms_lob(c_rec.DESCR),c_rec.OBS);
-- dbms_output.put_line ('the timestamp is :'||c_rec.scanstarttime);
--dbms_lob.write(descobs,amount,1,buffer);
descobs:=c_rec.OBS;
--dbms_lob.read(descobs,amount,1,buffer);
--dbms_lob.append(c_rec.DESCR,c_rec.OBS);
--descobs:=c_rec.OBS;
--dbms_output.put_line ('the ADDED DESCROBS is :'||dbms_lob.substr(c_rec.DESCR,dbms_lob.getlength(c_rec.DESCR),1));
dbms_output.put_line ('the ADDED DESCRIPTION AND OBSERVATION is :'||descobs);
--dbms_output.put_line ('the DESCROBS buffer is :'||buffer);
SELECT DESCRIPTION INTO FSCAN_VULN_TRANS_REC.DESCRIPTION
FROM TESTMON1 WHERE ROWNUM=1;
---------LOAD THE DESCRIPTION+ observation value into the target table description
DBMS_LOB.WRITE(FSCAN_VULN_TRANS_REC.DESCRIPTION, dbms_lob.getlength(descobs),1,descobs);
TIMESTAMP:=substr(c_rec.scanstarttime,1,10)||' '|| substr(c_rec.scanstarttime,12,8);
IF c_rec.risk <3
THEN riskval:='Low';
ELSIF c_rec.risk <6
THEN riskval:='Medium';
ELSIF c_rec.risk <10
THEN riskval:='High';
END IF;
FSCAN_VULN_TRANS_REC.TIMESTAMP:=TO_DATE(TIMESTAMP, 'YYYY/MM/DD HH24:MI:SS');
FSCAN_VULN_TRANS_REC.risk:= riskval;
--dbms_lob.append(c_rec.DESCR,c_rec.OBS);
FSCAN_VULN_TRANS_REC.DESCRIPTION:=c_rec.DESCR;
FSCAN_VULN_TRANS_REC.RECOMMEND:=c_rec.REC;
FSCAN_VULN_TRANS_REC.LocalID:=to_number(c_rec.FAULTLINEID);
FSCAN_VULN_TRANS_REC.SCANTYPE:='FOUNDSCAN';
FSCAN_VULN_TRANS_REC.CVE_ID:=c_rec.CVE;
FSCAN_VULN_TRANS_REC.VULNERABILITY_NAME:=c_rec.VULNNAME;
-- dbms_output.put_line ('the plog timestamp is :'||timestamp);
-- dbms_output.put_line ('the timestamp is :'||riskval);
--dbms_output.put_line ('the recommend is :'||FSCAN_VULN_TRANS_REC.RECOMMEND);
--dbms_output.put_line ('the app desc is :'||FSCAN_VULN_TRANS_REC.DESCRIPTION);
insert into test_target values FSCAN_VULN_TRANS_REC;
End loop;
close C1;
commit;
EXCEPTION
WHEN OTHERS THEN
-- dbms_output.put_line ('Data not found');
-----------dbms_output.put_line (sqlcode|| ':'||sqlerrm);
end proc1;
using dbms_lob package is not helping. Either DB stops responding. Or the Observation field ( which has max length >300000) can not be loaed into a CLOB variable.
Please help or give me a sample code that helps.select
BANKING_INSTITUTION.BANK_REF_CODE C1_BANK_ID,
BANKING_INSTITUTION.NAME_BANK C2_BANK_NAME,
BANKING_INSTITUTION.BANK_NUMBER C3_BANK_NUMBER,
BANKING_INSTITUTION.ISO_CODE C4_GBA_CODE,
BANKING_INSTITUTION.STATUS C5_STATUS,
BANKING_INSTITUTION.SOURCE C6_SOURCE,
BANKING_INSTITUTION.START_DATE_BANK C7_START_DATE,
BANKING_INSTITUTION.ADDRESS_BANK C8_BANK_ADDRESS1
from REF_DATA_DB.BANKING_INSTITUTION BANKING_INSTITUTION
where (1=1)
insert /*+ append */ into XXSVB.C$_0XXSVB_BANKS_STAGING
C1_BANK_ID,
C2_BANK_NAME,
C3_BANK_NUMBER,
C4_GBA_CODE,
C5_STATUS,
C6_SOURCE,
C7_START_DATE,
C8_BANK_ADDRESS1
values
:C1_BANK_ID,
:C2_BANK_NAME,
:C3_BANK_NUMBER,
:C4_GBA_CODE,
:C5_STATUS,
:C6_SOURCE,
:C7_START_DATE,
:C8_BANK_ADDRESS1
) -
Hi,
could you do me help?
i can not insert a string into a oracle clob field, it echo as:
ORA22920 row containing the lob value is not locked. ORA 06512 at "SYS.DBMS_LOB" line 708
ORA 06512 at line 1;
what its means? please.
my table defined as : create table clob1(id number(5),mclob clob default empty_clob()); the id is create by a sequece of test_sequence automaticly.
my code as belows:
import java.io.*;
import java.sql.*;
//import oracle.sql.*;
public class test4 {
public static void main(String args[]) {
String url_String
= "jdbc:oracle:thin:test/test@myhost:1521:myorcl";
try {
Class.forName
("oracle.jdbc.driver.OracleDriver");
java.sql.Connection con =
java.sql.DriverManager.getConnection(url_String);
con.setAutoCommit(true);
Statement stmt
=con.createStatement();
String sqlStr ="insert into
clob1 (mclob) " + "values(empty_clob())";
stmt.executeUpdate(sqlStr);
String query = "select
test_seq.CURRVAL from dual";
ResultSet rs =stmt.executeQuery
(query);
rs.next();
int currval =rs.getInt(1);
query = "select * from clob1 where
id="+currval;
String str
="abcedefhijklmnopqrstuvwxyz";
rs =stmt.executeQuery(query);
rs.next();
java.sql.Clob clob1
=rs.getClob(2);
oracle.sql.CLOB clob=
(oracle.sql.CLOB)clob1;
System.out.print(clob);
java.io.Writer
wr=clob.getCharacterOutputStream();
wr.write(str);
wr.flush();
wr.close();
stmt.close();
con.close();
} catch(Exception ex) {
System.err.println("SQLException: "
+ ex.getMessage());
nullHi,
To avoid ORA-22920 error while selecting lob column, use the 'for update' clause in the select statement like :
query = "select * from clob1 where id="+currval+" FOR UPDATE" ;
This should solve the problem. However, after fixing this, you might get the error :
java.sql.SQLException: ORA-1002: fetch out of sequence
I got this error when testing your code. To avoid this error, before executing 'select ... for update' statement Set AutoCommit to OFF, like :
query = "select * from clob1 where id="+currval+" FOR UPDATE" ;
con.setAutoCommit(false);
rs =stmt.executeQuery(query);
Hope that Helps,
Srinivas -
BLOB and CLOB data in BI Publisher
Hello,
I have an XML file with blob and clob data in it. I am using BI desktop publisher to load the xml file and create the rtf template. I am getting the following error:
ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
Run XDO Start
Template: C:\work\employee.rtf
RTFProcessor setLocale: en-us
FOProcessor setData: C:\work\employee.xml
FOProcessor setLocale: en-us
Do i need to install anything or am i missing any configuration to read the blob and clob? Please advise
thanksCheck this out, hopefully it'll help you
http://oraclebizint.wordpress.com/2007/11/12/oracle-bi-ee-101332-working-with-clob-fields/
Fiston -
We developed a SSIS Package to pull the data From Oracle source to Sql Server 2012. Here we used ADO.Net source to pull the records from Source but getting the below error after pulling some 40K records.
[ADO NET Source [2]] Error: The ADO NET Source was unable to process the data. ORA-64203: Destination buffer too small to hold CLOB data after character set conversion.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.
The PrimeOutput method on ADO NET Source returned error code 0xC02090F5.
The component returned a failure code when the pipeline engine called PrimeOutput().
The meaning of the failure code is defined by the component,
but the error is fatal and the pipeline stopped executing.
There may be error messages posted before this with more
information about the failure.
Anything that we can do to fix this?Hi,
Tried both....
* Having schema type as Nvarchar(max). - Getting the same error.
* Instead of ADO.Net Source used OLEDB Source with driver as " Oracle Provide for OLE DB" Getting error as below.
[OLE DB Source [478]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on OLE DB Source returned error code 0xC0202009. The component returned a failure
code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the
failure.
Additional Info:
* Here the Source task is getting failed not the conversion or destination task.
Thanks,
Loganathan A.
Maybe you are looking for
-
Null check for "ora:readFile()" function
Hi, I want to check whether a particular file is present in a given folder in our local server.In case of success scenario the "ora:readFile()" function is working fine but if the file is not present in the same folder then,this function is getting f
-
What is a best practice for managing a large amount of ever-changing hyperlinks?
I am moving an 80+ page printed catalog online. We need to add hyperlinks to our Learning Management System courses to each reference of a class - there are 100s of them. I'm having difficulty understanding what the best practice is for consistent re
-
Checking for files in a folder -- Wrong output
Hi guys, I'm writing a simple program, I have to check for 6 files (hardcoded, they will never change) if they are in certain directories/paths. The problem is, I think I have a problem in my IF statements, because it continueally returns false. The
-
Php 5.2.6 installation how-to with JES7
hey i am facing difficulties in installing php 5.2.6 with JES7 any useful documentations or guidelines especially how-to documents will be greatly appreciated. thanks in advance.
-
Hello, I have the Solaris 7 source code (both for sparc and intel). My goal is to alter the hme ethernet driver to do something specific (why i ordered the source code). However, I'm running into a couple of problems. My first test was to just try an