From: Steve F. <sfi...@pc...> - 2003-12-11 16:20:17
|
ok, debbie spotted the problem: your SQL is a delete statement. but, it is supposed to be a select statement to select the entries to delete. steve sucheta Tripathy wrote: >Hi Steve, > >I am using the updated DbiDbHandle.pm from the repository. >The query works fine at the SQL prompt. > >Sucheta > > > >>Sucheta- >> >>Thanks for your patience around this. >> >>I have just looked at deleteEntries.pl, on the line where the failure is. >> >>I believe you are still passing it an invalid SQL. The 'nr' is >>suspicious. >> >>Here is a general hint: when you write SQL to pass to a plugin or >>script, it is a good practice to test the SQL first in sqplus or >>whatever interface you use. >> >>That said, the script should give a better message. Can you take a >>look in $PROJECT_HOME/GUS/ObjRelP/lib/perl/DbiDbHandle.pm, near the top, >>and tell me what CVS version the file is? You may have a slightly old >>one which doesn't have the latest improvements in error handling. >> >>steve >> >> >> >>sucheta Tripathy wrote: >> >> >> >>>Hi , >>> >>>After I tried the query you suggested it gives the following error. >>> >>>DBD::Oracle::st fetchrow_array failed: ERROR no statement executing >>>(perhaps you >>>need to call execute first) [for Statement "delete from DoTS.NRDBEntry >>>where nr >>>db_entry_id=3"] at /home/apps/gus/gushome/bin/deleteEntries.pl line 51. >>>deleting ids from DoTS::NRDBEntry >>> >>>Sucheta >>> >>> >>> >>> >>>>Hi, >>>> >>>>The sql query should have been --idSQL 'delete from DoTS.NRDBEntry >>>>where nrdb_entry_id=1' rather than ...DoTS::NRDBEntry... >>>> >>>> Debbie >>>> >>>> >>>>On Wed, 10 Dec 2003, sucheta Tripathy wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Hi, >>>>> >>>>>I have been trying to use the deleteEntries.pl program to delete some >>>>>of >>>>>the rows inserted into the DoTS::NRDBEntry table. >>>>> >>>>>First it gave an insufficient privilege error, so when we looked at the >>>>>code at line 30, 31, we noticed, it calls the >>>>>$gusconfig->getReadOnlyDatabaseLogin(), >>>>>$gusconfig->getReadOnlyDatabasePassword() >>>>> >>>>>which has only readonly privileges (From the .gus.properties file). >>>>> >>>>>So I changed it to >>>>> >>>>>$gusconfig->getDatabaseLogin(), >>>>>$gusconfig->getDatabasePassword(), at those 2 lines which has read, >>>>>write, >>>>>delete privileges. >>>>> >>>>>The options I have used are: >>>>> >>>>>deleteEntries.pl --idSQL 'delete from DoTS::NRDBEntry where >>>>>nrdb_entry_id=1' --table DoTS::NRDBEntry >>>>> >>>>>It is throwing the following errors: >>>>> >>>>>Reading properties from /home/apps/gus/.gus.properties >>>>>The login is GUSrw >>>>>DBD::Oracle::st execute failed: ORA-00933: SQL command not properly >>>>>ended >>>>>(DBD E >>>>>RROR: OCIStmtExecute) [for Statement "delete from DoTS::NRDBEntry where >>>>>nrdb_ent >>>>>ry_id=3" with ParamValues: :NRDBEntry=undef] at >>>>>/home/apps/gus/gushome/lib/perl/ >>>>>GUS/ObjRelP/DbiDbHandle.pm line 82. >>>>>Execute FAILED: ORA-00933: SQL command not properly ended (DBD ERROR: >>>>>OCIStmtExe >>>>>cute) >>>>>sql_cmd: >>>>>delete from DoTS::NRDBEntry where nrdb_entry_id=3 >>>>>DBD::Oracle::st fetchrow_array failed: ERROR no statement executing >>>>>(perhaps you >>>>>need to call execute first) [for Statement "delete from >>>>>DoTS::NRDBEntry >>>>>where n >>>>>rdb_entry_id=3" with ParamValues: :NRDBEntry=undef] at >>>>>/home/apps/gus/gushome/bi >>>>>n/deleteEntries.pl line 51. >>>>>deleting ids from DoTS::NRDBEntry >>>>> >>>>> >>>>> >>>>> >>>>> >>> >>> >>> >>> > > > > |