473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

inserting data into "CLOB" field returning ORA-01704: string literal too long

Hello Everyone,

I'm attempting to design a small web app to obtain customer feedback.
The issue is when a user inputs >4000 characters in the COMMENTS
section I get the following Err Msg: ORA-01704: string literal too
long.

I am using Visual Studio.Net 2003 (vb as language), SQL+ to create
tables in Oracle 9i, and Access to just link and veiw the tables.

Used SQL+ to create the table

sql> create table tab1
(NAME varchar2(100), COMMENTS CLOB);

My webform has 2 textboxes, 1 button and 1 label

Code looks like so:

Imports System.Data
Imports System.Data.OleDB
_________________________

Private ConnectString as String
....
ConnectString = "Yada, Yada, Yada..."
....
Dim con As New OleDBConnection(ConnectString)

________________________________

The following is my input statement:

Private Sub btnSubmit_Click.........

TRY

Dim insertSQL, Name, Comments As String
Dim Added as Integer

NAME = " ' " & txtName.text & " ' "
COMMENTS = " ' " & txtComments.text & " ' "

insertSQL = "INSERT INTO TAB1(NAME, COMMENTS)" & _
"VALUES (" & NAME & ", " & COMMENTS & ")"

DIM cmd As New OleDBCommand(insertSQL, con)
con,open()
added = cmd.ExecuteNonQuery
con.close()

'gives me some kind of confirmation record was submitted
If added > 0 Then
lblErr.text = "Record Submitted"
End If

Catch ex As Exception
con.close()
lblErr.text = ex.Message
End Try
End Sub
__________________________________________

This is as detailed as I can get. Do I need to declare COMMENTS as
something other than string? Is there some other way I need to write
the insert statement? Am I way off and should hang it up as a beginner
..Net developer? I have read through tons of docs, websites, and groups
and can't come up with any definitive answers. This is my first time
posting. Willing to help anyone and any help would be MUCH appreciated.

Feb 9 '06 #1
1 16173
You can't use oledb, I added the Oracle reference and used Imports
Oracle.DataAccess.Client and Oracle.DataAccess.Types, I changed some
code around and on day 2 got it working. I would like to post a couple
of links that assisted me in completing my task and hope it well help
others with my same situation. This applies to all LOBs.

'this will go over the setup of tables and code needed to read the
clob, this must be done first, before you can write to a LOB field.
Yes, you have to read before you can write. The link will further
explain.
http://www.oracle.com/technology/pub...ns_dotnet.html
'this one will explain how to write to a LOB field
http://www.oracle.com/technology/pub...e_dotnet2.html

Thank you all.

Feb 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob Panosh | last post by:
Hello, I am having trouble moving data from a CLOB to a NCLOB column. My current table structure for table fmattachmentembed: --------------------------------------------------------...
1
by: Srinadh | last post by:
Hi all, We have files with about 20 to 30 fields per row. We are trying to update such files with about 60 rows as contiguous data in a CLOB field. It passes through. But when we try...
2
by: beena | last post by:
We have a mainframe DB2 table with CLOB data type... What's the best way to transfer CLOB data from os/390 DB2 to UDB (8.2) on AIX 5.2. We tried unloading data with fixed format and tried...
29
by: jens Jensen | last post by:
Hello, I got this "breath taking" task to write a an http server to which "xml data" will be posted to and will answer with xml data. The logic behind the xml processing is not a matter here. ...
3
by: egarobar | last post by:
I am using Access 2003 (on WinXP) to read from an Oracle db, where there is a table with a CLOB which is a variable-size text field. In the 'linked table' which is created in the Tables panel of...
4
by: Peter Kanurer | last post by:
Assume I add in VisualCSharp 2005 References to Oracle.DataAccess AND System.Data.OracleClient to an application. Does this cause problems or can they co-exist in one application ?
2
by: avimel | last post by:
I have a CLOB generated by a call to DBMS_XMLGEN.NEWCONTEXT('SELECT ...') which contains data that needs to be parsed and output to file one row at a time; the row data in the CLOB is delimited by...
0
by: pai | last post by:
Hi All, I have a field which had a field of DATA TYPE CLOB and in that I have inserted an XML. How can I see the contents of that XML file. Please Help Regards Pai
0
by: Vinodsrvk | last post by:
I tried to execute the bellow query for the word "about" in the NARRATIVE field. This narrative field is of CLOB type with NOTNULL SELECT SEARCHID, NARRATIVE FROM S.TBLSEARCH WHERE...
0
by: kcanterbury | last post by:
I am trying to insert a CLOB data field (1M in size) into an Oracle table using a COBOL DB/2 program. I have an alius in DB2 set up for the Oracle table. The field is defined as TYPE is CLOB(1M) in...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.