Commit 8eb8de34 authored by bgermann's avatar bgermann

Initial cygport version

[CYGPORT]
* NEW: Initial cygport version
parents
Index: gb.db.odbc/src/main.c
===================================================================
--- gb.db.odbc/src/main.c (revision 7930)
+++ gb.db.odbc/src/main.c (working copy)
@@ -54,6 +54,11 @@
#undef HAVE_UNISTD_H
#endif
+// columns in SQLColumns() RESULT SET
+#define SQLColumns_ColumnName 4
+#define SQLColumns_ColumnSize 7
+#define SQLColumns_SQL_DataType 14
+
#include "gb.db.proto.h"
#include "main.h"
@@ -1786,12 +1791,12 @@
colsNum = 0;
while (SQL_SUCCEEDED(SQLFetch(statHandle)))
{
- SQLGetData(statHandle, SQLColumns_COLUMN_NAME, SQL_C_CHAR, current->fieldname,
+ SQLGetData(statHandle, SQLColumns_ColumnName, SQL_C_CHAR, current->fieldname,
sizeof(current->fieldname), 0);
if (!SQL_SUCCEEDED
(SQLGetData
- (statHandle, SQLColumns_SQL_DATA_TYPE, SQL_C_CHAR, &coltype[0],
+ (statHandle, SQLColumns_SQL_DataType, SQL_C_CHAR, &coltype[0],
sizeof(coltype), 0)))
return TRUE;
@@ -1799,7 +1804,7 @@
if (!SQL_SUCCEEDED
(SQLGetData
- (statHandle, SQLColumns_COLUMN_SIZE, SQL_C_CHAR, precision,
+ (statHandle, SQLColumns_ColumnSize, SQL_C_CHAR, precision,
sizeof(precision), 0)))
return TRUE;
@@ -1904,7 +1909,7 @@
while (SQL_SUCCEEDED(SQLFetch(statHandle2)))
{
- if (!SQL_SUCCEEDED(SQLGetData (statHandle2, SQLColumns_COLUMN_NAME, SQL_C_CHAR, current->fieldname, sizeof(current->fieldname), 0)))
+ if (!SQL_SUCCEEDED(SQLGetData (statHandle2, SQLColumns_ColumnName, SQL_C_CHAR, current->fieldname, sizeof(current->fieldname), 0)))
strcpy((char *)current->fieldname, "Unknown");
colsNum = colsNum + 1;
@@ -2076,11 +2081,11 @@
return FALSE; //nReturn;
}
- SQLBindCol(statHandle, SQLTables_TABLE_NAME, SQL_C_CHAR, szTableName,
+ SQLBindCol(statHandle, 3, SQL_C_CHAR, szTableName,
sizeof(szTableName), &nIndicatorName);
- SQLBindCol(statHandle, SQLTables_TABLE_TYPE, SQL_C_CHAR, szTableType,
+ SQLBindCol(statHandle, 4, SQL_C_CHAR, szTableType,
sizeof(szTableType), &nIndicatorType);
- SQLBindCol(statHandle, SQLTables_REMARKS, SQL_C_CHAR, szTableRemarks,
+ SQLBindCol(statHandle, 5, SQL_C_CHAR, szTableRemarks,
sizeof(szTableRemarks), &nIndicatorRemarks);
// GET RESULTS
nReturn = SQLFetch(statHandle);
@@ -2161,11 +2166,11 @@
return nReturn;
}
- SQLBindCol(statHandle, SQLTables_TABLE_NAME, SQL_C_CHAR, szTableName,
+ SQLBindCol(statHandle, 3, SQL_C_CHAR, szTableName,
sizeof(szTableName), &nIndicatorName);
- SQLBindCol(statHandle, SQLTables_TABLE_TYPE, SQL_C_CHAR, szTableType,
+ SQLBindCol(statHandle, 4, SQL_C_CHAR, szTableType,
sizeof(szTableType), &nIndicatorType);
- SQLBindCol(statHandle, SQLTables_REMARKS, SQL_C_CHAR, szTableRemarks,
+ SQLBindCol(statHandle, 5, SQL_C_CHAR, szTableRemarks,
sizeof(szTableRemarks), &nIndicatorRemarks);
// GET RESULTS
nReturn = SQLFetch(statHandle);
@@ -2557,7 +2562,7 @@
while (SQL_SUCCEEDED(SQLFetch(statHandle)))
{
- SQLGetData(statHandle, SQLColumns_COLUMN_NAME, SQL_C_CHAR, colname,
+ SQLGetData(statHandle, SQLColumns_ColumnName, SQL_C_CHAR, colname,
sizeof(colname), 0);
//printf("field exist dopo la get data - field =%s, Colname %s\n",field,colname);
@@ -2647,7 +2652,7 @@
{
if (!SQL_SUCCEEDED
(SQLGetData
- (statHandle, SQLColumns_COLUMN_NAME, SQL_C_CHAR, current->fieldname,
+ (statHandle, SQLColumns_ColumnName, SQL_C_CHAR, current->fieldname,
sizeof(current->fieldname), 0)))
strcpy((char *)current->fieldname, "Unknown");
@@ -2760,13 +2765,13 @@
while (SQL_SUCCEEDED(SQLFetch(statHandle)))
{
- SQLGetData(statHandle, SQLColumns_COLUMN_NAME, SQL_C_CHAR, colname, sizeof(colname), 0);
+ SQLGetData(statHandle, SQLColumns_ColumnName, SQL_C_CHAR, colname, sizeof(colname), 0);
if (strcmp((char *) colname, field) == 0)
{
- SQL_SUCCEEDED(SQLGetData(statHandle, SQLColumns_SQL_DATA_TYPE, SQL_C_CHAR, coltype, sizeof(coltype), 0));
- SQL_SUCCEEDED(SQLGetData(statHandle, SQLColumns_COLUMN_SIZE, SQL_C_CHAR, precision, sizeof(precision), 0));
+ SQL_SUCCEEDED(SQLGetData(statHandle, SQLColumns_SQL_DataType, SQL_C_CHAR, coltype, sizeof(coltype), 0));
+ SQL_SUCCEEDED(SQLGetData(statHandle, SQLColumns_ColumnSize, SQL_C_CHAR, precision, sizeof(precision), 0));
break;
Index: gb.db.postgresql/configure.ac
===================================================================
--- gb.db.postgresql/configure.ac
+++ gb.db.postgresql/configure.ac
@@ -14,7 +14,7 @@
GB_COMPONENT(
postgresql, POSTGRESQL, gb.db.postgresql, [src],
[GB_FIND(libpq-fe.h postgres.h pg_type.h, /usr/local/lib /usr/local /opt /usr/lib /usr, include/pgsql* pgsql*/include include/postgresql* postgresql*/include include/postgresql/*/server/catalog include/postgresql/*/server include)],
- [GB_FIND(libpq.$SHLIBEXT, /usr/local /opt /usr, lib pgsql*/lib postgresql*/lib)],
+ [GB_FIND(libpq.a, /usr/local /opt /usr, lib pgsql*/lib postgresql*/lib)],
[$C_LIB -lpq])
dnl ---- Create makefiles
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment