--- ODBC.pm Thu Mar 9 03:35:36 2000 +++ ODBC.pm.new Tue Mar 14 09:03:42 2000 @@ -205,6 +205,18 @@ $sth; } + # Call the ODBC function SQLSpecialColumns + # Args are: + # See the ODBC documentation for more information about this call. + # + sub GetSpecialColumns { + my ($dbh, $Identifier, $Catalog, $Schema, $Table, $Scope, $Nullable) = @_; + # create a "blank" statement handle + my $sth = DBI::_new_sth($dbh, { 'Statement' => "SQLSpecialColumns" }); + _GetSpecialColumns($dbh, $sth, $Identifier, $Catalog, $Schema, $Table, $Scope, $Nullable) or return undef; + $sth; + } + sub GetTypeInfo { my ($dbh, $sqltype) = @_; # create a "blank" statement handle @@ -267,6 +279,10 @@ =over 4 +=item B + +Added support for SQLSpecialColumns. + =item B Examined patch for ping method to repair problem reported by Chris Bezil. Thanks Chris! @@ -508,13 +524,16 @@ =item SQLDataSources All handled, currently (as of 0.21) - + +=item SQLSpecialColumns + +handled as of 0.28 + =item Others/todo? Level 1 SQLColumns - SQLSpecialColumns SQLTables (use tables()) call Level 2 --- ODBC.xs Mon Mar 6 03:18:40 2000 +++ ODBC.xs.new Tue Mar 14 09:04:07 2000 @@ -110,6 +110,19 @@ ST(0) = odbc_get_primary_keys(dbh, sth, CatalogName, SchemaName, TableName) ? &sv_yes : &sv_no; void +_GetSpecialColumns(dbh, sth, Identifier, CatalogName, SchemaName, TableName, Scope, Nullable) + SV * dbh + SV * sth + int Identifier + char * CatalogName + char * SchemaName + char * TableName + int Scope + int Nullable + CODE: + ST(0) = odbc_get_special_columns(dbh, sth, Identifier, CatalogName, SchemaName, TableName, Scope, Nullable) ? &sv_yes : &sv_no; + +void _GetForeignKeys(dbh, sth, PK_CatalogName, PK_SchemaName, PK_TableName, FK_CatalogName, FK_SchemaName, FK_TableName) SV * dbh SV * sth --- dbdimp.c Mon Mar 6 03:18:40 2000 +++ dbdimp.c.new Tue Mar 14 09:04:25 2000 @@ -2049,6 +2049,44 @@ } int + odbc_get_special_columns(dbh, sth, Identifier, CatalogName, SchemaName, TableName, Scope, Nullable) + SV * dbh; +SV * sth; +int Identifier; +char * CatalogName; +char * SchemaName; +char * TableName; +int Scope; +int Nullable; +{ + dTHR; + D_imp_dbh(dbh); + D_imp_sth(sth); + RETCODE rc; + + imp_sth->henv = imp_dbh->henv; /* needed for dbd_error */ + imp_sth->hdbc = imp_dbh->hdbc; + + imp_sth->done_desc = 0; + rc = SQLAllocStmt(imp_dbh->hdbc, &imp_sth->hstmt); + if (rc != SQL_SUCCESS) { + dbd_error(sth, rc, "odbc_get_special_columns/SQLAllocStmt"); + return 0; + } + + rc = SQLSpecialColumns(imp_sth->hstmt, + Identifier, CatalogName, strlen(CatalogName), + SchemaName, strlen(SchemaName), + TableName, strlen(TableName), + Scope, Nullable); + if (!SQL_ok(rc)) { + dbd_error(sth, rc, "odbc_get_special_columns/SQLSpecialClumns"); + return 0; + } + return build_results(sth); +} + +int odbc_get_foreign_keys(dbh, sth, PK_CatalogName, PK_SchemaName, PK_TableName, FK_CatalogName, FK_SchemaName, FK_TableName) SV * dbh; SV * sth;