Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6819499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:18:49+00:00 2026-05-26T21:18:49+00:00

I have an application that is saving clob data into database. Suppose when I

  • 0

I have an application that is saving clob data into database.
Suppose when I put some text into textbox and then click save.
It will call a procedure that will insert this text (clob) into database table.

Suppose I have the following text:

Hi i am gaurav’s soni’s

Now my procedure take this clob data as:

insert into rtf_clob(1,'Hi i am gaurav's soni's');

This however throws an error.

How to handle this single quote in dynamic data coming from front end?
I’m using oracle as RDBMS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:18:50+00:00Added an answer on May 26, 2026 at 9:18 pm

    You should not be writing code to escape the string. The fact that you need to escape the string implies that you are doing something wrong.

    If you are using bind variables in your INSERT statement, there will be no need to escape the string when there is a stray single quote. There will also be no need to try to identify SQL injection attacks in the string which is a huge security issue if you’re not using bind variables. And you won’t be forcing Oracle to parse the query every time it is executed which is critical to system performance.

    If the procedure you’re talking about is written in PL/SQL, it will use bind variables automatically. Guessing at the column names and assuming that you’re using a sequence to generate your primary key, you’d have something like this

    CREATE PROCEDURE insert_rtf_clob( p_clob IN NOCOPY CLOB )
    AS
    BEGIN
      INSERT INTO rtf_clob( rtf_clob_id, rtf_clob_value )
        VALUES( seq_rtf_clob_id.nextval, p_clob );
    END;
    

    Other front-end languages will have different approaches to using bind variables. If you’re writing Java using JDBC, for example, you’d create a PreparedStatement and then then call appropriate setXXX methods, i.e.

    PreparedStatement stmt = conn.prepareStatement( "INSERT INTO rtf_clob VALUES( ?, ? )" );
    stmt.setInt( 1, 1 ); // Set column 1 to a value of 1
    stmt.setString( 2, someStringVariable ); // Set column 2 to someStringVariable
    stmt.executeUpdate();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone application that uses a sqlite3 database for saving data and
I have a C++ application that loads lots of data from a database, then
I have an application that extracts data from some xml that is stored in
I have application that brings response via Ajax and creates 5-20 new jQuery click
I have an application that reads a CSV file with piles of data rows.
I have developed a web application that uses a web server and database hosted
I'm having a stump with some PHP... I have a Flash Application that sends
I have a single Activity application with a data container that is populated at
I have an ASP.NET MVC application that uses LINQ2SQL as the database layer. I
I have a simple MVC3 application that I want to retrieve some configuration details

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.