Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Posts
    17

    Unhappy Unanswered: SQLPrimaryKeys on OS390

    on DB2/WinNT connected via ODBC a call to SQLPrimaryKeys works fine. if i do the same on OS390 (same tables), the call returns SQL_ERROR but i don't get a ERROR description or state from the CLI driver (state is 00000). other calls like SQLColumns or SQLStatistics work.
    any experience on that ?
    or any other idea to determine primary keys ?

  2. #2
    Join Date
    Jan 2003
    Posts
    17

    Re: SQLPrimaryKeys on OS390

    since i don't have dba rigths i asked the administrator what may be wrong. he told me that i may access systables via an alternate catalog but not sysibm.systables. but how to tell the odbc driver to use an alternate catalog ?

  3. #3
    Join Date
    Jan 2003
    Posts
    17

    Re: SQLPrimaryKeys on OS390

    in the odbc driver settings i had to define a different SYSSCHEMA. now the Fetch doesn't return SQL_ERROR but it returns NO DATA although SqlPrimaryKeys is called on an existing table.

  4. #4
    Join Date
    Jan 2003
    Posts
    17

    Smile

    the solution is simple:
    on the OS390-HOST no primary keys were definied, just unique keys. so i extracted the unique keys with SQLStatistics and used one of the unique keys as primary key

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •