#1 2014-08-05 08:36:27

Ronald
Member
Registered: 2014-08-05
Posts: 1

SynOleDB

Hi,

I'm new to this forum and trying your SnyOleDB components.
I've a question to it: Is it possible to get the origin table and field names of a SQL statement?

With ADO and MS SQLServe you can use the following code

var
  ado : TAdoDataSet;
orgTableName, orgFieldName  : string;
begin

  ...
  ado.SQL.Text := 'SLECT FIELD1 AS MYALIAS FROM TABLE1 AS T1';
  ...
  orgTableName := ado.RecordSet.Fields.Items[0].Properties['BASETABLENAME'].Value;
  orgFieldName := ado.RecordSet.Fields.Items[0].Properties['BASECOLUMNNAME'].Value;
 

Is this possible within SynOleDB?

Ronald

Offline

#2 2014-08-05 10:04:58

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: SynOleDB

AFAIK it is not available.
The low-level column information is read in TOleDBStatement.BindColumns and converted into SynDB's TSQLDBColumnProperty record.
And there is no such information in TSQLDBColumnProperty, since it is an ADO-specific feature.

Sounds like if it is not working on all providers - see https://community.oracle.com/thread/417 … 0&tstart=0 - so you should perhaps better not rely on it...

Offline

Board footer

Powered by FluxBB