Solved

How to get data from clob data type ?

Posted on 2014-11-17
1
286 Views
Last Modified: 2014-11-24
Hi All,
i am using oracle 11g  1.2.1.0

i have below table
CREATE TABLE TABLE1
  (
    EMP_ID NUMBER NOT NULL ENABLE,
    NAME CLOB
  )

Open in new window


 INSERT INTO TABLE1 VALUES(1,'thomos');

Open in new window

 
 
  Now below is my query
 
  select DBMS_LOB.SUBSTR(NAME,1,4000) AS DESCRIPTION from TABLE1;
 
  output: i am getting as null
expexted: thomos

Regards
Thomos
0
Comment
Question by:deve_thomos
1 Comment
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 40447634
check the docs for the syntax of dbms_lob.substr:
https://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_lob.htm#i999349

If is AMOUNT then OFFSET.  If is backwards from regular SUBSTR.

select DBMS_LOB.SUBSTR(NAME,4000,1) AS DESCRIPTION from TABLE1;
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Migrate Oracle Database from ASM to Non-ASM on a Windows server. 1 45
SQL query question 8 78
Create Index on a Materialized View 5 24
Oracle dataguard 5 32
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question