Scott,

This error indicates that there is no index/primary key on a table that the
result set is coming from - and PHP has told the driver read the result set
into a into a cursor (which requires a primary key).

Adding a primary key to the table will fix this, or passing a different
cursor type - keyset driven cursors are essentially 'sliding windows' - they
read a set of rows in, and then scroll back and forth.  Upon reaching the
end of the set, they grab the next keyset in the direction of scroll, etc.

Alternatively, instead of adding the primary key, you can disable "#define
HAVE_SQL_EXTENDED_FETCH 1 " in php_odbc.h and recompile.  This will prevent
PHP from atomatically setting a cursor.

Best regards,
Andrew
--------------------------------------
Andrew Hill - OpenLink Software
Director Technology Evangelism
Universal Data Access Integration
http://www.openlinksw.com

> -----Original Message-----
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 18, 2001 9:37 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] New problem with PHP "odbc_exec".
>
>
>   Hi!  I don't understand why PHP is having trouble with the
> odbc_exec.  Is
> there a bug in PHP code?  Here's what the error messages said!
>
>   "SQL error: [OpenLink][ODBC][Driver]No key columns found for table
> referenced by keyset driven cursor., SQL state IM909 in SQLExecDirect".
>
>   This show that it had to do with primary (or secondary) keys or index
> issues.  I'm using MS-SQL Sever and this table I'm using in the database
> have primary key already!
>
>   So, what can I do to fix it?  I need it to be working.  When I use the
> Linux odbctest command and it execute without a problem.  So, it
> is obvious
> the problem lie with PHP code, odbc_exec();
>
> Thanks,
>  Scott
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to