Board index » delphi » Oracle Varchar2 Field > 255 chars in Delphi

Oracle Varchar2 Field > 255 chars in Delphi

I am new to Delphi and cannot find a way to convert an Oracle VarChar2
field with a length of  400 into a  Delphi string.

Does anybody know how this can be done?

Any help would be much appreciated

Kieron

 

Re:Oracle Varchar2 Field > 255 chars in Delphi


Kieron,

I have asked the same question myself (see my thread 'Oracle
VARCHAR2 fields', Feb. 8, 1996).  I too have a need to do the
same thing.  Currently I have had to use a datasource linked
to the TQuery, and a TDBMemo object linked to the datasource.  
I do not need, or want the overhead of the datasource and
TDBMemo object, but have had to use them anyway.  I do not
display the TDBMemo object, just extract the text from it.

If you learn of a better way, let me know too!

-Craig

Re:Oracle Varchar2 Field > 255 chars in Delphi


On 13 Feb 96 16:06:19 GMT, Craig Coles <cco...@Novell.COM> wrote:

Quote
>I have asked the same question myself (see my thread 'Oracle
>VARCHAR2 fields', Feb. 8, 1996).  I too have a need to do the
>same thing.  Currently I have had to use a datasource linked
>to the TQuery, and a TDBMemo object linked to the datasource.  
>I do not need, or want the overhead of the datasource and
>TDBMemo object, but have had to use them anyway.  I do not
>display the TDBMemo object, just extract the text from it.

You do not need a TDataSource and a TDBMemo to access the contents of a
VARCHAR column with a length in excess of 255 characters.

The maximum length of a Pascal String is 255 characters, and so be
extension is the length for a value in a TStringField component. If the
column is defined longer than that 255 characters, the BDE and Delphi will
interpret the field as a TMemoField component. This would allow you to read
data from and write data to this column by means of a TBlobStream object.

True, the memory buffer for the TBlobStream object has to be of type PChar
(or equivalent), but then because of the possible length of the data in the
column, you would not be able to store it in a String type container
anyway.

**************************************************************************
Steve Koterski                  "Results! Why, man, I have gotten a lot of
Product Group Manager           results. I know several thousand things
Delphi Technical Support        that won't work."
Borland International, Inc.                    -- Thomas Edison, 1847-1931

Other Threads