Re: Error -280...Help!!!
Posted in 1996
>From: Anders Welen <anders.welen@lks.covd.se>
>Date: Fri, 13 Sep 1996 10:20:08 +0100
>X-Informix-List-Id: <news.28025>
>
>I'm running SE 5.01 for SCO under Linux ;)
>
>I have a char(600) field that I'm trying to perform
>INSERT and UPDATE on but I'm getting error -280.
>(I've tried both isql and ESQL/C)
>
>How do I solve this STUPID limitation about 256
>characters of Informix.
The limitation is on character literal strings, not on string variables.
ISQL Perform should be OK -- it uses dynamically allocated variables in
its work. But using the ISQL Query Language option you'd type:
UPDATE SomeTable SET Char600Field = '...more than 256 characters...'
and this will fail (in all languages) because the literal is too long.
In ESQL/C, though, you could do:
EXEC SQL BEGIN DECLARE SECTION;
char *newval;
EXEC SQL END DECLARE SECTION;
newval = "...more than 256 characters...";
EXEC SQL UPDATE SomeTable SET Char600Field = :newval;
and you will not get the error.
>If anyone out there knows why this limitation exists,
>please feel free to explain it to me!!!
Once upon a long time ago, the world was a smaller place, and 256
character strings broke editors and things. Fortunately, the world
has grown up since then and this is now a nuisance. The reason is
one of the oldest in the software game -- historical. That doesn't
make it good.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
PS: I just tried the following code (there are 600 X's in a row) on
7.20.UC1 and got the errors:
esqlc: "kk.ec", line 6: Error -33020: Line is too long.
esqlc: "kk.ec", line 6: Error -33017: Incomplete statement.
2 error(s) found
cat kk.ec
main()
{
$DATABASE APT;
$CREATE TEMP TABLE X (Y CHAR(600));
$INSERT INTO X VALUES('A');
$UPDATE X SET Y =
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
printf("%d\\n", sqlca.sqlcode);
exit(0);
}