LPM: Off-topic: SQL question

David Hempy hempy at ket.org
Thu Jan 13 17:51:20 CST 2000


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.

Time to go work on something else for a while...
-dave


--
David Hempy
Internet Database Administrator
Kentucky Educational Television




More information about the Lexington-pm mailing list