Home » Open Source » Programming Interfaces » DBD::Oracle wont delete by rowid (DBD::Oracle (version 1.15), DBI (version 1.41), Oracles v5.8.3, Oracle 10.2.0, Sun 10)
DBD::Oracle wont delete by rowid [message #349953] Tue, 23 September 2008 10:25 Go to next message
JurgyMan
Messages: 3
Registered: September 2008
Location: USA
Junior Member
Using DBD::Oracle I'm trying to delete by rowid but not having any luck. heres the code:

$dbh = DBI->connect("DBI:Oracle:host=$host;sid=$sid;port=$port", $user, $pass,
  { AutoCommit => 1,RaiseError=>1,PrintError=>1 } )
$dbh->do("delete from $table where rowid = chartorowid('$rowid')")


but get ora errors:

DBD::Oracle::db do failed: ORA-00904:
"AAALpCAAGAACjZ0ABW": invalid identifier (DBD ERROR: error possibly near <*> indicator at char 56 in 'delete from USER.TABLE where rowid = chartorowid(<*>"AAALpCAAGAACjZ0ABW")')
for Statement "delete from USER.TABLE where rowid = chartorowid("AAALpCAAGAACjZ0ABW")"]
at ./dbbulkdelete line 64, <STDIN> line 1.


Ive tried newer perl's but same problem. currently using the perl that comes with Oracle client. also have attempted without the chartorowid() call.

DBD::Oracle (version 1.15), DBI (version 1.41), Oracles v5.8.3, Oracle 10.2.0, Sun 10
Re: DBD::Oracle wont delete by rowid [message #349959 is a reply to message #349953] Tue, 23 September 2008 10:40 Go to previous messageGo to next message
Michel Cadot
Messages: 59814
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Try to put a \ before the '.

Regards
Michel
Re: DBD::Oracle wont delete by rowid [message #349992 is a reply to message #349959] Tue, 23 September 2008 12:14 Go to previous message
JurgyMan
Messages: 3
Registered: September 2008
Location: USA
Junior Member
single quotes WITHOUT chartorowid() works... thx
Previous Topic: Database in Oracle with Access as Interface (merged)
Next Topic: Is it posible to execute pl/sql script within php script ?
Goto Forum:
  


Current Time: Thu Nov 27 21:26:37 CST 2014

Total time taken to generate the page: 0.12964 seconds