oracle - Issue "ORA-01722: invalid number" error at many places has been created -


i getting error "ora-01722: invalid number" @ many places oracle driver. can point out workaround/solution?

pdoexception: select base.fid fid, base.uid uid,     base.filename filename, base.uri uri, base.filemime filemime,     base.filesize filesize, base.status status, base.timestamp timestamp     {file_managed} base     (base.fid in (:db_condition_placeholder_0)) (prepared: select base.fid fid, base."uid" "uid",     base.filename filename, base.uri uri, base.filemime filemime,     base.filesize filesize, base.status status, base.timestamp timestamp     "file_managed" base     (base.fid in (:db_condition_placeholder_0)) ) e: sqlstate[hy000]: general error: 1722 ocistmtexecute: ora-01722: invalid number (ext\pdo_oci\oci_statement.c:146) args: array ( [:db_condition_placeholder_0] => ) in drupaldefaultentitycontroller->load() (line 196 of c:\xampp\htdocs\new\drupal\includes\entity.inc). 

without context, hard sure. i'm in guessing mood, here goes:

base.fid numeric column. in :db_condition_placeholder_0 attempt pass string of tokens such "23, 42, 69".

now you're hoping sql engine munge produce line this:

where base.fid in (23, 42, 69) 

alas, generates this:

where base.fid in ('23, 42, 69') 

... logically same as:

where base.fid = to_number('23, 42, 69') 

obviously string isn't valid number , hence ora-1722.

now tricky matter. there several different approaches, including nested tables or arrays, pipelined functions , dynamic sql. 1 suit best depends on details of requirement.

plus, of course, i'm guessing problem anyway :-)


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -