Difference between revisions of "Knowledge:Utilities"

From OpenKM Documentation
Jump to: navigation, search
(Created page with '== Show text extracted from document (SQL) == <source lang="sql"> select NBS_UUID, NDC_TEXT_EXTRACTED, NDC_TEXT from OKM_NODE_DOCUMENT where NBS_UUID='document-uuid' </source> =…')
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Show text extracted from document (SQL) ==
+
== Show text extracted from document ==
 +
'''HQL'''
 
<source lang="sql">
 
<source lang="sql">
select NBS_UUID, NDC_TEXT_EXTRACTED, NDC_TEXT from OKM_NODE_DOCUMENT where NBS_UUID='document-uuid'
+
select nd.uuid, nd.textExtracted, nd.text from NodeDocument nd where nd.uuid='document-uuid';
 
</source>
 
</source>
  
== Force document text extraction (HQL) ==
+
'''SQL'''
 
<source lang="sql">
 
<source lang="sql">
update NodeDocument nd set nd.textExtracted=false where nd.uuid='document-uuid'
+
select NBS_UUID, NDC_TEXT_EXTRACTED, NDC_TEXT from OKM_NODE_DOCUMENT where NBS_UUID='document-uuid';
 +
</source>
 +
 
 +
== Show text extracted of folder children documents ==
 +
'''SQL'''
 +
<source lang="sql">
 +
select NBS_UUID, NDC_TEXT_EXTRACTED, NDC_TEXT from OKM_NODE_DOCUMENT where NBS_UUID in (select NBS_UUID from OKM_NODE_BASE where NBS_PARENT='folder-uuid');
 +
</source>
 +
 
 +
== Force document text extraction ==
 +
'''HQL'''
 +
<source lang="sql">
 +
update NodeDocument nd set nd.textExtracted=false where nd.uuid='document-uuid';
 +
</source>
 +
 
 +
'''SQL'''
 +
<source lang="sql">
 +
update OKM_NODE_DOCUMENT set NDC_TEXT_EXTRACTED='F' where NBS_UUID='document-uuid';
 +
</source>
 +
 
 +
== Force document text extraction of folder children documents ==
 +
'''SQL'''
 +
<source lang="sql">
 +
update OKM_NODE_DOCUMENT set NDC_TEXT_EXTRACTED='F' where NBS_UUID in (select NBS_UUID from OKM_NODE_BASE where NBS_PARENT='folder-uuid');
 +
</source>
 +
 
 +
== See table description in Oracle ==
 +
<source lang="sql">
 +
select t1.column_name, substr(data_type||'('||data_length||')', 0, 20) as data_type, decode(nullable,'N','NOT NULL', '') as null_status, comments
 +
from all_tab_columns t1, all_col_comments t2 where t1.table_name = t2.table_name
 +
and t1.column_name = t2.column_name and t1.table_name = 'OKM_NODE_DOCUMENT' ORDER BY COLUMN_ID;
 
</source>
 
</source>

Latest revision as of 08:35, 18 October 2012

Show text extracted from document

HQL

select nd.uuid, nd.textExtracted, nd.text from NodeDocument nd where nd.uuid='document-uuid';

SQL

select NBS_UUID, NDC_TEXT_EXTRACTED, NDC_TEXT from OKM_NODE_DOCUMENT where NBS_UUID='document-uuid';

Show text extracted of folder children documents

SQL

select NBS_UUID, NDC_TEXT_EXTRACTED, NDC_TEXT from OKM_NODE_DOCUMENT where NBS_UUID in (select NBS_UUID from OKM_NODE_BASE where NBS_PARENT='folder-uuid');

Force document text extraction

HQL

update NodeDocument nd set nd.textExtracted=false where nd.uuid='document-uuid';

SQL

update OKM_NODE_DOCUMENT set NDC_TEXT_EXTRACTED='F' where NBS_UUID='document-uuid';

Force document text extraction of folder children documents

SQL

update OKM_NODE_DOCUMENT set NDC_TEXT_EXTRACTED='F' where NBS_UUID in (select NBS_UUID from OKM_NODE_BASE where NBS_PARENT='folder-uuid');

See table description in Oracle

select t1.column_name, substr(data_type||'('||data_length||')', 0, 20) as data_type, decode(nullable,'N','NOT NULL', '') as null_status, comments
from all_tab_columns t1, all_col_comments t2 where t1.table_name = t2.table_name
and t1.column_name = t2.column_name and t1.table_name = 'OKM_NODE_DOCUMENT' ORDER BY COLUMN_ID;