Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions knowledge-base/ora-01764-error-radeditor-saving-text-oracle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: ORA-01764 Error When Saving Text Data with RadEditor in Oracle Database
description: Troubleshooting the ORA-01764 "String literal too long" error when saving data with RadEditor in an Oracle database using a VARCHAR2 column.
type: troubleshooting
page_title: Solving ORA-01764 Error in RadEditor When Saving Text to Oracle Database
meta_title: Solving ORA-01764 Error in RadEditor When Saving Text to Oracle Database
slug: ora-01764-error-radeditor-saving-text-oracle
tags: radeditor, asp.net ajax, ora-01764, clob, varchar2, maxhtmllength, error
res_type: kb
ticketid: 1693150
---

## Environment
<table>
<tbody>
<tr>
<td> Product </td>
<td> RadEditor for ASP.NET AJAX </td>
</tr>
<tr>
<td> Version </td>
<td> all </td>
</tr>
</tbody>
</table>

## Description

I encounter the ORA-01764 "String literal too long" error in Oracle when saving text data using RadEditor. The database column is of type `VARCHAR2`, and the text size, including HTML markup, exceeds the 4000-byte limit allowed for `VARCHAR2` columns in SQL statements. Even though the visible text is smaller, the error occurs due to the inclusion of HTML tags and formatting generated by RadEditor.

## Cause

The ORA-01764 error is caused when the data being inserted or updated exceeds the 4000-byte limit set for `VARCHAR2` columns in Oracle. The limit applies to the total size of the content, including HTML tags and formatting, not just the visible text.

## Solution

### Option 1: Use CLOB for Large Text Content

1. Change the database column type from `VARCHAR2` to `CLOB`.
2. CLOB columns can store large text content without the 4000-byte restriction.
3. Modify the SQL statements and data access code to handle CLOB data types.

### Option 2: Restrict Content Size in RadEditor

1. Set the `MaxHtmlLength` property in RadEditor to 4000 or less to prevent exceeding the database limit.

```asp.net
<telerik:RadEditor ID="RadEditor1" runat="server" MaxHtmlLength="4000" />
```

2. Note that this limit includes all HTML markup, not just plain text.

### Properties for Limiting Content

- `MaxHtmlLength`: Restricts the total length of the HTML content, including tags.
- `MaxTextLength`: Restricts the plain text length, excluding HTML tags.

These properties enforce size limitations before the data reaches the database.

## See Also

- [RadEditor MaxHtmlLength Property](https://www.telerik.com/products/aspnet-ajax/documentation/controls/editor/managing-content/max-content-length-)
- [Oracle Data Types Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Data-Types.html)