A blob data type must be supplied within this cont
Posted in 2011
Topics: Data Types & Schema Design, Third-Party Tools & Monitoring
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.
Can anybody help me out?
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