Line terminator of parameter for a CLOB column by script
Hi allI have a CLOB column in my table that receives the external data (more than 400 sources).
The GUI application it displays in multiple different ways due to the incoming line terminators.
Here's the strange thing:
In Developer SQL 3.1.06. I chose in preferences-> environment, as line terminator: carriage return and line Fe (Windows)
Once I committed changes to the data has been properly displayed in the application (apparently was also recoding).
My Question is:
How can I configure this property to the column or table to solve the problem?
(I'm looking for a DDL script or something like).
Thanks in advance.
Mijail o. T.
You can not.
-----------
Sybrand Bakker
Senior Oracle DBA
Tags: Database
Similar Questions
-
How can I specify for a CLOB column online storage?
I use 3.1 build 691 (EA3 v3.1)Hello
There's "Lob storage" node under the node for the table in the physical model. Create a definition of the it and set the column name and other parameters.
Philippe
-
The search for Clob columns in interactive report
I use APEX 3.2 with 10g. I have an interactive report with a query that takes several recordings of 'comments' and the concatenates using a function that returns a Clob. In the report, there are several of these comments columns mixed with some small varchar2 columns.
Using the search bar, if I type in a Word and click OK, it does not seek my Clob columns. On the other hand, I can use the drop-down list in the search bar to indicate I want to only search one of these Clob columns, then the research works.
Is there a reason that my filters 'Text line contains' do not include my Clob columns? I have defined, as the "Standard report column" and they all "filter" checked as a permitted operation.
GregI found a work around for this problem. IR reports do not seem to automatically search for CLOB columns as a search ROWTEXT (unless you are specifically targeting this column). So, I wrapped the CLOB column with:
DBMS_LOB.substr(clob_column_name,4000,1)
This converts the CLOB Varchar2 column, which made the report «see» IR Of course, this only works if you want to search for the first 4000 bytes, but the data in my CLOB columns are never more than a few sentences long.
-
How Index on a CLOB column?
I have a need index on a CLOB column. The first attempts to index will result in ORA-02373.
In research, I was able to find one that a LOB column could be moved to a different tablespace then indexed.
So I intend to use these statements (see below), to create a text index on column CLOB STATEMENT_TEXT.
Questions: What storage should be used for the CLOB column?
What type of index is required to create a text index on the CLOB column?
ALTER TABLE ANY_STATEMENT MOVE
TABLESPACE INFOWH2 STORAGE (INITIAL 4096K)
LOB (STATEMENT_TEXT) STORE lobsegment
(TABLESPACE INFOWH2 STORAGE (INITIAL 4096K));
Then:
CREATE INDEXES IDXANYSTMTTEXTBINARY
ON LOB (STATEMENT_TEXT)
INDEXTYPE IS CTXSYS. CONTEXT;
Here is the table in part:
CREATE TABLE ANY_STATEMENT
(
ANY_STATEMENT_ID TANK (18 BYTES) NOT NULL,
CODE VARCHAR2 (4 BYTE),
STATEMENT_TYPE_ID_FK TANK (18 BYTES) NOT NULL,
USER DEFAULT UPDATED_BY VARCHAR2 (50 BYTES)
LAST_DATE_UPDATED DATE DEFAULT SYSDATE,
DESTINATION_ID_FK TANK (18 BYTES),
LANGUAGE_ID_FK TANK (18 BYTES) NOT NULL,
DATE OF SUPERCEDED_DATE,
NUMBER OF FORMULA_REFERENCE
FORMULA_SERIAL VARCHAR2 (15 BYTE),
TANK (18 BYTES) BY DEFAULT USER CREATED_BY_ID_FK NOT NULL,
DATE_CREATED DATE DEFAULT SYSDATE NOT NULL,.
ON_HOLD CHAR (1 BYTE),
NUMBER OF TEMP_REFERENCE_NUMBER
APPLICATION_NOTES VARCHAR2 (2048 BYTE),
HOLD_REASON VARCHAR2 (1024 BYTE),
STATEMENT_TEXT CLOB,
REASON CLOB
)
TABLESPACE INFOWH
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE)
ORIGINAL 112K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
NOCOMPRESS
LOB (STATEMENT_TEXT) STORE AS
(TABLESPACE INFOWH
ALLOW ONLINE STORAGE
8192 CHUNK
PCTVERSION 0
NOCACHE
STORAGE)
64K INITIALS
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
LOB (REASON) STORE AS
(TABLESPACE INFOWH
ALLOW ONLINE STORAGE
8192 CHUNK
PCTVERSION 0
NOCACHE
STORAGE)
64K INITIALS
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
NOCACHE
NOPARALLEL
MONITORING;See if this thread is useful.
http://www.orafaq.com/Forum/t/8494/0/
-
Insertion in textarea CLOB column
Hello people,
I'm trying to find out if it is possible to insert data greater than 4000 characters in a text box in a clob column. Although CLOB supports larger data size, the page generates an error when the content in the text box exceeds 4000 characters for obvious reasons. The insertion in the clob column goes through a submit after pl/sql block.
We have an option for users to download files, but users are more interested in the ability to copy paste data in the text box so that they can be searched on through the search screen that we have provided for this clob column.
Including search through dbms_lob.instr is an alternative before us, but just curious to know if there is a solution for the insertion of text box in a clob data column greater than 4000 characters.
Appreciate your help.
Concerning
KrishnaAPEX knows not what is a clob. Thus, in the first variant of SQL
I'm writing a process this filling instead of SQL query textareaIn the second variant your function returns a clob. Apex doen't know what what is it and raise the exception. I rewrite your PL/SQL function
declare t varchar2(32000); c clob; begin SELECT txt into c FROM clob_test WHERE ID = :P3_ID; t:= dbms_lob.substr(c,32000,1); return t; end;
It will ensure the correct data type conversion.
-
contains the clause in the search for interactive report of a clob column
Hello
I use the Version APEX 4.2.4.00.08
How to use an interactive report contains the when searching a clob column so that it uses the CONTEXT index?
Thank you
Chandra.
I wrote it in the SQL used for IR
I created an APEX application that stores all our it's the HOWTO documents. (word, excel, pdf)
ctx_doc.snippet creates the HTML code.
select D.doc_id ,D.doc_filename ,dbms_lob.getLength( D.doc_blob ) as download ,decode( :P12_SEARCH, null, '-- nothing --', ctx_doc.snippet( 'IT_DATA.DOC_CTX_IX' -- my Oracle Text index name , D.doc_id, :P12_SEARCH ) ) as snippet from it_data.documents D where :P12_SEARCH is null or contains( D.doc_blob, :P12_SEARCH ) > 0
MK
-
Using the TRIM output as a parameter for IN
I have a CLOB containing column (for example):
The idea is to use values of this field in another query as a parameter for IN selection (basically something like this:),1074,1075,1076,1077,1078,1050,
If I run:SELECT columns FROM table WHERE column IN (values from previous field);
(values entered in the statement) everything is ok. But the problem is that this original area also contains comas at the beginning and at the end.SELECT columns FROM table WHERE column IN (1074,1075,1076,1077,1078,1050);
In order to deal with them, I tried:
but I received:TRIM(',' FROM column)
I also tried many TO_ functions as well as CAST funtion - does not work.ORA-00932: inconsistent datatypes: expected - got CLOB 00932. 00000 - "inconsistent datatypes: expected %s got %s"
In addition, I tried
but received errorSELECT DBMS_LOB.SUBSTR(TS_FAULT_REPORTS,DBMS_LOB.GETLENGTH(column)-2,2) FROM table;
No idea how to solve this problem?ORA-01722: invalid number 01722. 00000 - "invalid number"
Hello
Welcome to the forum!
So, you have a subquery which produces a string separated by commas, like ', 1074,1075,1076,1077,1078,1050,': is that correct?
The best solution might be to change the subquery so that produce a result set with each item on a separate line. Who can actually do the subquery simpler and more effective.
If you don't really have to use the comma-separated string, see the following links for dynamic IN-lists:
http://tkyte.blogspot.com/2006/06/varying-in-lists.html
http://www.Oracle-base.com/articles/Misc/DynamicInLists.phpYou coul also convert your string table number and use INSTR to see if it exists in the list:
WHERE INSTR ( comma_delimited_string , ',' || column_x || ',' ) > 0
Extra commas are to avoid the problem of 'the mother's in chemotherapy If column_x is 1 (or 0, 107, or 7, or 74 or 4) you don't want that corresponding to '1074'.
This assumes that comma_delimited_list already begins and ends with the delimiter, as in your example. If this isn't the case, you can add them manually.I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
Always tell what version of Oracle you are using.You will find the answers better faster if you always provide this information whenever you post a question.
-
How can I make sure that a CLOB column is unique
I have a table with a CLOB column I want to ensure is unique. If the column is VARCHAR2 I could use a unique index.
Plan B is a TRIGGER (BEFORE INSERT OR UPDATE ON < table > FOR EACH ROW) with WHERE the dbms_lob.compare (en.text,: NEW.text) = 0; But that transforms
Oracle 12 c Standard Edition
Don't use ORA_HASH, use DBMS_CRYPTO. HASH...
SQL > CREATE TABLE test_table
() 2
3 data_clob CLOB,
4 num NUMBER,
5 hash_val GENERATED ALWAYS AS (sys. DBMS_CRYPTO. HASH(data_clob, 3 /* HASH_SH1 */))
6 );Table created.
SQL > CREATE A UNIQUE TEST_IDX INDEX
2. WE test_table (hash_val);The index is created.
SQL > INSERT INTO TEST_TABLE (DATA_CLOB, NUM)
2 VALUES ('TEST', 1);1 line of creation.
SQL > COMMIT;
Validation complete.
SQL > INSERT INTO TEST_TABLE (DATA_CLOB, NUM)
2 VALUES ('TEST', 1);
INSERT INTO TEST_TABLE (DATA_CLOB, NUM)
*
ERROR on line 1:
ORA-00001: unique constraint (SCOTT. TEST_IDX) violated -
Hi all
DB version: Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production (PL/SQL Release 11.2.0.4.0 - Production)
Brief Description: column CLOB audit until anonymous PLSQL block but does not update an external application (such as a web application).
More in detail, we have a base with a CLOB column table and an audit table that captures any change on the base table using a trigger of DB.
Table audit this as below:
ID NOT NULL NUMBER (38) COMPONENT_KEY THE NUMBER OF NON-NULL CHANGEDCOLUMNNAME VARCHAR2 (30) CHANGEDBY VARCHAR2 (20) CHANGEDDATE DATE BEFORECHANGE CLOB EVENT CLO We observe that the audit works perfectly fine if we update the prompt SQL CLOB column. But when the column is updated. a web UI - the trigger retrieves the value of
:OLD.CLOB_COLUMN
and reads an empty clob
:NEW.CLOB_COLUMN
.
Possible explanation: read in-depth, including that CLOB actuallly stores the reference to memory location & database manages insertions/changes effectively CLOB columns by first introducing an EMPTY_CLOB and then subsequently using DBMS_LOB. Write() for transmitting the content of CLOB to the location of the DB. DB trigger seems to be pulled between the insert EMPTY_CLOB & the DBMS_LOB. Write() and accordingly, we find that: NEW. CLOB_COLUMN to be EMPTY_CLOB.
The above explanation makes sense? If so, why does it work correctly from the SQL prompt? Can we not check a DB trigger CLOB columns at all?
Thank you
Srini
On additional debugging, it seems not to be a problem with the database. She seems to be the implementation of JDBC for CLOB data types - where it is a 2-step process
STEP 1 - Insert EMPTY_CLOB
STEP 2 - lock the line & enter the stream to broadcast content to CLOB CLOB.
Given that triggers executed immediately after STEP 1 - the NEW value is EMPTY. Here, the concepts of database are intact. In this case, the check must arrive at the JDBC layer.
-
The number of characters in the CLOB column is supported by the report of the APEX
Hello
Actually, I have a report of the Apex based on CLOB column, which includes data whose length exceeds 10,000 characters.
up to 10,000 characters, it works fine, but once it get records with characters more than 10 + lift
ORA-06502: PL/SQL: digital or value error: character string buffer too small
Thank you and best regards,
Ashish
2902196 wrote:
Please update your forum profile with a recognizable username instead of "2902196": Video tutorial how to change username available
Always include the information referred to in these guidelines when you post a question: How to get the answers from the forum
Actually, I have a report of the Apex based on CLOB column, which includes data whose length exceeds 10,000 characters.
up to 10,000 characters, it works fine, but once it get records with characters more than 10 + lift
ORA-06502: PL/SQL: digital or value error: character string buffer too small
The maximum size of a column report CLOB value is 32 KB. However, the maximum size for the content of the line of the full report is also 32 KB (including the HTML markup), so you can be hitting this limit because of the size of your 10 K CLOB data + the rest of the line.
According to the database character set and the characters which that contains data, the character encoding may use more than one byte to represent a character.
-
Read CLOB column - by bursting
I have two tables File_Master and File_Detail
Primary key File_Master FILE_ID
Primary key File_Detail FILE_ID, LINE_ID
I have a CLOB FILE_CONTENT column table File_Master.
For each record FILE_ID in File_Master, hundreds of lines are stored in the CLOB column.
I want to read this 'File_Content' CLOB column and and break each line (1000 characters)
by pieces to fill the columns in File_Detail.
Since there will be thousands of lines in the process, what would be the best approach when writing PL/SQL code for better performance?
Thanks in advance.Do you want real lines (completed by a Unix or DOS line break) of the CLOB?
I use the following function to process the lines of CLOB (then tokenising and analysis of each line):
create or replace type TStrings is table of varchar2(4000); / create or replace function ClobToLines( c clob, lineTerminator varchar2 default null ) return TStrings pipelined is -- function: CLOB TO LINES -- descr: reads lines from a clob and returns each line as a separate row pos integer; line varchar2(4000); offset integer := 1; charSep varchar2(10); amount integer := 1; begin -- if no CRLF specified, detect whether DOS or Unix linefeeds are used if lineTerminator is null then pos := DBMS_LOB.InStr( c, chr(10), offset, 1 ); if pos = 0 then raise_application_error( -20001, 'The CLOB does not contain char #10 (used by both DOS and Unix linefeeds) and failed to parse.' ); end if; if pos > 1 then DBMS_LOB.Read( lob_loc => c, amount => amount, offset => pos-1, buffer => charSep ); end if; if charSep = chr(13) then charSep := chr(13)||chr(10); else charSep := chr(10); end if; else charSep := lineTerminator; end if; while (offset < DBMS_LOB.GetLength(c) ) loop pos := DBMS_LOB.InStr( c, charSep, offset, 1 ); if pos > 0 then line := DBMS_LOB.SubStr( c, pos-offset, offset ); offset := pos + length(charSep); else offset := DBMS_LOB.GetLength( c ) + 1; line := null; end if; pipe row( line ); end loop; return; end; /
-
How to view the report on one Clob column online?
Hello
In a set of columns in the report created with the wizard to create a Page, a Clob column is made that resembles a dozen lines high. The other elements are the high standard of a line. How can I load Apex to restore the Clob, the same height as the other columns (on one line)? Left like that, I'll only be able to see 2 or 3 lines at once, even if there is very little data in Clob columns.
I would have attached a screenshot, but I do not see this feature on the forum site.
BTW, I guess this is a common newbie question. I don't see an answer in the Forum or in the documentation. Your response is appreciated.
Thank you
KimKim2012 wrote:
Unfortunately, at this stage of my Apex maturity, it would be very difficult for me to reproduce the problem on apex.oracle.com (don't laugh, Jedi are not built in a day).It's very simple.
1. sign up for an account on apex.oracle.com.
2. in your local installation of the APEX, go to SQL Workshop > utilities > generate DDL. Click create a Script and use the wizard to generate a DDL script that contains the objects of database required by your application. (You can find out what they use Application Builder > Application > utilities > database object dependencies.)
3. your local installation of APEX export demand.
4. download and run the DDL file on apex.oracle.com using SQL Workshop > Scripts SQL.
5 import the request to apex.oracle.com.So I resort to ad a page to SkyDrive. When you see the picture, the question will be very clear and I guess that there is a way to dusty solution tucked away in the vault. Note: I would like to limit the height of the text element, not the width of it. Here's the URL for the screenshot.
Go to the Notes column attributes. Define the number of rows to 1 and the attributes of the element to
style="height: 1.3em;"
You may need to adjust the height to match other items. (Or according to browser [s], may not need any: in Firefox on Windows 7 14 "number of lines: 1" seems to mean "number of rows: 2". ") (Go figure.)
-
How to set the color for a particular column in the table in advance?
How can we set the color for a particular column in advance table based on a few feteched of vo in process request query parameter?Hello
Reference http://oraclearea51.com/blog/dynamically-color-the-rows-in-an-oa-framework-advanced-table.html
and prev thread. Can color us the lines in the column of a table
It will be useful.
Kind regards
GYAN -
How to implement a function of Jaro-Winkler for a table column?
Using Oracle 10 g 2 (10.2.0.3) RAC on SUSE SLES 9.
Is there a better way to write the following SQL statement:
SELECT
A.STATEMENT_TEXT,
B.STATEMENT_TEXT,
UTL_MATCH. DIST JARO_WINKLER (A.STATEMENT_TEXT, B.STATEMENT_TEXT)
Of
(BY SELECTING AST_A.STATEMENT_TEXT FROM IW. ANY_STATEMENT AST_A),
(BY SELECTING AST_B.STATEMENT_TEXT FROM IW. B ANY_STATEMENT AST_B)
WHERE
(UTL_MATCH. JARO_WINKLER(A.STATEMENT_TEXT,_B.STATEMENT_TEXT) > =. 8);
The following statement results in the error: ' ORA-03113: end of file on the channel of communication "after 75 lines of data.
Here, I would like to find similarities between the two channels is > = 80%.
The column STATEMENT_TEXT is a CLOB column in the ANY_STATEMENT table.
Thank you
(BLL)Hello
For me, it looks like you're hit this bug 6338068. Check it in metalink.
As far as I know, this feature is supported from less than 10 g.
Concerning
REDA
-
Insertion XMLAgg large output in a table with a CLOB column
Hello
I need to fill a CLOB column in a table with the output of a query select using XMLAgg which returns a string length exceeds the maximum length of the SQL 32767octets.
The table I ask has 300,000 lines I need to create an XML file. When I apply the query below (without XMLAgg) I get 300 000 lines that each of the 134 characters each. However, when I add the XMLAgg I can't select the results as XMLAgg concatenates my 300,000 lines in a single line, where a length of string is too long for SQL.
SELECT (XMLElement ("line", XMLELEMENT ('cell', XMLATTRIBUTES ('XML_TAG_1' "colName"), attribute1)
XMLELEMENT ('cell', XMLATTRIBUTES ('XML_TAG_2' "colName"), attribut2)
XMLELEMENT ('cell', XMLATTRIBUTES ('XML_TAG_3' "colName"), attribut3))
)
of XML_TAGS_TABLE
-Produces 300,000 lines like below
< row > < cell colName = "XML_TAG_1" > 12345 < / cell > < cell colName = "XML_TAG_2" > abcdef < / cell > < cell colName = "XML_TAG_3" > 123xyz < / cell > < / row >
With this in mind, I created a temporary table (TEMP_TAB_TEST) with a column called XML_ROW that is a CLOB. Applying XMLAgg in the above query, I would get 300,000 lines concatenated into a string. I need to get the single string output in the XML_ROW (CLOB) column XMLAgg while I can then convert them to the XML file.
I don't see how I can use XMLAgg due to the length of the output it produces? Is there a way I can fill the column clob using the XMLAgg is the result of a PL/SQL package / block Anon?
Thank you very much
Simon.It works for me:
CREATE TABLE TESTCLOB (ID NUMBER, DATA CLOB); insert into testclob ( id, data ) values ( 1, (SELECT XMLTYPE.getClobVal(XMLAGG( XMLElement("row", XMLELEMENT("cell", XMLATTRIBUTES('XML_TAG_1' COL1),attribute1) ,XMLELEMENT("cell", XMLATTRIBUTES('XML_TAG_2' COL2) ,attribute2) ,XMLELEMENT("cell", XMLATTRIBUTES('XML_TAG_3' COL3),attribute3)) ) ) from (SELECT 'XXXXX' attribute1, 'xxxxxx' attribute2, 'yyyyyyy' attribute3 from dual connect by level<1000000) ) ); SELECT ID, DBMS_LOB.GETLENGTH(DATA) FROM TEXTCLOB; ID DBMS_LOB.GETLENGTH(DATA) ---------------------- ------------------------ 1 118999881
Maybe you are looking for
-
Add a toolbar (bar multirow bookmarks not but added any toolbar)
I'm used to be able to add a custom toolbar. (Such as back in an earlier version of Firefox on my Mac.) I've seen the question asked on the toolbars of additional bookmarks with the solution is an add-on to the multirow bookmarks toolbar. I don't wan
-
original title: network connections I want to set up a link between my computor and my brothers through the internet in order to control and maintain. How can I do this >
-
HP LaserJet 200 colorMFP M276n: printer don't wake up when the print job received
Hello The all-in-one printer in my company does not work well as it does already. He supposed to wake up when receiving print jobs, but it doesn't. Tap the user Panel must then only it starts to print. After that the user can do another trouble-free
-
BlackBerry cracked screen Z10 Z10
I dropped my phone (BB z10) recently and he cracekd the screen, which means think I coulndt glance at all the BBM messages... I could see they were there, but could not access it. After a frustrating saga of trying to replace the screen of my phone,
-
How can I add another computer
How can I add to my subscription computer.