🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: netscape.dev.livewire.programming
Article #1

Re: A 'Problem' with strings...

#1
From: David Hall
Date: Wed, 06 Dec 2000 00:00
38 lines
2173 bytes
Informix only allows 256 chars at a time to be inserted into a 'char' or
'varchar' data type; you must break up the string into chunks before
inserting, and subscript the column name, like: infx-col[1,256] =
substr.js-var(0,255) -- check the syntax and do it in a loop.  also for
strings that big you should use the 'text' data type but that is even more
of a pain to work with.  else you could use a separate table to store this
data, and just store each (30K char) note/text field as separate informix
records at say 80 chars each.

at the very least use varchar so the string is not filled with spaces at
the end, but you will still get an error for a string > 256 chars.

david hall

Markku Lahti wrote:

> Hi all
>
> Does anybody know an easy way to handle empty spaces at the end of a
> string.
>
> I know trim-function, but it only handles strings up to 255 characters.
>
> I have a database table field(char) which may contain up to 30000
> characters.
> When I save there a 200 character string, the rest of the field is
> filled with 29800 empty spaces...
>
> So, am I doing something wrong...
>
> If not - what is the easiest way to get rid of those empty spaces ???
>
> Thanks in advance !
>
> I'm using Netscape SuiteSpot 3.0 on UNIX (HPUX-10.20)
> Database is  Informix.
>
> Markku ;-)
Technical Details
Message-ID: <3A2E4A42.CD8D7E87@mindspring.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-netscape.dev.livewire.programming.mbox.zip!not-for-mail
References: <3A2CC45E.9F5913A1@spammia.kiitos.ei.nokia.com>

Show Full Headers
Complete Article Headers
Message-ID: <3A2E4A42.CD8D7E87@mindspring.com>
Subject: Re: A 'Problem' with strings...
Date: Wed, 06 Dec 2000 00:00:00 +0000
From: David Hall <davidhall@mindspring.com>
References: <3A2CC45E.9F5913A1@spammia.kiitos.ei.nokia.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-netscape.dev.livewire.programming.mbox.zip!not-for-mail
X-Deja-AN: 701767104
Content-Transfer-Encoding: 7bit
To: Markku Lahti <markku.o.lahti@spammia.kiitos.ei.nokia.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Reply-To: davidhall@mindspring.com
Newsgroups: netscape.dev.livewire.programming