Title: Message
Nello
 
The design limitation of TDataSet is that 'FieldNames' have to be unique and that 'Origin' is not
fully supported, if the definition of a FieldName is not the fully qualified name then it is not
necesarilly unique in a joined query, hence I don't think this was considered when the
TDataset was conceived, however if you put a TDataset = isam db table then this is fine
 
Neven
 
----- Original Message -----
Sent: Wednesday, October 02, 2002 10:26 AM
Subject: Re: [DUG]: Column Names

Neven (not Nevan :) )
 
I still see it as a design limitation of TDataSet (or more precisely TField) since FieldName doesn't
 
I don't think this has anything to do with TDataset
 
The issue is what the result set column names are when columns
in two joined tables have the same name.
 
For example the following query in Interbase:
 
    select p.pat_id,a.pat_id
    from patient p join patient_alias a on (p.pat_id = a.pat_id)
 
results in 2 columns "PAT_ID" and "PAT_ID1"
 
There's no ambiguity here, but if you want more mnemonic names for
the result columns you need to alias them in your select
 
The "name" of the "field" (column) comes from the underlying
DBMS not from TDataSet
 
(I think this was Kyley's original point)
 
Maybe I am missing YOUR original point <g>
 
 
 
 
a/ include a Table Qualifier or
b/ defer to Origin for Uniqueness (my prefered solution)
 
in fact the whole naming of TField betrays its origin as SQL Tables do not have fields
 
Neven (not Nevan)
 
----- Original Message -----
Sent: Wednesday, October 02, 2002 9:23 AM
Subject: RE: [DUG]: Column Names

Nevan,
 
I wasn't implying that your SQL wasn't normal or correct. I was implying that the resulting renaming of the columns is perfectly normal also and has nothing at all to do with TDataset or Delphi, but the choice of naming on the database server being accessed.
 
I Agree that it would be nice for the server to more appropriately name columns based on origin, but it is hardly a TDataset function unless they chose to incorporate a SQL processor client side to duplicate the server functionality of interpretation.
 
regards
  Kyley
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Neven MacEwan
Sent: Wednesday, 2 October 2002 9:09 a.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Column Names

Kyley
 
No it isn't
 
''Select Store.StoreID, StoreCriteria.StoreID from Store JOIN StoreCriteria on Store.StoreID = StoreCriteria.StoreID"
 
is perfectly valid SQL, It stems more from the TDataSets non SQL heritage, and yes I could alias the column names
but that isn't the point since the column names are unique anyway
 
Neven
----- Original Message -----
Sent: Tuesday, October 01, 2002 5:44 PM
Subject: RE: [DUG]: Column Names

it is a standard SQL thing.
"select Store.StoreID Store_StoreID, StoreCriteria.StoreID Crit_StoreID" naming them yourself might be more useful to you
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Neven MacEwan
Sent: Tuesday, 1 October 2002 1:42 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Column Names

Hi all
 
TADOQuery given a query of "select Store.StoreID, StoreCriteria.StoreID from Store JOIN StoreCriteria on Store.StoreID = StoreCriteria.StoreID"
ie 2 columns with the same 'name' but not will cause a fieldname of 'StoreID' and StoreID_1 is there any way to determine which
is which ie is 'StoreID' Store.StoreID or  StoreCriteria.StoreID (without parsing the SQL) or is this an
problem with TDataSet
 
 Regards Neven
 N.K. MacEwan B.E. E&E
 Ph 649 621 0001
 Fax 649 621 0400
 [EMAIL PROTECTED]

Reply via email to