Closed (duplicate)
Project:
Oracle Driver
Version:
7.x-1.9
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Oct 2011 at 16:19 UTC
Updated:
10 Oct 2011 at 23:15 UTC
I have received a similar error message, as below, with various modules that use the db_query method. Here is an error I got when trying to upgrade from ubercart bet4 to rc1:
PDOException: SELECT * FROM (SELECT TAB.*, ROWNUM RWN_TO_REMOVE FROM (SELECT n.nid, n.title, p.weight_units FROM {node} n JOIN {uc_products} p ON n.vid = p.vid WHERE n.nid > :current ORDER BY n.nid) TAB) WHERE RWN_TO_REMOVE BETWEEN :oracle_rwn_start AND :oracle_rwn_end (prepared: SELECT * FROM (SELECT TAB.*, ROWNUM RWN_TO_REMOVE FROM (SELECT n.nid, n.title, p.weight_units FROM "NODE" n JOIN "UC_PRODUCTS" p ON n.vid = p.vid WHERE n.nid > :current ORDER BY n.nid) TAB) WHERE RWN_TO_REMOVE BETWEEN :oracle_rwn_start AND :oracle_rwn_end ) e: SQLSTATE[HY000]: General error: 1745 OCIStmtExecute: ORA-01745: invalid host/bind variable name (ext\pdo_oci\oci_statement.c:146) args: Array ( [:current] => 0 [oracle_rwn_start] => 1 [oracle_rwn_end] => 200 ) in uc_order_update_7004() (line 786 of C:\Data\Website\drupal7\sites\all\modules\ubercart\uc_order\uc_order.install).
I was able to get passed it by taking out the call to db_query (see actual code below), and utilizing db_select instead.
db_query_range("SELECT n.nid, n.title, p.weight_units FROM {node} AS n JOIN {uc_products} AS p ON n.vid = p.vid WHERE n.nid > :current ORDER BY n.nid", 0, $limit, array(':current' => $sandbox['current_nid']));
I have also noticed that the use of "AS" in the db_query method to name a table as, produces errors (might have something to do with the issue).
Any idea what might be going wrong?
Thanks!
Comments
Comment #1
cmurph commentedAnother example of the same kind of error:
And here is the db_query method:
Once I put in an actual values for the ":start" and ":end" instead of the variable, I am able to get the SQL to run.
Thanks!
Comment #2
cmurph commentedFound out this was a Duplicate of this issue: http://drupal.org/node/1153174