Page 1 of 1

any Param is varchar(8000) ,why ?

Posted: Thu 24 Sep 2009 14:51
by wiseinfo
UniQuery+DataSetProvider+Remobjects SDK(DataSnap)+ClientDataSet
DataBase:SQL Server 2000

Code: Select all

CREATE TABLE Table1
   ( itembh varchar(20) PRIMARY KEY CLUSTERED , Qty Numeric(12,2)    )

ClientDataSet.CommandText:='Select Itembh,Qty From Table1';

first run profiler.exe monitor,ClinetDataSet append new record,ApplyUpdates,why all param is varchar(8000)?

Code: Select all

exec sp_executesql N'insert into [Table1]
  ([itembh], [Qty])
values
  (@P1, @P2)', N'@P1 varchar(8000),@P2 varchar(8000)', 'aaaa', '1000'
Modify ClientDataSet,ApplyUpdates,why all param is varchar(8000)??

Code: Select all

exec sp_executesql N'update [Table1]  set
 [itembh] = @P1,
 [Qty] = @P2
where
 [itembh] = @P3 and
 [Qty] = @P4', N'@P1 varchar(8000),@P2 varchar(8000),@P3 varchar(8000),@P4 varchar(8000)', 'bbbb', '50', 'aaaa', '1000'
If you are using DBX's SQLDataSet+DataSetProvider+Remobjects SDK(DataSnap)+ClientDataSet,not the problem.
If UniQuery + DataSetProvider + ClientDataSet in the same Form, no problem.

if UniQuery+DataSetProvider+Remobjects SDK(DataSnap)+ClientDataSet,There should be a UniDac than UniQuery simpler UniDataSet, similar to the DBX's SQLDataSet

sorry,my english is very very poor,

Posted: Fri 25 Sep 2009 08:10
by Dimon
I could not reproduce the problem.
Please, try to compose a small sample to demonstrate the problem and send it to dmitryg*devart*com.

Posted: Fri 25 Sep 2009 13:05
by wiseinfo
Dimon wrote:I could not reproduce the problem.
Please, try to compose a small sample to demonstrate the problem and send it to dmitryg*devart*com.
Thank,I have repeatedly tested,wasted a lot of time,and finally find the reason.

You can test ,UniQuery + DataSetProvider + ClientDataSet in the same Form, There are also problems

if UniConnection OLEDBProvide use prNativeClient when ClientDataSet. ApplyUpdates all param is varchar(8000)

if UniConnection OLEDBProvide use prSQL is ok,no problems!!


Fortunately, I now unnecessary use of SQL Native Client.

In addition, I hope that all of the Param use the correct data type, not all varchar

My Microsoft SQL Server Native Client version is 10.0(2007.100.1442.0032)

sorry,sorry,sorry,my english is very very poor,

Posted: Mon 28 Sep 2009 08:36
by Dimon
I can reproduce this behaviuor only for varchar fields. In my case only varchar parameters are determined by SQL Profiler as varchar(8000). The Numeric field is determined as a float type.
This behaviour is correct and connected with the SQL Native Provider specificity, but not with SDAC. The length of really transmitted data is correct in any case.

Posted: Mon 28 Sep 2009 10:30
by wiseinfo
in Delphi 2010 i use DBX and ADO test SQL SQL Native, as you said, all varchar field param is varchar(8000),

I finally understand, thank you,