Skip to Content
0

Bug report - Different field length and decimals- ADS 11.1

Dec 05, 2016 at 10:36 AM

77

avatar image
Former Member

I have a simple FoxPro (ttAdsCDX) table, created by ARC32's Native SQL window in a free connection (local or remote doesn't matter):

Create table Test (code numeric(4, 0), codedesc char(50));  -- creates test.dbf

Opening the table via File->Open Table, and then clicking the CODE column heading says that the column is Data Type Numeric, Column Size 4, Precision 0. So far so good.

A quick SELECT in the Native SQL window:

SELECT * FROM Test

and then clicking the CODE column heading indicates that the column is Data Type Numeric, Column Size 5, Precision 0. Oops!

A quick test app in Delphi 2007 to see what's happening...

- Drop a TAdsConnection, TAdsQuery and TAdsTable on a new form containing nothing but a TMemo.

- Set the connection to point to the proper path for the table above.

- Set the AdsConnection property for both the table and query to the connection above (ADSConnection1) .

- Set the AdsTable1.TableType to ttAdsCDX and TableName to 'Test.DBF'.

- Set the AdsQuery1.SourceTableType to ttAdsCDX, and the SQL to

   SELECT * FROM Test

- Add Ace to the uses clause (interface or implementation, doesn't matter).

- Add the following code to the FormCreate event

procedure TForm2.FormCreate(Sender: TObject);
var
  uDecimals, uFieldSize: UNSIGNED32;
begin
  Memo1.Clear;
  AdsTable1.Open;
  AdsQuery1.Open;

  uDecimals := 0; uFieldSize := 0;
  AdsGetFieldDecimals(AdsTable1.Handle, PAceChar('CODE'), @uDecimals);
  AdsGetFieldLength(AdsTable1.Handle, PAceChar('CODE'), @uFieldSize);
  Memo1.Lines.Add(Format('Table: %d size, %d decimals', [uFieldSize, uDecimals]));

  uDecimals := 0; uFieldSize := 0;
  AdsGetFieldDecimals(AdsQuery1.Handle, PAceChar('CODE'), @uDecimals);
  AdsGetFieldLength(AdsQuery1.Handle, PAceChar('CODE'), @uFieldSize);
  Memo1.Lines.Add(Format('Query: %d size, %d decimals', [uFieldSize, uDecimals]));
end;

- Run the app and examine the contents of the memo control.

10 |10000 characters needed characters left characters exceeded

I tested this with ADS 11.10.0.24 and 12.0.0.0 (ARC 11.10.0.24) and I do not see the behavior you report.

Regards,

Mike Loop
Senior Support Engineer
SAP Product Support

capture.png (44.2 kB)
0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Hakan Haslaman
Dec 05, 2016 at 10:39 AM
0

Please let me know, which exact ADS version with extension you are using, so the engineering can check this report for validation.

Share
10 |10000 characters needed characters left characters exceeded