Dunno what's going wrong here, so I need somehelp reformatting this query.
With an Oracle ODBC driver, I get 0 rows retuned(returns 37 using SQLplus). When I use a Microsoft ODBC driver, I get the error
"Warning: SQL error: [Microsoft][ODBC driver for Oracle]Cannot use Keyset-driven cursor on join, with distinct clause, union, intersect or minus or on read only result set, SQL state S1C00 in SQLExecDirect in c:\www\query.php on line 43"
Not sure how to do this. I have confirmed that this query works with SQLplus on both drivers, but seems to bomb when trying to run it through PHP. I know this is a lot to take in, but any help would be greatly appreciated. Thanks!
<?
$connect = odbc_connect( '$dsn' , '$user' , '$pass' );
$query = "SELECT order_header.order_id, order_header.order_type, groups.creation_date, order_header.delivery_name, order_header.enterprise_id, order_header.ship_via
FROM order_header, groups
WHERE order_header.max_hdr_status = 'REL'
AND order_header.order_type not in ('PC','CT','CX','IF','PT')
AND order_header.allocation_group_id = groups.group_id
AND (order_header.enterprise_id like 'H56400000%'
OR order_header.enterprise_id like 'H01008909%'
OR order_header.enterprise_id like 'H06306915%'
OR order_header.enterprise_id like 'H01802627%'
OR order_header.enterprise_id like 'H02100681%'
OR order_header.enterprise_id like 'H00500321%'
OR order_header.enterprise_id like 'H00406376%')";
$result = odbc_exec( $connect, $query );
$row = 0;
while( odbc_fetch_row( $result )) {
$row++;
$foo1 = odbc_result( $result, 1 );
$foo2 = odbc_result( $result, 2 );
$foo3 = odbc_result( $result, 3 );
$foo4 = odbc_result( $result, 4 );
$foo5 = odbc_result( $result, 5 );
$foo6 = odbc_result( $result, 6 );