Di seguito un semplice esempio di come leggere un campo LONG.
desc dba_views;
Nome Nullo? Tipo
---------------- -------- -------------------
OWNER NOT NULL VARCHAR2(128)
VIEW_NAME NOT NULL VARCHAR2(128)
TEXT_LENGTH NUMBER
TEXT LONG
TEXT_VC VARCHAR2(4000 CHAR)
TYPE_TEXT_LENGTH NUMBER
TYPE_TEXT VARCHAR2(4000)
OID_TEXT_LENGTH NUMBER
OID_TEXT VARCHAR2(4000)
VIEW_TYPE_OWNER VARCHAR2(128)
VIEW_TYPE VARCHAR2(128)
SUPERVIEW_NAME VARCHAR2(128)
EDITIONING_VIEW VARCHAR2(1 CHAR)
READ_ONLY VARCHAR2(1 CHAR)
CONTAINER_DATA VARCHAR2(1 CHAR)
BEQUEATH VARCHAR2(12 CHAR)
ORIGIN_CON_ID NUMBER
create table IA_INTEGRATION.gr_views
(owner VARCHAR2(128),
view_name VARCHAR2(128),
text clob );
DESC IA_INTEGRATION.gr_views;
Nome Nullo? Tipo
--------- ------ -------------
OWNER VARCHAR2(128)
VIEW_NAME VARCHAR2(128)
TEXT CLOB
insert into IA_INTEGRATION.gr_views
select owner,view_name,to_lob(text)
from dba_views
where owner='IA_INTEGRATION';
COMMIT;
SELECT COUNT(1) FROM IA_INTEGRATION.gr_views;
COUNT(1)
----------
12
select COUNT(1)
from IA_INTEGRATION.gr_views
where text like ('%SELECT%');
COUNT(1)
----------
12
Nessun commento:
Posta un commento