Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Kathiravan, using PHP 5.0 with Informix 11.7x, got 'A blob data type must be supplied within this context' when inserting plain text into a TEXT column, although the same insert worked in OpenAdmin. Alexandre said TEXT inserts need dbload, LOAD or host variables, or FILETOCLOB. Kathiravan wanted a generic way without it; Jonathan Leffler asked for the original question. Unresolved.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Hi All,
I am using PHP 5.0 and Informix 11.7x
I am facing an issue with inserting values into the TEXT/BLOB field of an
INFORMIX TABLE
Whenever I insert values into the TEXT FIELD it fails and produces "A blob
data type must be supplied within this context" error.
At the same time, when i copy and paste the same INSERT statement in the
OPENADMIN tool, it works without failure.
Pls help me rectifying this issue.
Thanks in advance,
Kathiravan Manoharan
Hi.
According to Information Center:
"You can insert data into TEXT columns in the following ways:"
* With the *dbload* or *onload* utilities
* With the LOAD statement (DB--Access)
* From TEXT host variables (ESQL)
But there´s an implicit cast, from text do clob objects. So you´ll have
to use:
* *FILETOCLOB*copies a file intoa CLOB column.
(Of course you´ll have to convert your text field to clob, before
calling it).
You could post your code here, it´s easier to help you if we know
exactly what you´re trying to do, right?
Regards.
Em 02/08/2011 08:58, KATHIRAVAN MANOHARAN escreveu:
> Hi All,
>
> I am using PHP 5.0 and Informix 11.7x
>
> I am facing an issue with inserting values into the TEXT/BLOB field of an
> INFORMIX TABLE
>
> Whenever I insert values into the TEXT FIELD it fails and produces "A blob
> data type must be supplied within this context" error.
>
> At the same time, when i copy and paste the same INSERT statement in the
> OPENADMIN tool, it works without failure.
>
> Pls help me rectifying this issue.
>
> Thanks in advance,
> Kathiravan Manoharan
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Alexandre Marini
Tecnologia da Informação - DBA
msn: alexandre_marini@hotmail.com
SEFAZ-MS / SGI-UGSR / Sistemas IBM-Informix
<Cert-Info-Mgmt_color.jpg>
IBM Certified System Administrator - Informix Dynamic Server V10 / V11 /
V11.70
IBM Information Management Informix Technical Professional v3
Thank you Alexandre for your quick reply.
My Table is:
create table employee( resume text in blobspace1 );
My Query is:
insert into employee(resume)
values('Xxcvvkklfdsajflksdjalkfjlkasjfklsdajfklsdjaklfjsalf=======');or
insert into employee(resume) values('Just a sample text');
My PHP Code is:
$ifxlink = ifx_connect(...);
ifx_query( "insert into employee(resume) values('Just a sample text')",
$ifxlink );
My Error is:
A blob data type must be supplied within this context
My Question is:
Is there anyway I can insert the values normally as I do for other field
types? (i.e. without using FILETOCLOB). I am creating a generic class file for
INSERT, UPDATE, DELETE operations for all INFORMIX tables in my database,
hence I am unable to differentiate the normal field against the text field
within in the code.
Your help will be highly appreciatable.
On Thu, Aug 4, 2011 at 02:57, KATHIRAVAN MANOHARAN <m.kathirav@gmail.com>wrote:
> Can anybody help me out?
>
No - we don't have the original question any more. If you want an answer to
a question, please include at least a precised version of the original
question.
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
--90e6ba614db4302f4e04a9b36821
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.