Question related to CLOB data type in Oracle 11g
Hi,
I'm trying to assign a string value to a CLOB variable but it is giving me an error as described below. Can someone please let me know what am I missing here? As far as I know, in 11g a CLOB variable can store upto 4GB of data and all i'm trying to use is only 7K of data.
DECLARE
v_sql1 CLOB;
v_sql2 CLOB;
BEGIN
DBMS_OUTPUT.ENABLE(1000000);
v_sql1 := 'BLAH-BLAH-BLAH.........'; --> this string is actually more than 4000 characters.
v_sql2 := TO_CLOB('BLAH-BLAH-BLAH.........'); --> this string is actually more than 4000 characters.
dbms_output.put_line(v_sql1);
dbms_output.put_line(v_sql2);
END;
When I try to execute the above script, I get the error message: ORA-06502: PL/SQL: numeric or value error:character string buffer too small.
I even tried to use TO_CLOB function as shown above but it is failing as well.
NOTE: The string to assign is not coming from any table but mainly a SQL statement used for sys_refcursor.
Thanks.
John Spencer wrote:
Unless I missed something in the 11g new features, the maximum line length in DBMS_OUTPUT.Put_Line is still 255 characters.
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> set serveroutput on
SQL> exec dbms_output.put_line(lpad('X',512,'X'));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PL/SQL procedure successfully completed.
SQL> SY.
Similar Messages
-
Failed to get Column's data type in Oracle 11g
Hi,
I made an ADO connection(Oracle provider) to Oracle 11g, and use ADO API: OpenSchema(adSchemaColumns) to fetch the columns' info. But I found I couldn't get the column's data type if it's type is timestamp or timestampwithtimezone in database. What I got is 'adIUnknown' whose number is 13.
I test with another column whose data type is 'date', and everything is ok. I get the data type 'adDBTimeStamp'.
This issue occurs on Oracle 10g, too.
Can anyone offer some help? Thanks a lot!See
http://www.oracle.com/technology/tech/windows/odpnet/index.html
http://download.oracle.com/docs/cd/B28359_01/win.111/b28431/using.htm#CHDJJDAJ -
Number(p,s) data type in oracle 11g is not storing places after decimal
I have noticed in toad that if my source is somthing like '111' it is not getting converted to 111.00 when it is being stored as number (15,2) .
however decimal datatype would worK i think or is there a setting on toad that is turning off the visiblty.please throw light on thisread http://download.oracle.com/docs/cd/A81042_01/DOC/server.816/a76965/c10datyp.htm#743 especially Internal Numeric Format
Regards
Etbin
Edited by: Etbin on 15.10.2011 0:13
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1619552483055 more about number datatype -
Clob data type oracle to oracle issue
Hi Guys
i am unable to load clob data type and am getting the following error
" java.lang.NumberFormatException: For input "string: "4294967295"
i also have checked for clob data type in topology manager -- technology -- oracle -- data type
and it is available.
i have added the following statement in my parameter file
set ODI_ADDITIONAL_JAVA_OPTIONS=%ODI_ADDITIONAL_JAVA_OPTIONS% " -Doracledatabasemetadata.get_lob_precision=false";
but i don't see any statement like the one below after which i have to add the above statement.
set ODI_ADDITIONAL_JAVA_OPTIONS="-Djava.security.policy=server.policy";
please let me know how to make the clob data type work
Regards
janakiramHi Sutirtha
Yes i am able to view source data with clob data type by Right click onto your source datastore ---> View data
I have checked metalink
it says
1. Oracle recommends the setting of the "get_lob_precision" flag to FALSE to avoid this message when dealing with LOB family datatypes (CLOB, BLOB, NCLOB, BFILE...).
i have used the follwoing setting
set ODI_JAVA_OPTIONS="-Djava.security.policy=server.policy"
set ODI_ADDITIONAL_JAVA_OPTIONS=%ODI_ADDITIONAL_JAVA_OPTIONS% "-Doracledatabasemetadata.get_lob_precision=false"
2. checked the internal id of CLOB data type and it ends with 999
but still i have the same problem
Regards
janakiram -
Error while loading data into clob data type.
Hi,
I have created interface to load data from oracle table into oracle table.In target table we have attribute with clob data type. while loading data into clob field ODI gave below error. I use odi 10.1.3.6.0
java.lang.NumberFormatException: For input string: "4294967295"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
Let me know if anyone come across and resolved this kind of issue.
Thanks much,
Nishit GajjarMr. Gajjar,
You didnt mention what KMs you are using ?
have a read of
Re: Facing issues while using BLOB
and
Load BLOB column in Oracle to Image column in MS SQL Server
Try again.
And can you please mark the Correct/Helpful points to the answers too.
Edited by: actdi on Jan 10, 2012 10:45 AM -
Pdf file stored as BLOB data type on Oracle
I store PDF file as BLOB data type on Oracle. There are cases
where I get multiple records from the database, that means I get
multiple PDF files. They have to be merged and displayed on the web
page. I tried CFContent which can display only one PDF file at a
time but not more than one, whereas cfdocument is having problem
converting binary data to string. I am kind of stuck.
Can you anybody please help me out? Please let me know if you
have any questions or this does not make sense to you.
Thank you in advance.BALAJI_JAY wrote:
> Can you anybody please help me out? Please let me know
if you have any
> questions or this does not make sense to you.
if by "merge" you mean 3 pdf into 1 pdf, try cfpdf (if on
cf8) or see this
thread if cf version less than 8:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=11 14635&messageid=4032202 -
Using CLOB data type - Pros and Cons
Dear Gurus,
We are designing a database that will be receiving comments from external data source. These comments are stored as CLOB in the external database. We found that only 1% of incoming data will be larger than 4000 characters and are now evaluating the Pros and Cons of storing only 4000 characters of incoming comments in VARCHAR2 data type or using CLOB data type.
Some of the concerns brought up during discussion were:
- having to store CLOBs in separate tablespace;
- applications, such Toad require changing defaults settings to display CLOBs in the grid. Default value is not to display them;
- applications that build web page with CLOBs will be struggling to fit 18 thousand chararcters of which 17 thousand are blank lines;
- cashing CLOBs in memory will consume big chunk of data buffers which will affect performance;
- to manipulate CLOBs you need PL/SQL anonymous block or procedure;
- bind variables cannot be assigned CLOB value;
- dynamic SQL cannot use CLOBs;
- temp tables don't work very well with CLOBs;
- fuzzy logic search on CLOBs is ineffective;
- not all ODBC drivers support Oracle CLOBs
- UNION, MINUS, INTERSECT don't work with CLOBs
I have not delt with CLOB data type in the past, so I am hoping to hear from you of any possible issues/hastles we may encounter?848428 wrote:
Dear Gurus,
We are designing a database that will be receiving comments from external data source. These comments are stored as CLOB in the external database. We found that only 1% of incoming data will be larger than 4000 characters and are now evaluating the Pros and Cons of storing only 4000 characters of incoming comments in VARCHAR2 data type or using CLOB data type.
Some of the concerns brought up during discussion were:
- having to store CLOBs in separate tablespace;They can be stored inline too. Depends on requirements.
- applications, such Toad require changing defaults settings to display CLOBs in the grid. Default value is not to display them;Toad is a developer tool so that shouldn't matter. What should matter is how you display the data to end users etc. but that will depend on the interface. Some can handle CLOBs and others not. Again, it depends on the requirements.
- applications that build web page with CLOBs will be struggling to fit 18 thousand chararcters of which 17 thousand are blank lines;Why would they struggle? 18,000 characters is only around 18k in file size, that's not that big to a web page.
- cashing CLOBs in memory will consume big chunk of data buffers which will affect performance;Who's caching them in memory? What are you planning on doing with these CLOBs? There's no real reason they should impact performance any more than anything else, but it depends on your requirements as to how you plan to use them.
- to manipulate CLOBs you need PL/SQL anonymous block or procedure;You can manipulate CLOBs in SQL too, using the DBMS_LOB package.
- bind variables cannot be assigned CLOB value;Are you sure?
- dynamic SQL cannot use CLOBs;Yes it can. 11g supports CLOBs for EXECUTE IMMEDIATE statements and pre 11g you can use the DBMS_SQL package with CLOB's split into a VARCHAR2S structure.
- temp tables don't work very well with CLOBs;What do you mean "don't work well"?
- fuzzy logic search on CLOBs is ineffective;Seems like you're pulling information from various sources without context. Again, it depends on your requirements as to how you are going to use the CLOB's
- not all ODBC drivers support Oracle CLOBs not all, but there are some. Again, it depends what you want to achieve.
- UNION, MINUS, INTERSECT don't work with CLOBsTrue.
I have not delt with CLOB data type in the past, so I am hoping to hear from you of any possible issues/hastles we may encounter?You may have more hassle if you "need" to accept more than 4000 characters and you are splitting it into seperate columns or rows, when a CLOB would do it easily.
It seems as though you are trying to find all the negative aspects of CLOBs and ignoring all the positive aspects, and also ignoring the negative aspects of not using CLOB's.
Without context you're assumptions are just that, assumptions, so nobody can tell you if it will be right or wrong to use them. CLOB's do have their uses, just as XMLTYPE's have their uses etc. If you're using them for the right reasons then great, but if you're ignoring them for the wrong reasons then you'll suffer. -
Pl/sql Procedure is Not Creating With the CLOB data Type
Hi,
I am Using Oracle 10g Express Edition Release2.... My Doubt is While creating a table With CLOB Data Type the table is created successfully,but while Creating a Procedure With the CLOB Data type i am getting an Error Message
2667/5 PL/SQL: Statement ignored
2667/24 PLS-00382: expression is of wrong type
then i tried With the Varchar2(30000) the Procedure is Created Successfully note i have not changed any thing in my code except the data type.
I am Just Confused ......Why the Procedure is not Created with CLOB Data type?
Please advice ...
Thank U
SHANhi,
Thanks for reply....Another Example
CREATE TABLE USER_MAS (USER_ID VARCHAR2 (20 Byte),MAIL_ID VARCHAR2 (255 Byte));
set serveroutput on
declare
atable varchar2(64) := 'USER_MAS';
acolumn varchar2(64) := 'MAIL_ID';
avalue varchar2(64) := 'NEWYORK' ;
dyn_sql clob;
begin
dyn_sql := 'update '||atable||' set '||acolumn||' = '''||avalue|| '''' ;
dbms_output.put_line(dyn_sql);
execute immediate dyn_sql;
end;
commit ;
Error at line 2
ORA-06550: line 9, column 23:
PLS-00382: expression is of wrong type
ORA-06550: line 9, column 5:
PL/SQL: Statement ignored
When i Changed the Data type to varchar2(64)
update USER_MAS set MAIL_ID = 'NEWYORK'
PL/SQL procedure successfully completed.
Commit complete.
I like to Know the Reason Why the Procedure is Not Created in Oracle 10g XE DB
Note :the Same Script i used in 11g DB the Procedure is Created Successfully....
Why you need use CLOB or VARCHAR2 in your temp_num variable as you sending parameters as number?
In the Procedure we are create some run time queries while executing the procedure. There are around 10 run time queries created.
The size of each query is more than 4000 characters . We then add all the queries using union all after each query to the clob variable as the normal varchar will not support.
Please Advice
Thank U
SHAN -
I am a developer in .NET with having experience working on SQL server.
I want to know whether there is an xml data type in oracle.
I have an xml in my front end and want to insert record in the database for the values inside that xml. What i am doing currently is that i am retreiving the value in the xml in the .NET code and passing the values a parameter to a stored procedure in oracle. what i want to do is to pass the xml directly to stored procedure in oracle and retrieve the values there (using Xquery) and insert the records.
This is possible with SQL server 2005. I want to know is this possible with Oracle.
Thanks and regards,
Sameer J NarkarWonderful - a documentation question!
You will find your answer by going to the general documentation portal at http://tahiti.oracle.com following the path to the database version of interest, and looking in the SQL Reference manual. Chapter 2 discusses all data types, including the several supported for XML.
In addition, under the 'Books' tab, there are several XML-developer specific reference manuals.
(Oracle's support for XML generally blows away the others. The price for the extreme flexibility is an ease-of-use hit.)
Message was edited by:
Hans Forbrich
removed the punctuation from the displayed URL which resulted in an automatically included trailing comma. -
How to migrate SQL Server image data type to Oracle 8 BLOB data type?
Hi,
I have to migrate data from sql server to Oracle 10 g.
I am unable to migrate image data type from sql server to blob data type in oracle.
Iam using Oracle Heterogenous Services to migrate the data,Using Merge statement and database link.
I am getting the following error-
ERROR at line 7:
ORA-00932: inconsistent datatypes: expected BLOB got LONG BINARY
Can any one suggest me how to migrate Image datatype to BLOB???Hi you might want to post your question in General Forum.
General Database Discussions
There's very few users visit this forum. -
Question about uesr-defined data types
Can anyone help me to answer the question?
Explain the user-defined data types in Oracle Spatial, and give examples how these data types and their associated operations are used to support
i. Storage
ii. Indexing
iii. Retrieval
of spatial data.
thanks!!you need to look at the oracle spatial user's guide, which gives most of that information. it is downloadable from otn...
-
Is there a auto-increment data type in Oracle
Is there a auto-increment data type in Oracle ?
How to do it if there is no auto-increment data type in Oracle ?
nulljackie (guest) wrote:
: Is there a auto-increment data type in Oracle ?
: How to do it if there is no auto-increment data type in Oracle
Hi,
I think you need unique ID's, for this purpose you use sequences
in Oracle. Example:
create table xy (
id number,
name varchar2(100)
alter table xy
add constraint xy_pk primary key(id);
create sequence xy_seq start with 1 maxvalue 99999999999;
(there are many other options for create sequence)
create or replace trigger xy_ins_trg
before insert on xy
for each row
begin
select xy_seq.nextval
into :new.id
from dual;
end;
This produces a unique value for the column id at each insert.
Hope this will help.
peter
null -
Cannot get the correct data type in Oracle JDBC
Dear ALL:
I used JDBC ResultSetMetaData to get the column data type for Oracle Database. I created a table including 2 columns AAA, which is NUMBER type, BBB which is FLOAT type.
However, I found a problem that either NUMBER or FLOAT data types are reported as NUMBER type in JDBC.
IN SQL 2000, it is okay. SMALLINT, INT, TINYINT, etc..can be reported correctly.
Can anybody tell me that what's wrong here? I will be very appreciated.hi,
i guess its a bug which is fixed with 10i.
Elango. -
Bea and nvarchar2 data type in oracle
Does weblogic server supports nvarchar2 data type in Oracle?..
I use CMP with java data type String mapped to nvarchar2 data type to oracle.when
i try to create a bean it throws "java.sql.SQLException: ORA-12704: character set
mismatch". Is there any configuration in the server to set the character set?..
can anyone help me on this?...Does weblogic server supports nvarchar2 data type in Oracle?..
I use CMP with java data type String mapped to nvarchar2 data type to oracle.when
i try to create a bean it throws "java.sql.SQLException: ORA-12704: character set
mismatch". Is there any configuration in the server to set the character set?..
can anyone help me on this?... -
BOOLEAN data type in oracle is it there?
is there any data type in oracle which stores BOOLEAN data?
>
There are inevitably problems with three-valued logic. To be consistent with the 3VL world of SQL one would expect a 3 value logical type (not strictly a "boolean" type at all). The standard chose not to do that and opted for just TRUE and FALSE with NULL as a sort of substitute for the third value. That in itself creates some logical conundrums but it's probably impossible to come up with any system that makes sense of SQL's 3VL. Probably that's why most DBMS vendors leave it out.
>
No problem. Just define it as NOT NULL and you will have traditional 2VL Boolean algebra.
Maybe you are looking for
-
Distributed transactions/jdbc problem WL60
Hi Our company has aworking application running on WLS5.1sp9. Im in the process of migrating it to WL6.0sp2. Our domain has 2 clusters each running 2 servers: 1) servlet engines (handling http requests from cli
-
Portal AD authentication with multiple OU
Hi, all. We are trying to implement AD authentication. Users are located under 3 different OU(but same domain controller). I don't want to use AD group to "group" the users since they would be limited to have one group. Is there a way to put in multi
-
Safari having trouble with hotel internet login
I stayed at a new hotel recently. The hotel had wireless internet access, whereby I had to enter a user name and password. Normally when I open my browser or a new page within, the request is redirected to the login screen of the internet provider, I
-
Error code:0xE8000065. Help! please
when i plug in my iPod Touch (4th generation) on my computer, i get a error code by itunes: 0xE8000065. i wantedt update my ipod with a copy of my ipod, i cancelled the making of the copy and plug out my ipod because itunes did hook, and my ipod hook
-
Sending mails automatically using trigger concept-Auto Responder
I am developing an application in which i had to develop an Auto Responder application. For this application i need to send different mails to different customers automatically on different days. Though i got the concept of using timers and the sched