Re: Inserting NULL values into a column of type TEXT?
Posted in 1996
Topics: Data Types & Schema Design
Jason Bodnar wrote:
>
> I'm trying to insert a NULL value into a column of type TEXT but am
> getting the following error:
> > 617: A blob data type must be supplied within this context.
> Error in line 1 > Near character position 528
>
> Here's the INSERT statement (trimmed for brevity): >
> INSERT INTO current (title, review, photos, ...) VALUES ('Twister',\\ > 'may96/twister/twister.htm', NULL, ...);
>
> I also tried: >
> INSERT INTO current (title, review, photos, ...) VALUES ('Twister',\\ > 'may96/twister/twister.htm', '', ...);
>
> Obviously, I can insert text into a column of type TEXT (the
> preceeding colum 'review' is of type text), but how can I insert a
> NULL value or an empty string?
I hate to point out the obvious, but why not INSERT nothing? Ie. ommit
the field 'photos' from the INSERT statement:
INSERT INTO current (title, review, ...) VALUES ('Twister',\\
'may96/twister/twister.htm', ...);
Hope that helps,
--
Mark.
+-------------------------------------------------------------------------+
|Mark D. Stock - The West Solutions Group http://www.west.co.za |
| The Informix FAQ is at http://www.iiug.org |
|mailto:marks@west.co.za +------------------------------------------------+
|Tel: +27 11 803 2151 |If it doesn't work... force it! |
|Fax: +27 11 803 2189 |If it breaks... it needed replacing anyway! |
|Cell: +27 83 250 2325 |Well, that's how I code anyway! |
+------------------------+------------------------------------------------+