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

  • SEARCH
  • Home
  • 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 4255686
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:15:08+00:00 2026-05-21T05:15:08+00:00

I maintain a legacy application that runs on PHP/5.2.6 under Windows Server 2003 and

  • 0

I maintain a legacy application that runs on PHP/5.2.6 under Windows Server 2003 and connects to a remote Oracle 10g server through ODBC. I’m writing a new feature that needs a CLOB column so it can store arbitrarily large texts but I can’t find the way to manipulate it via good old ODBC functions.

For writing, I’ve tried this approach:

<?php

$sql = 'INSERT INTO FOO (FOO_ID, FOO_CLOB) VALUES (?, ?)';
$stmt = odbc_prepare($conn, $sql);
$res = odbc_execute($stmt, array(1, 'Very large string'));

?>

But as soon as the string is larger than 4,000 bytes:

SQL error: [Microsoft][ODBC driver for
Oracle]Error en el parámetro 2: Datos
truncados, SQL state 01004 in
SQLExecute

… which roughly means “Truncated data”. I have a similar problem when reading: it works fine until I receive more than 4,000 bytes.

Is it possible to manipulate a CLOB column with more than 4,000 bytes using PHP ODBC functions?

(My alternative is to store stuff in files and only save the file path on DB but I’d like to avoid that if possible.)


Update: Following Justin Cave’s advice, I’ve dumped Microsoft’s ODBC Driver in favour of Oracle’s and my code inserts large strings without changes. My question now is how to read the CLOB column. Reading it as-is:

$sql = 'SELECT FOO_ID, FOO_CLOB FROM FOO';
$res = odbc_exec($conn, $sql);
while($row = odbc_fetch_array($res)){
    // ...
}

… triggers this when running odbc_fetch_array():

ORA-01861: literal does not match
format string

  • 1 1 Answer
  • 1 View
  • 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-21T05:15:09+00:00Added an answer on May 21, 2026 at 5:15 am

    Do you have to use the Microsoft ODBC Driver for Oracle? That driver does not support the CLOB data type among various other issues. If you use the Oracle ODBC driver instead, the driver will support CLOBs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I maintain a legacy ASP.Net Web application (using .Net 2.0 + SQL Server 2005
I maintain a PHP driven application with Oracle backend (OCI8 functions). The app is
I maintain a legacy Java application that uses Jacob , or Java-COM Bridge, to
Complete Oracle n00b here. I have to maintain a legacy form that was developed
I am working on updating a legacy application that is absolutely rife with Singleton
I have a legacy class that is rather complex to maintain: class OldClass {
I have a legacy application to maintain. Currently, releases are built from one particular
I maintain an application that sends me an email when an error occurs in
I maintain a VB6 application that stores its data (access files) in a subfolder
I maintain a legacy ASP.NET custom control component that implements a menu using CSS

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.