pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedSQLPrimaryKeys
2+ messages / 2 participants
[nested] [flat]
* SQLPrimaryKeys
@ 1998-09-19 07:33 Stephen Davies <scldad@sdc.com.au>
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Davies @ 1998-09-19 07:33 UTC (permalink / raw)
To: pgsql-interfaces; PostgreSQL general <pgsql-general@postgreSQL.org>
Hello again.
Does the SQLPrimaryKeys facility work with 6.3.2 and ODBC 6.30.0249?
If so, could someone please send me the declaration and a sample of usage.
If not, how else can I determine which columns comprise a unique key of a
PostgreSQL table via ODBC?
(I can successfully access other functions such as SQLColumns. It is just
SQLPrimaryKeys that is causing me grief at the moment.)
Cheers and thanks,
Stephen.
========================================================================
Stephen Davies Consulting scldad@sdc.com.au
Adelaide, South Australia. Voice: 61-8-82728863
Computing & Network solutions. Fax: 61-8-82741015
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [INTERFACES] SQLPrimaryKeys
@ 1998-09-21 14:23 Byron Nikolaidis <byronn@insightdist.com>
parent: Stephen Davies <scldad@sdc.com.au>
0 siblings, 0 replies; 2+ messages in thread
From: Byron Nikolaidis @ 1998-09-21 14:23 UTC (permalink / raw)
To: Stephen Davies <scldad@sdc.com.au>; +Cc: pgsql-interfaces; PostgreSQL general <pgsql-general@postgreSQL.org>
Stephen Davies wrote:
> Hello again.
>
> Does the SQLPrimaryKeys facility work with 6.3.2 and ODBC 6.30.0249?
>
> If so, could someone please send me the declaration and a sample of usage.
>
> If not, how else can I determine which columns comprise a unique key of a
> PostgreSQL table via ODBC?
>
> (I can successfully access other functions such as SQLColumns. It is just
> SQLPrimaryKeys that is causing me grief at the moment.)
>
It should work. I have used it and I tested it with applications such as Visio. Did you get an
error or something?
Here is a test usage to get the primary keys of the "t1" table:
result = SQLAllocStmt( self, &hstmt1);
result = SQLPrimaryKeys(hstmt1, NULL, 0, NULL, 0, "t1", SQL_NTS);
result = SQLBindCol(hstmt1, 3, SQL_C_CHAR, pktab, sizeof(pktab), &pktab_len);
result = SQLBindCol(hstmt1, 4, SQL_C_CHAR, pkcol, sizeof(pkcol), &pkcol_len);
result = SQLBindCol(hstmt1, 5, SQL_C_SHORT, &seq, 0, NULL);
result = SQLFetch(hstmt1);
while (result != SQL_NO_DATA_FOUND) {
qlog("fetch on stmt1: result = %d, pktab='%s', pkcol='%s', seq=%d\n",
result, pktab, pkcol, seq);
result = SQLFetch(hstmt1);
}
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-09-21 14:23 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-09-19 07:33 SQLPrimaryKeys Stephen Davies <scldad@sdc.com.au>
1998-09-21 14:23 ` Byron Nikolaidis <byronn@insightdist.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox