LPM: Off-topic: SQL question

John Soward soward at uky.edu
Fri Jan 14 12:17:53 CST 2000

David Hempy wrote:
> Okay, this has nothing to do with perl, but you guys are just so darned
> helpful...
> In my Visual FoxPro (VFP) table, I've got a field of type memo.  A memo
> field is an unlimited length character field.  I regularly store several
> kilobytes of data in each field from VFP.
> I have been unable to store more than 255 bytes from perl, via Win32::ODBC.
>  I'm quite certain the problem is from VFP's ODBC driver, not in perl nor
> the ODBC module.  This is the error I get:
> [219] [1] "[Microsoft][ODBC Visual FoxPro Driver]Command contains
> unrecognized phrase/keyword." at d:/edit-www/cgi-ket/scout.pl line 587.
> For the command:
>         $cmd = qq {update release set  rtf_bytes=$rtf_bytes, headline=
> '$headline', html_body='$html_body'   where releaseid='$releaseid' };
> This happens when $html_body has 256 characters, but not if it has 255 or
> less.  Also of note, it gives the same error if there are any \n in the
> string, even for short strings.  I've tried escaping them in different
> ways, but can ignore that problem in this case by (gasp) removing all \n in
> the string.
> I've tackled a two ten-pound SQL books looking for a way to specify the max
> length of a field, info on varchar fields, or documentation of a max string
> length, but I haven't found anything yet.  If anyone has a quick answer,
> I'm all ears.

AFAIK, char fields are limited to 255, with, say, MySQL I would specify
the field type as 'text' instead. But I don't know anything about FoxPro
or it's ODBC driver...

John Soward     
Lead Systems Programmer, Technical Services, University of Kentucky    
p: 606.257.2900x298  e:soward at uky.edu  w: http://neworder.cc.uky.edu/

More information about the Lexington-pm mailing list