Sorry to ask this but I am trying to understand the difference
in Varchar and Long varchar's.
We need to store text that can range in length from 2 sentences to 10 pages
and I am trying to decide on what is the best data type.
So, I created 3 databases and inserted 10 rows with only the letter A
in a varchar column in one database, same thing in a db with a
Long varchar and another db varchar (30000) to see how much space it took.
All 3 databases were the same size I thought one was fixed length no matter
hot much data was in the column?
thanks Marc
CREATE SCHEMA AUTHOR ccc
CREATE TABLE `Fhelp` +
(`TablName` TEXT (30) , +
`FrmName` TEXT (30) , +
`FldName` TEXT (30) , +
`FldHelp` VARCHAR (30000) , + --(or Long Varchar or just Varchar with out
the (30000) )
`PerHelp` NOTE , +
`FldDescript` TEXT (30) )
----- Original Message -----
From: "A. Razzak Memon" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, January 15, 2008 10:38 AM
Subject: [RBASE-L] - Re: Data Types and File Gateway
At 03:48 AM 1/15/2008, Alastair Burr wrote:
My questions are firstly, does the use LONG VARCHAR have any effect on
the size or performance of the database compared to a (short) VARCHAR?
Alastair,
AFAIK, there is no effect on the performance of the database. However,
the size of .RB4 file will vary accordingly.
And, secondly, am I right in thinking that I can convert this column to
VARCHAR simply by removing the word LONG and adding the required length
in brackets to my unload file (and reload it)?
Correct!
Similar to the examples below:
-- Example 01
SET ERROR MESSAGE 2038 OFF
DROP TABLE InvestigationNotes
CREATE TABLE `InvestigationNotes` +
(`CID` INTEGER, `CNotes` LONG VARCHAR)
SET ERROR MESSAGE 2038 ON
RETURN
-- Example 02 based on example 01 above
ALTER TABLE `InvestigationNotes` +
ALTER `CNotes` VARCHAR (8000)
RETURN
-- Example 03:
SET ERROR MESSAGE 2038 OFF
DROP TABLE BriefNotes
CREATE TABLE `BriefNotes` +
(`CID` INTEGER, `BNotes` VARCHAR (7000))
SET ERROR MESSAGE 2038 ON
RETURN
Hope that explains!
Very Best R:egards,
Razzak.