mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 21:11:23 +02:00
* Implemented GetTableNames, systemtables=true, bug #13893, by Ladislav Karrach
git-svn-id: trunk@15498 -
This commit is contained in:
parent
35bacb55b5
commit
c58e26e25a
@ -646,6 +646,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TODBCConnection.Execute(cursor: TSQLCursor; ATransaction: TSQLTransaction; AParams: TParams);
|
||||
const
|
||||
TABLE_TYPE_USER='TABLE,VIEW,GLOBAL TEMPORARY,LOCAL TEMPORARY'; //no spaces before/after comma
|
||||
TABLE_TYPE_SYSTEM='SYSTEM TABLE';
|
||||
var
|
||||
ODBCCursor:TODBCCursor;
|
||||
Res:SQLRETURN;
|
||||
@ -658,7 +661,8 @@ begin
|
||||
// execute the statement
|
||||
case ODBCCursor.FSchemaType of
|
||||
stNoSchema : Res:=SQLExecute(ODBCCursor.FSTMTHandle); //SQL_NO_DATA returns searched update or delete statement that does not affect any rows
|
||||
stTables : Res:=SQLTables (ODBCCursor.FSTMTHandle, nil, 0, nil, 0, nil, 0, nil, 0 );
|
||||
stTables : Res:=SQLTables (ODBCCursor.FSTMTHandle, nil, 0, nil, 0, nil, 0, TABLE_TYPE_USER, length(TABLE_TYPE_USER) );
|
||||
stSysTables : Res:=SQLTables (ODBCCursor.FSTMTHandle, nil, 0, nil, 0, nil, 0, TABLE_TYPE_SYSTEM, length(TABLE_TYPE_SYSTEM) );
|
||||
stColumns : Res:=SQLColumns(ODBCCursor.FSTMTHandle, nil, 0, nil, 0, @ODBCCursor.FQuery[1], length(ODBCCursor.FQuery), nil, 0 );
|
||||
stProcedures: Res:=SQLProcedures(ODBCCursor.FSTMTHandle, nil, 0, nil, 0, nil, 0 );
|
||||
else Res:=SQL_NO_DATA;
|
||||
@ -1302,7 +1306,7 @@ begin
|
||||
Result := SchemaObjectName
|
||||
else
|
||||
Result := ' ';
|
||||
if not (SchemaType in [stNoSchema, stTables, stColumns, stProcedures]) then
|
||||
if not (SchemaType in [stNoSchema, stTables, stSysTables, stColumns, stProcedures]) then
|
||||
DatabaseError(SMetadataUnavailable);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user