Page 1 of 1

TMSSQL and large geometry as param

Posted: Tue 02 Aug 2011 06:32
by Aufhauser
Sorry, once again my problems with very large geometries.
In the latest versions of SDAC TMSQuery works fine with large geometries, but not TMSSQL.
Whith large geometries (more than 16 KB)

TMSQuery.FieldByName('GEOMETRY).AsBytes:= LargeGeometry
works but
TMSSQL.ParamByName('GEOMETRY').AsBytes:= LargeGeometry
raises an error.
Is this the same bug, which was previous in component TMSQuery?

Stefan

Posted: Wed 03 Aug 2011 07:26
by AndreyZ
Hello,

I cannot reproduce the problem. Please try creating a small sample to demonstrate the problem and send it to andreyz*devart*com, including a script to create a table.

Posted: Thu 04 Aug 2011 12:52
by Aufhauser
Sorry, my describtion was too short.

this code works:
MSQuery.Edit;
MSQuery.FieldByName('GEOMETRY).AsBytes:= LargeGeometry;
MSQuery.Post;

same using TMSSQL does not work:

MSSQL.ParamByName('GEOMETRY').DataType:= ftVarBytes;
MSSQL.Prepare;
MSSQL.ParamByName('GEOMETRY').AsBytes:= LargeGeometry;
MSSQL.Execute;

I get the SQLServer exception "unexpected end of file".
SDAC cuts of data which length is more then xxx bytes. For me it is the same bug, which was in SDAC (MSQuery) described in blog "Native Client and large Geometry"

Posted: Fri 05 Aug 2011 06:54
by AndreyZ
Thank you for the information. We have fixed this problem. This fix will be included in the next SDAC build. As a workaround, you can use the following code:

Code: Select all

MSSQL.DescribeParams := True;
MSSQL.Prepare; 
MSSQL.ParamByName('GEOMETRY').AsBytes := LargeGeometry; 
MSSQL.Execute;

Posted: Mon 08 Aug 2011 09:02
by Aufhauser
Thank you for information, the program works. You should add description of "DescribeParams" to SDAC help.
Stefan

Posted: Mon 08 Aug 2011 12:32
by AndreyZ
We will add a description of the DescribeParams property to the SDAC documentation.