Long Raw to CLOB
Hi,
I am in a situation to change one application which uses forms 5. and one table column uses LONG RAW. whose data type is as OLE CONTAINER in the form. which is populated by
INITIALIZE_CONTAINER(item_id,file_path). here files path is MS word document.
Now I want to shift the datatype from lang raw to CLOB, change in the table is OK but what changes required in the form? it is initializing the container but not saving in the table.
Any help ?
Regards
You can transfer data from
LONG to CLOB
LONG RAW to BLOB only..
In Oracle9i -- there is a very cool "alter table t modify long_col CLOB" to do
this as well....
you could convert a clob to a blob, or a blob to a clob using utl_raw.cast_to_varchar2/raw and doing it 32k at a time.
Similar Messages
-
How can I converting long raw in clob on Apex when I'm creating a view?
I need some help. I'm creating a view and I need converting long raw fields in clob, varchar2, or char when I create a view.
Thanks for your help.What error did you get when using the functions in a SELECT on a view? If that did not work, identify the table the view is based on and write the SELECT statement directly against that table and not the view.
I do not understand, "I try and they are rights".
Mike -
I wish to migrate records of a col. FILETYPE (LONG RAW) of existing table to col. DOCTYPE (CLOB) of a new table.
But the function to_lob() is unable to carry out the required migration. The Error message is : " Inconsistent Data Types expected - binary .... ".
Moreover LONG RAW to BLOB conversion works fine from a simple INSERT statement but the same fails when insertion is done using a CURSOR.
Can u guyz help me in doing the same !
Oracle Version used - 9i
Regards,
Chinmay <Infocker>You can transfer data from
LONG to CLOB
LONG RAW to BLOB only..
In Oracle9i -- there is a very cool "alter table t modify long_col CLOB" to do
this as well....
you could convert a clob to a blob, or a blob to a clob using utl_raw.cast_to_varchar2/raw and doing it 32k at a time. -
PLSQL 을 사용해서 LONG RAW 를 BLOB 으로 바꾸는 방법
제품 : PL/SQL
작성날짜 : 2002-10-16
PLSQL 을 사용해서 LONG RAW 를 BLOB 으로 바꾸는 방법
======================================
PURPOSE
PLSQL 을 사용해서 LONG/LONG RAW 를 BLOB/CLOB 으로 바꾸는 방법을
예제를 통해 알아봅니다.
만일 Oracle 9i v9.x 를 이용하는 경우에는 다음 명령을 사용하실 수 있습니다.
ALTER TABLE 'TABLE with LONG column' MODIFY ('LONG column' CLOB)
또는
ALTER TABLE 'TABLE with LONG RAW column' MODIFY ('LONG RAW column' BLOB)
Example
Example #1
Example #1 은 LONG column 에 64k 이하의 data 가 있을 경우
PL/SQL 을 이용해서 BLOB 으로 바꾸는 예제 입니다.
-- table 을 drop 합니다.
drop table traw;
drop table tblob
-- table 을 생성합니다.
create table traw (n1 number , l1 long raw);
create table tblob (n1 number , l1 blob);
--- clob 도 사용 가능합니다.
-- table 에 insert 합니다.
begin
for i in 1..10 loop
insert into traw values (i,utl_raw.cast_to_raw(rpad(to_char(i),60,'&')));
insert into tblob values (i,empty_blob());
end loop;
end;
declare
lobloc blob;
buffer long raw(32000);
amount number ;
offset number := 1;
begin
for rec in (select * from traw) loop
select l1 into lobloc from tblob where n1=rec.n1 for update;
buffer := rec.l1;
amount := utl_raw.length(rec.l1);
dbms_lob.write(lobloc,utl_raw.length(rec.l1),1,buffer);
end loop;
end;
Example #2
다음은 PL/SQL 를 이용해서 LONG columns 을 BLOBs 로 변환하는
또 다른 방법입니다.
REM long2lob.sql
REM Version 1.0, last updated 8/8/97
REM This procedure copies LONG data into a CLOB, as described in
REM Chapter 21 of Oracle8 PL/SQL Programming by Scott Urman.
CREATE OR REPLACE PROCEDURE Long2Lob(
-- Uses DBMS_SQL to select a LONG column identified by p_LongQuery, and
-- returns it in p_CLob.
p_LongQuery IN VARCHAR2,
p_CLob IN OUT CLOB) AS
c_ChunkSize CONSTANT INTEGER := 100;
v_CursorID INTEGER;
v_RC INTEGER;
v_Chunk VARCHAR2(100);
v_ChunkLength INTEGER;
v_Offset INTEGER := 0;
BEGIN
-- Open the cursor, define, execute, and fetch.
v_CursorID := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(v_CursorID, p_LongQuery, DBMS_SQL.V7);
DBMS_SQL.DEFINE_COLUMN_LONG(v_CursorID, 1);
v_RC := DBMS_SQL.EXECUTE_AND_FETCH(v_CursorID);
-- Loop over the LONG, fetching c_ChunkSize characters at a time from
-- the LONG and adding them to the LOB.
LOOP
DBMS_SQL.COLUMN_VALUE_LONG(v_CursorID, 1, c_ChunkSize, v_Offset,
v_Chunk, v_ChunkLength);
DBMS_LOB.WRITE(p_CLob, v_ChunkLength, v_Offset + 1, v_Chunk);
IF v_ChunkLength < c_ChunkSize THEN
EXIT;
ELSE
v_Offset := v_Offset + v_ChunkLength;
END IF;
END LOOP;
DBMS_SQL.CLOSE_CURSOR(v_CursorID);
EXCEPTION
WHEN OTHERS THEN
-- Clean up, and reraise the error.
DBMS_SQL.CLOSE_CURSOR(v_CursorID);
RAISE;
END Long2Lob;
Reference Documents
Note:1012454.7
Note:168975.1 -
How can i read a stored picture in oracle Long Raw datatype? blob or clob?
How can i read a stored picture in oracle Long Raw datatype? Like a blob or clob?....i am using jdk 1.3
This is because...i tried to read it like a blob but i obtain a exception...about Type of column no valid......but the column exist....and it contains the long raw datatype of the pictures.....this is my code:
import java.sql.*;
import java.io.*;
import java.util.*;
import oracle.jdbc.driver.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.InputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.DriverManager;
import oracle.sql.BLOB;
import oracle.sql.BLOB.*;
import oracle.jdbc.driver.*;
import java.sql.*;
class rec_ima1
public static void main(String h[])
Connection con = null;
Blob bl;
final ImageIcon image1;
JPanel photo;
try
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con= DriverManager.getConnection("jdbc:oracle:thin:@123.3.12.213:1521:db_name","user","password");
String query = "Select * from pictures where ID = '18840'";
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery( query );
if (!rs.next())
System.out.println("Empty Result Set");
bl = rs.getBlob(5);
if (bl == null) {
System.out.println("Null Blob");
return;
InputStream is = bl.getBinaryStream();
int imageLength = (int) bl.length();
System.out.println(imageLength);
System.out.println(bl.length());
byte[] imageData = new byte [imageLength];
is.read(imageData, 0, imageLength);
image1 = new ImageIcon(imageData);
photo = new JPanel() {
public void paint(Graphics g){
g.setColor(Color.lightGray);
g.drawImage(image1.getImage(), 0, 0, this);
} catch (Exception e) {
e.printStackTrace();
Now i tried using clob:
import java.sql.*;
import java.io.*;
import java.util.*;
import oracle.jdbc.driver.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.InputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.DriverManager;
import oracle.sql.CLOB;
import oracle.sql.CLOB.*;
import oracle.jdbc.driver.*;
import java.sql.CallableStatement;
class rec_ima4
public static void main(String h[])
Connection con = null;
Clob cl;
JPanel photo;
try
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con= DriverManager.getConnection("jdbc:oracle:thin:@123.3.12.213:1521:db_name","user","password");
con.setAutoCommit (false);
String query = "Select * from pictures where ID = '18840'";
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery( query );
while (rs.next()) {
oracle.sql.CLOB clob = (CLOB) rs.getObject(5); //line 47
} catch (Exception e) {
e.printStackTrace();
This is the runtime exception:
java.lang.ClassCastException: [B
at rec_ima4.main(rec_ima4.java:47)Thanks by answering to me......
Well....i did that....but what is ImageIO?....
I declared a ImageIcon imageIO, but this give me the following:
rec_ima3.java:49: cannot resolve symbol
symbol : class BufferedImage
location: class rec_ima3
BufferedImage bi = ImageIO.read(bInput);
^
rec_ima3.java:49: cannot resolve symbol
symbol : variable ImageIO
location: class rec_ima3
BufferedImage bi = ImageIO.read(bInput);
^
What classes i have to import?.....what is ImageIO?
Thanks -
ORA-22835: buffer too small when trying to save pdf file in LONG RAW column
Hi,
I get "ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (real : 125695, maximum : 2000)" when i trying to save a 120k pdf file in an Oracle Long Raw column using dotnet 4.0 and Entity FrameWork.
Dim db As New OracleEntities
Try
Dim myEntity = (From e In db.TEXTE _
Where e.TEXT_ID = txtTextId.Text _
Select e).Single
With myEntity
If txtTextypeId.Text <> "" Then
.TEXTYPE_ID = txtTextypeId.Text
Else
.TEXTYPE_ID = Nothing
End If
.TEXT_NUM = txtTextNum.Text
.TEXT_NAME = txtTextName.Text
.TEXT_DATE = dtTextDate.SelectedDate
If DocAdded Then
.TEXT_DOC = Document
ElseIf DocDeleted Then
.TEXT_DOC = Nothing
End If
End With
db.SaveChanges()
Document is an array of Byte and TEXT_DOC also (mapped to a long row column).
is it possible to increase the size of the buffer ? how may i do it ?
Thx in advance.
Regards.Using a custom UPDATE or INSERT stored procedure for LONG RAW column with
exceed-limit data may still get the following error.
"ORA-01460: unimplemented or unreasonable conversion requested".
One option is to use BLOB instead of LONG RAW in your table and regenerate your
data model from the table. Then using the default UPDATE or INSERT statement
(created by EF) should work.
The following will modify your LONG RAW column to BLOB column.
Disclaimers:
1. It's irreversible--you cannot modify BLOB back to LONG RAW.
2. I have not tried that when there are huge data in LONG RAW column.
So be careful.
alter table <your_table_name> modify <your_long_raw_type_column> blob; -
Migration of LONG and LONG RAW datatype
Just upgraded a DB from 8.1.7.4 to 10.2.0.1.0. In the post-upgrade tasks, it speaks of migrating tables with LONG and LONG RAW datatypes to CLOB's or BLOB's. All of my tables in the DB with LONG or LONG RAW datatypes are in the sys, sysman, mdsys or system schemas (as per query of dba_tab_columns). Are these to be converted? Or, does Oracle want us to convert user data only (user_tab_columns)?
USER_TAB_COLUMNS tells you the columns in the tables owned by the current user. There may well be many users on your system that you created that contain objects. I suppose you could log in to each of those schemas and query their USER_TAB_COLUMNS table, but it's probably easier to query DBA_TAB_COLUMNS with an appropriate WHERE clause on the owner of the objects.
Justin -
Sql Developer MSSql Migration, Online data move, image to long raw mapping
Hello,
my task is to migrate a MSSql Server Database to Oracle 10.2.0.4 with SQL Developer Version 2.1.1.64
and JTDS JDBC Driver oracle.sqldeveloper.thirdparty.drivers.sqlserver 11.1.1.58.17.
Capture, convert and online data move works except data mapping from MSSql image to Oracle long raw dataype.
I need to map MsSql image to oracle blob, to achieve online data move!
is Sql Developer online migration MsSql image to oracle long raw possible?
I know that long raw is outdated, but i'm dba and not responsible for the software part.
What options should i try? offline data move? can MS Bulk Copy Program export image data and SQL*Loader import into long raw?
Any experience or tipp?
Thanks
MichaelHi user12132314 ,
I do not see any 'long raw' options on our current SQLServer 2005 data type mapping. (Raw is a separate 2000 byte data type).
The usual route for SQLDeveloper is to go to Blob.
Online - this is simple & automated.
Offline - this actually goes via hex output in bcp to sqlldr, read in as CLOB which is then encoded to blob. (This is automated)
(Online 'Copy to Oracle' option, right click on table, may be of use if advanced features not included in the select such as defaults are not required, it copies over a select * from table, including blobs)
To move you from blob to long raw after migration can be done (easily enough if Oracle database >=10g so the stream does not have to be in smaller 'chunks')
http://asktom.oracle.com/pls/asktom/f?p=100:11:3938270166267830::::P11_QUESTION_ID:702825000306
I can look into this if you want to go down this route.
Note however that long raw has drawbacks and blob is preferred, see
Oracle® Database SQL Language Reference
11g Release 2 (11.2)
Part Number E17118-04
Data Types
LONG Data Type
for example one restriction is:
A table can contain only one LONG column.
-Turloch
SQLDeveloper Team -
PL/SQL Help...Long Raw to BLOB
Hello All,
I have a PL/SQL Package and Function that does a search for text in a blob field. Below is the Package and the Function.
Here the statement that executes the function
Select *
FROM PROGTXT
WHERE pcode.str_loc_in_blob
(pcode.blob_to_new_blob (progtxt),
'<search string>'
) <> 0
ORDER BY objectvalue1, objectvaluesCurrently the above mentioned sql works where the progtxt is a blob datatype.
We have a database where the progtxt is of Long Raw datatype. I want to utilize the same sql exactly but change the function where i can copy the table structure to a global temporary table each time the function is executed using the dbms_lob funtion and delete the temp table once the function is executed after the results are posted/retrieved. The reason why i want to use the same application is because it is part of a .net program and the only thing i change is the function. I am not great with PL/SQL. If anyone can help that will be a great help!!!!!
Below is the code for the package and the function
CREATE OR REPLACE PACKAGE PCODE AS
FUNCTION to_base (p_dec IN NUMBER, p_base IN NUMBER)
RETURN VARCHAR2
FUNCTION to_dec (
p_str IN VARCHAR2,
p_from_base IN NUMBER DEFAULT 16
RETURN NUMBER
FUNCTION to_hex (p_dec IN NUMBER)
RETURN VARCHAR2
FUNCTION to_bin (p_dec IN NUMBER)
RETURN VARCHAR2
FUNCTION to_oct (p_dec IN NUMBER)
RETURN VARCHAR2
FUNCTION str_to_hex(p_str IN VARCHAR2)
RETURN VARCHAR2
FUNCTION str_loc_in_blob(
l_blob IN BLOB
, l_str IN VARCHAR2)
RETURN NUMBER
FUNCTION blob_to_new_blob(
p_blob IN BLOB)
RETURN BLOB
END PCODE;
CREATE OR REPLACE PACKAGE BODY PCODE AS
FUNCTION to_base (p_dec IN NUMBER, p_base IN NUMBER)
RETURN VARCHAR2
IS
l_str VARCHAR2 (255) DEFAULT NULL;
l_num NUMBER DEFAULT p_dec;
l_hex VARCHAR2 (16) DEFAULT '0123456789abcdef';
BEGIN
IF (p_dec IS NULL OR p_base IS NULL)
THEN
RETURN NULL;
END IF;
IF (TRUNC (p_dec) <> p_dec OR p_dec < 0)
THEN
RAISE PROGRAM_ERROR;
END IF;
LOOP
l_str := SUBSTR (l_hex, MOD (l_num, p_base) + 1, 1) || l_str;
l_num := TRUNC (l_num / p_base);
EXIT WHEN (l_num = 0);
END LOOP;
RETURN l_str;
END to_base;
FUNCTION to_dec (
p_str IN VARCHAR2,
p_from_base IN NUMBER DEFAULT 16
RETURN NUMBER
IS
l_num NUMBER DEFAULT 0;
l_hex VARCHAR2 (16) DEFAULT '0123456789abcdef';
BEGIN
IF (p_str IS NULL OR p_from_base IS NULL)
THEN
RETURN NULL;
END IF;
FOR i IN 1 .. LENGTH (p_str)
LOOP
l_num :=
l_num * p_from_base + INSTR (l_hex, UPPER (SUBSTR (p_str, i, 1)))
- 1;
END LOOP;
RETURN l_num;
END to_dec;
FUNCTION to_hex (p_dec IN NUMBER)
RETURN VARCHAR2
IS
BEGIN
RETURN to_base (p_dec, 16);
END to_hex;
FUNCTION to_bin (p_dec IN NUMBER)
RETURN VARCHAR2
IS
BEGIN
RETURN to_base (p_dec, 2);
END to_bin;
FUNCTION to_oct (p_dec IN NUMBER)
RETURN VARCHAR2
IS
BEGIN
RETURN to_base (p_dec, 8);
END to_oct;
FUNCTION str_to_hex(p_str IN VARCHAR2)
RETURN VARCHAR2 IS
l_val VARCHAR2(2000) := NULL;
BEGIN
FOR i IN 1 .. LENGTH (p_str)
LOOP
l_val := l_val || to_hex(ASCII(SUBSTR (p_str, i, 1))) || case when i = LENGTH (p_str) then null else '00' end;
END LOOP;
RETURN UPPER(l_val);
END str_to_hex;
FUNCTION str_loc_in_blob(
l_blob IN BLOB
, l_str IN VARCHAR2)
RETURN NUMBER IS
blob_len NUMBER;
l_pos number := 0;
BEGIN
blob_len := dbms_lob.getlength(l_blob);
l_pos := 0;
FOR i in 0..15 LOOP
l_pos := dbms_lob.instr(DBMS_LOB.SUBSTR (l_blob, 2000, i*2000+1), IMPACTUS_PCODE.str_to_hex((l_str)));
IF l_pos <> 0 THEN
RETURN i*2000+1 + l_pos - 1;
END IF;
END LOOP;
FOR i in 0..15 LOOP
l_pos := dbms_lob.instr(DBMS_LOB.SUBSTR (l_blob, 2000, i*2000+1), IMPACTUS_PCODE.str_to_hex(upper(l_str)));
IF l_pos <> 0 THEN
RETURN i*2000+1 + l_pos - 1;
END IF;
END LOOP;
l_pos := 0;
FOR i in 0..15 LOOP
l_pos := dbms_lob.instr(DBMS_LOB.SUBSTR (l_blob, 2000, i*2000+1), IMPACTUS_PCODE.str_to_hex(lower(l_str)));
IF l_pos <> 0 THEN
RETURN i*2000+1 + l_pos - 1;
END IF;
END LOOP;
l_pos := 0;
FOR i in 0..15 LOOP
l_pos := dbms_lob.instr(DBMS_LOB.SUBSTR (l_blob, 2000, i*2000+1), IMPACTUS_PCODE.str_to_hex(initcap(l_str)));
IF l_pos <> 0 THEN
RETURN i*2000+1 + l_pos - 1;
END IF;
END LOOP;
RETURN 0;
END str_loc_in_blob;
FUNCTION blob_to_new_blob(p_blob BLOB)
RETURN BLOB IS
v_file_blob BLOB;
v_file_blob_new BLOB := NULL;
v_file_clob CLOB;
v_file_size INTEGER := dbms_lob.lobmaxsize;
v_dest_offset INTEGER := 1;
v_src_offset INTEGER := 1;
v_blob_csid NUMBER := dbms_lob.default_csid;
v_lang_context NUMBER := dbms_lob.default_lang_ctx;
v_warning INTEGER;
BEGIN
DBMS_LOB.CREATETEMPORARY(v_file_clob, TRUE);
dbms_lob.convertToClob(
v_file_clob,
p_blob,
v_file_size,
v_dest_offset,
v_src_offset,
v_blob_csid,
v_lang_context,
v_warning);
v_file_clob:=upper(v_file_clob);
IF v_warning = 0 THEN
v_file_size := dbms_lob.lobmaxsize;
v_dest_offset := 1;
v_src_offset := 1;
v_blob_csid := dbms_lob.default_csid;
v_lang_context := dbms_lob.default_lang_ctx;
v_warning := null;
DBMS_LOB.CREATETEMPORARY(v_file_blob_new,true);
dbms_lob.convertToBlob(
v_file_blob_new,
v_file_clob,
v_file_size,
v_dest_offset,
v_src_offset,
v_blob_csid,
v_lang_context,
v_warning);
IF v_warning = 0 THEN
RETURN v_file_blob_new;
END IF;
END IF;
END;
END PCODE;
/Thanks
Nitin
Edited by: user13048604 on Jan 12, 2011 10:18 PMFirst you may need to convert 'BLOB' which is of 'RAW' type to 'VARCHAR2'
using
utl_raw.cast_to_varchar2(urblob)Then you can make use of dbms_lob.instr,dbms_lob.substr etc... -
Does 91 Support LONG RAW ?
I was told that Oracle 9i does not support LONG / LONG RAW columns and all need to change to BLOB or CLOB. Is this true. Is there any place in oracle web site or any authentic document where this is true.
If so, I got truck load of job to do out here.
Keep me informed
many thanks
-SathyaHi,
LONG and LON RAW datatypes are supported in Oracle9i.
Check the following document on 9.2
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96540/sql_elements2a.htm#54201
It is specified in the document that
'Oracle Corporation strongly recommends that you convert LONG columns to LOB columns as soon as possible. Creation of new LONG columns is scheduled for desupport.'
The document even contains details on how to convert LONG/LONG RAW to BLOB/CLOB
Hope this helps.
Regards,
Anupama -
LONG RAW Columns and Replication Set-up
we are working to set-up a replicated environment for all of
our Oracle Applications.
I could not get a clear understanding which Version Oracle will
support BLOB/CLOB/LONG RAW replication support or
Whether we can plan for Replicating such kind of Applications.
I read from one of Oracle Press book - "Oracle Backup &
Recovery" it is documented
that Oracle doesn't replication support for columns that use
BLOBs,CLOBs ( Page
no. 434 )
As one of our application was designed using LONG RAW Column, I
was wondering
about carrying the existing LONG RAW column to be replicated
like a CLOB/BLOB, if oracle supports Replication of BLOB/CLOB.
It will be of great help, if you can provide some insight in the
complexity of
having BLOBs in the applications to go further on making our
efforts to have a
Replicated environment set-up.
Thanking you in anticipation.
Bhanu Prakash
< [email protected]>1) LONG and LONG RAW have been depricated since 8i so you shouldn't be using them ever for anything.
2) LONG and LONG RAW don't even have decent support to be manipulated from PL/SQL so there is essentially no SQL support.
3) It would be very rare that you would have anything to index in a LONG or a LONG RAW from a functionality standpoint. You're not likely, for example, to want to store more than 4k of data in a LONG and then do things like search for strings that start with a particular phrase. You're very very unlikely to want to search a binary LONG RAW to look for rows where the binary data starts with a particular string of bytes. You'd potentially want to be able to use Oracle Text on a LONG field to search for particular words and phrases in the text but I'm not sure that existed prior to LONGs being depricated.
Justin -
LOB, LONG, LONG RAW 데이터 타입 간의 비교
제품 : ORACLE SERVER
작성날짜 : 2002-11-19
LOB, LONG, LONG RAW 데이터 타입 간의 비교
=========================================
PURPOSE
이 문서는 LOB 데이터 타입과 LONG이나 LONG Raw 데이터 타입의 차이점 및
LOB 사용에 따라 발생하는 제약 사항을 기술하는 데 목적이 있다.
Explanation
LOB (Large Object)는 LONG이나, LONG RAW 데이터 타입과 유사하지만, 일부 차이점이 존재한다.
1. 테이블의 한 ROW에 여러 LOB 컬럼이 있을 수 있는 반면, LONG 또는 LONG RAW 컬럼은
한 ROW에 하나 밖에 사용될 수 없다.
2. LOB는 사용자 정의 데이터 타입 (user-defined datatype)의
속성 (attribute) 으로 사용될 수 있는 반면, LONG이나 LONG RAW는 속성으로
사용될 수 없다.
3. LONG 또는 LONG RAW는 값 전체가 테이블 내에 저장이 되는 반면, LOB는 테이블 컬럼
내에 LOB locator만 저장이된다. BLOB과 CLOB (내부 LOB) 데이터는 별도의 테이블스페이스에
저장시킬 수 있으며, BFILE (외부 LOB) 데이터는 데이터베이스 외부의 별도 파일로 존재한다.
따라서 LOB 컬럼을 액세스할 경우에는, locator 값만 return되는 반면, LONG이나
LONG RAW 컬럼을 액세스할 경우에는, 전체 값이 return된다.
4. LOB 데이터는 4GB까지 저장이 가능하며, BFILE 컬럼이 가리키는 파일 크기는 4GB 이내에서
OS에서 지원하는 최대 크기까지 가능하다. 액세스 가능한 범위는 1부터 (232-1) 까지이다.
한편 LONG이나 LONG RAW 데이터 타입에서는 2GB 까지만 지원이 가능하다.
5. 데이터에 대한 랜덤 액세스 기능 또는 데이터 조작을 할 경우 LOB를 사용하는 것이
LONG 또는 LONG RAW를 사용하는 것에 비해 훨씬 많은 기능을 사용할 수 있다.
6. LOB는 랜덤 액세스가 가능한 반면, LONG 타입에 저장된 데이터는 처음부터 원하는
지점까지 순차적으로 읽어 처리하여야 한다.
7. LOB 데이터에 대한 replication을 local 또는 remote에서 수행할 수 있는 반면,
LONG / LONG RAW 컬럼 데이터는 replication이 되지 않는다.
8. LONG 컬럼의 데이터는 TO_LOB()라는 함수를 사용하여 LOB로 변환 가능하지만,
LOB를 LONG / LONG RAW로 변환 하는 기능은 제공되지 않는다.
한편, LOB 사용을 하는데 다음과 같은 제약 사항이 따른다.
1. LOB는 클러스터 테이블에서는 사용할 수 없으며, 따라서 클러스터 키
로도 사용할 수 없다.
2. LOB 컬럼은 GROUP BY, ORDER BY, SELECT DISTINCT 등에 사용할 수 없으며
JOIN 에도 사용할 수 없다. 그러나 LOB 컬럼을 사용하는 테이블에 대한
UNION ALL은 지원이 된다. UNION MINUS나 SELECT DISTINCT는 OBJECT TYPE의
MAP이나 ORDER 함수가 정의된 경우 사용할 수 있다.
3. LOB 컬럼은 ANALYZE ... COMPUTE/ESTIMATE STATISTICS 명령 사용 시에도
analyze 되지 않는다.
4. LOB는 파티션된 IOT (Index Organized Table)에는 사용할 수 없다. 그러나
파티션 되어 있지 않은 IOT에는 사용할 수 있다.
5. LOB는 VARRAY에는 사용할 수 없다.
6. NCLOB은 OBJECT TYPE의 속성(attribute)으로 사용될 수 없으나, 메소드 정의를
하는 데는 NCLOB 파라미터를 사용할 수 있다.
Example
none
Reference Documents
Oracle8i Application Developer's Guide
Note:107441.1 -
I can not put the data of a field(LONG RAW) consulted into a item of a data block
I want to query a field that is LONG RAW(it's a image) and put the data into a item of a data block (in Forms Builder), when i write ":BLOCK.FOTO:=vfoto" i recieve this errors: "bad bind variable ....". How can i put the data of field of my DB and put the data in a item of a data block(in Forms Builder)?.
I can store a image in a table of my DB, but i want to query a image stored in my DB and put it into anothers table, all this on FORMS BUILDER.You have to base the image item on a base table and use EXECUTE_QUERY on that block. You can't do a direct select in PL/SQL into the item
-
Reading and Inserting Value in Long Raw
Hi guys !!
I have a table with 15 columns out of which RESUME column has data type long Raw. I want to copy this table to another table with selectd columns and validation. I want to check whether RESUME column is NULL. How to achieve it ?
Similarly, using VB how to insert and retrieve values in such column ?
thanx in advance
Abhido one thing ,
Create a summary item for detail amount column, say m_tot_amt
Set its fol. properties
Calculation Mode : Summary
Summary : Sum
Summ.Blk : Your detail blk
Summ. Item : Your detail amount item
Also, Set Query all records of your detail block as Yes
Then In PRE-INSERT/ PRE_UPDATE of detail block, write
:COP_ORDER_HEADER.DISCOUNT_AMOUNT := nvl(:m_tot_amt,0) ; -
How to read LONG RAW data from one table and insert into another table
Hello EVERYBODY
I have a table called sound with the following attributes. in the music attribute i have stored some messages in the different language like hindi, english etc. i want to concatinate all hindi messages and store in the another table with only one attribute of type LONG RAW.and this attribute is attached with the sound item.
when i click the play button of sound item the all the messages recorded in hindi will play one by one automatically. for that i'm doing the following.
i have written the following when button pressed trigger which will concatinate all the messages of any selected language from the sound table, and store in another table called temp.
and then sound will be played from the temp table.
declare
tmp sound.music%type;
temp1 sound.music%type;
item_id ITEM;
cursor c1
is select music
from sound
where lang=:LIST10;
begin
open c1;
loop
fetch c1 into tmp; //THIS LINE GENERATES THE ERROR
temp1:=temp1||tmp;
exit when c1%notfound;
end loop;
CLOSE C1;
insert into temp values(temp1);
item_id:=Find_Item('Music');
go_item('music');
play_sound(item_id);
end;
but when i'm clicking the button it generates the following error.
WHEN-BUTTON-PRESSED TRIGGER RAISED UNHANDLED EXCEPTION ORA-06502.
ORA-06502: PL/SQL: numeric or value error
SQL> desc sound;
Name Null? Type
SL_NO NUMBER(2)
MUSIC LONG RAW
LANG CHAR(10)
IF MY PROCESS TO SOLVE THE ABOVE PROBLEM IS OK THEN PLESE TELL ME THE SOLUTION FOR THE ERROR. OTHER WISE PLEASE SUGGEST ME,IF ANY OTHER WAY IS THERE TO SOLVE THE ABOVE PROBLEM.
THANKS IN ADVANCE.
D. PrasadYou can achieve this in many different ways, one is
1. Create another VO based on the EO which is based on the dest table.
2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
3. commiting the transaction will push the data into the dest table on which the dest VO is based.
I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
Tapash
Maybe you are looking for
-
Using 2011 iMac as external display for new Retina macbook / port sharing question
I'd like to see if there is a way to use the firewire port on the back my 2011 iMac 27" when it's connected to my 2014 15" Retina Macbook. The two work fine right now - the iMac is the main display for the macbook, but I wanted to know if there is a
-
How to set a button to flatten & email PDF document
Hi everyone, I am new enough to form creation and have a request for any help? I have a form I would like to give to someone. They should be able to fill it as they need to in reader etc. (with various basic fields and an incrementing number for each
-
Complete Novice (my personal challenge)
Hi, I am looking to fastrack myself to learn the basics of Oracle to enable me to do a small test Project. The parameters are to give myself 2 weeks to find some free hosted Oracle Area (for thr Project) then somehow create an ERD that can be mapped
-
Changing screens with cmd-tab not working
To change screens (different programs) I often use cmd-tab. But it doesn't work all the time. Very often when I use cmd-tab, nothing happens. What can I do? Please help.
-
Officejet 4500 g510n-z no error message but the ! sign is on.
What is wring? can you direct me to errror messages log? This question was solved. View Solution.