Board index » delphi » varchar (2000) field is truncated to 256 (sqlserver)

varchar (2000) field is truncated to 256 (sqlserver)

Hi

I have a varchar(2000) field, when I executes a select, the
Query.FieldByName('varchar2000Field').AsString truncates the result to 256
in sqlserver (in oracle this doesn't happened)

any suggestion
thanks

Fidel Lagos

 

Re:varchar (2000) field is truncated to 256 (sqlserver)


On Mon, 26 Nov 2001 17:36:07 -0400, "Fidel Lagos"

Quote
<fla...@axisgroup.cl> wrote:
>I have a varchar(2000) field, when I executes a select, the
>Query.FieldByName('varchar2000Field').AsString truncates the result to 256
>in sqlserver (in oracle this doesn't happened)

How do you connect to SQL Server ? If you use BDE / SQL Links or ODBC,
this is a known limitation - you're better off using ADO.

Marc

------------------------------------------------------------------------
Marc Scheuner                                          Software Engineer
Quest Software Canada                       Halifax, Nova Scotia, Canada
Email: marc.scheu...@quest.com                      http://www.quest.com

Re:varchar (2000) field is truncated to 256 (sqlserver)


Thanks

I am accesing SqlServer trought BDE,
what does means "known limitation ",  where can I find more info about this

Fidel

Quote
"Marc Scheuner" <mscheu...@no.spam.for.me.ca> wrote in message

news:d3a50u45trfpje3v2q0avc9ltkgj4camss@4ax.com...
Quote
> On Mon, 26 Nov 2001 17:36:07 -0400, "Fidel Lagos"
> <fla...@axisgroup.cl> wrote:
> >I have a varchar(2000) field, when I executes a select, the
> >Query.FieldByName('varchar2000Field').AsString truncates the result to
256
> >in sqlserver (in oracle this doesn't happened)

> How do you connect to SQL Server ? If you use BDE / SQL Links or ODBC,
> this is a known limitation - you're better off using ADO.

> Marc

> ------------------------------------------------------------------------
> Marc Scheuner                                          Software Engineer
> Quest Software Canada                       Halifax, Nova Scotia, Canada
> Email: marc.scheu...@quest.com                      http://www.quest.com

Re:varchar (2000) field is truncated to 256 (sqlserver)


BDE uses dblib as an API to SQL Server, this was not updated for SQL Server
7 to include support for the new features such as large varchars and uncode,
hence in your case it is truncating to the limit of dblib.

-Euan

Quote
"Fidel Lagos" <fla...@axisgroup.cl> wrote in message

news:3c02b3a5_1@dnews...
Quote
> Thanks

> I am accesing SqlServer trought BDE,
> what does means "known limitation ",  where can I find more info about
this

> Fidel

> "Marc Scheuner" <mscheu...@no.spam.for.me.ca> wrote in message
> news:d3a50u45trfpje3v2q0avc9ltkgj4camss@4ax.com...
> > On Mon, 26 Nov 2001 17:36:07 -0400, "Fidel Lagos"
> > <fla...@axisgroup.cl> wrote:
> > >I have a varchar(2000) field, when I executes a select, the
> > >Query.FieldByName('varchar2000Field').AsString truncates the result to
> 256
> > >in sqlserver (in oracle this doesn't happened)

> > How do you connect to SQL Server ? If you use BDE / SQL Links or ODBC,
> > this is a known limitation - you're better off using ADO.

> > Marc

> > ------------------------------------------------------------------------
> > Marc Scheuner                                          Software Engineer
> > Quest Software Canada                       Halifax, Nova Scotia, Canada
> > Email: marc.scheu...@quest.com                      http://www.quest.com

Re:varchar (2000) field is truncated to 256 (sqlserver)


Thanks

what can I do?, upgrade BDE? any suggestion ?
thanks again

Fidel Lagos

Quote
"Euan Garden" <euan_gar...@spicedham.hotmail.com> wrote in message

news:3c030444$1_2@dnews...
Quote
> BDE uses dblib as an API to SQL Server, this was not updated for SQL
Server
> 7 to include support for the new features such as large varchars and
uncode,
> hence in your case it is truncating to the limit of dblib.

> -Euan

> "Fidel Lagos" <fla...@axisgroup.cl> wrote in message
> news:3c02b3a5_1@dnews...
> > Thanks

> > I am accesing SqlServer trought BDE,
> > what does means "known limitation ",  where can I find more info about
> this

> > Fidel

> > "Marc Scheuner" <mscheu...@no.spam.for.me.ca> wrote in message
> > news:d3a50u45trfpje3v2q0avc9ltkgj4camss@4ax.com...
> > > On Mon, 26 Nov 2001 17:36:07 -0400, "Fidel Lagos"
> > > <fla...@axisgroup.cl> wrote:
> > > >I have a varchar(2000) field, when I executes a select, the
> > > >Query.FieldByName('varchar2000Field').AsString truncates the result
to
> > 256
> > > >in sqlserver (in oracle this doesn't happened)

> > > How do you connect to SQL Server ? If you use BDE / SQL Links or ODBC,
> > > this is a known limitation - you're better off using ADO.

> > > Marc

> ------------------------------------------------------------------------
> > > Marc Scheuner                                          Software
Engineer
> > > Quest Software Canada                       Halifax, Nova Scotia,
Canada
> > > Email: marc.scheu...@quest.com

http://www.quest.com

- Show quoted text -

Quote

Re:varchar (2000) field is truncated to 256 (sqlserver)


Fidel,

   DBLib is/was developed by Microsoft, not Borland, so if you really need
those data types, then you must use ADO.

Good luck,
krf

Quote
Fidel Lagos <fla...@axisgroup.cl> wrote in message

news:3c0384b3$1_2@dnews...
Quote
> Thanks

> what can I do?, upgrade BDE? any suggestion ?
> thanks again

Re:varchar (2000) field is truncated to 256 (sqlserver)


Quote
"Fidel Lagos" <fla...@axisgroup.cl> wrote in message

news:3c0384b3$1_2@dnews...
Quote
> Thanks

> what can I do?, upgrade BDE? any suggestion ?
> thanks again

You can return a varchar(2000) field to your application by converting it on
the server side. Somthing like

SELECT
  MyID,
  MyName,
  CONVERT(text,MyComment) as 'MyComment'
FROM MYTABLE
WHERE MyID = :MyID

The BDE will see the resulting MyComment field as a memo field type.

Same for Updates/Inserts--go through the transport layers as a memo
datatype, and let SQLServer handle the type conversion on its end.

(applies SQLServer 7 using BDE-SQLLinks)

Re:varchar (2000) field is truncated to 256 (sqlserver)


Switch to use ADO, OLE DB or direct ODBC, not ODBC through the BDE.

-Euan

Quote
"Fidel Lagos" <fla...@axisgroup.cl> wrote in message

news:3c0384b3$1_2@dnews...
Quote
> Thanks

> what can I do?, upgrade BDE? any suggestion ?
> thanks again

> Fidel Lagos
> "Euan Garden" <euan_gar...@spicedham.hotmail.com> wrote in message
> news:3c030444$1_2@dnews...
> > BDE uses dblib as an API to SQL Server, this was not updated for SQL
> Server
> > 7 to include support for the new features such as large varchars and
> uncode,
> > hence in your case it is truncating to the limit of dblib.

> > -Euan

> > "Fidel Lagos" <fla...@axisgroup.cl> wrote in message
> > news:3c02b3a5_1@dnews...
> > > Thanks

> > > I am accesing SqlServer trought BDE,
> > > what does means "known limitation ",  where can I find more info about
> > this

> > > Fidel

> > > "Marc Scheuner" <mscheu...@no.spam.for.me.ca> wrote in message
> > > news:d3a50u45trfpje3v2q0avc9ltkgj4camss@4ax.com...
> > > > On Mon, 26 Nov 2001 17:36:07 -0400, "Fidel Lagos"
> > > > <fla...@axisgroup.cl> wrote:
> > > > >I have a varchar(2000) field, when I executes a select, the
> > > > >Query.FieldByName('varchar2000Field').AsString truncates the result
> to
> > > 256
> > > > >in sqlserver (in oracle this doesn't happened)

> > > > How do you connect to SQL Server ? If you use BDE / SQL Links or
ODBC,
> > > > this is a known limitation - you're better off using ADO.

> > > > Marc

> > ------------------------------------------------------------------------
> > > > Marc Scheuner                                          Software
> Engineer
> > > > Quest Software Canada                       Halifax, Nova Scotia,
> Canada
> > > > Email: marc.scheu...@quest.com
> http://www.quest.com

Other Threads