[fpc-pascal] Re: SQLDB GetSchemaInfoSQL for indexes etc?

LacaK lacak at zoznam.sk
Thu Apr 19 13:28:07 CEST 2012


Reinier Olislagers  wrote / napĂ­sal(a):
> On 18-4-2012 8:27, LacaK wrote:
>   
>>> I don't have Delphi with dbExpress here, so can't test.
>>>   
>>>       
>> I did some tests in Delphi XE with DBExpress and MySQL:
>>
>> for stTables column names are: CatalogName, SchemaName, TableName,
>> TableType ('TABLE')
>>     
> So difference with FPC: the names (catalog_name, schema_name,
> table_name, table_type). The FPC names seem to match the ISO SQL*) names
> more (ISO has them capitalized, no problem if no quotes are used).
> In contrast to dbExpress (and probably the standard), FPC also has recno
> (internal database object ID? Could be very handy.)
> Other difference: TableType ('TABLE'): I think Delphi+dbExpress better
> match ISO SQL*) here (though 'BASE TABLE', 'VIEW') instead of the 0 that
> FPC returns - at least in the Firebird, PostgreSQL connectors that I
> checked.
>
> *) at least an SQL2008 draft version I found some time ago...
> The PostgreSQL documentation is also very nice:
> http://www.postgresql.org/docs/current/static/information-schema.html
> As is the Mimer (link to old documentation; newer is inside a frame):
> http://developer.mimer.com/documentation/html_91/Mimer_SQL_Engine_DocSet/Data_dic_views2.html
>
> I'd prefer changing TABLE_TYPE to the ISO way of doing things, but of
> course it could break existing applications if any of them use this
> functionality... Still, FPC always returns 0 so I suppose it would have
> been useless anyway, so no harm in changing it.
>
>   
Thinking about column names I would suggest, change it according to 
SQL-Standard (information_schema views). To be fully compatible.
(because ATM we are not compatible with SQL-Standard NOR Delphi)
Advantage will be, that we will be able do for example 'select * from 
INFORMATION_SCHEMA.TABLES'
so if some DB provides also other columns (additional information on 
tables, procedures, indexes, columns etc.) we will get it.
It will of course lead to breaking backward compatibility, but I think, 
that there is very, very (if any) small amount of users, which use 
setschemainfo+open to get metadata information.

L.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120419/bc6d6e9b/attachment.html>


More information about the fpc-pascal mailing list