On Wed, Jan 2, 2013 at 5:13 PM, Art Heimsoth <artst...@artheimsoth.com>wrote:

> I must be doing something wrong, but within my ooDialog program
> I have not been able to delete a row.  I display a list of names in the
> main dialog, obtained with a SELECT statement, then pass the selected
> name to a child method where a couple of other tables are checked
> and then that row is attempted to be deleted with the DELETE statement,
> but a SELECT statement immediately following shows the row is still
> in the database..  My statement passed to the SQL method to execute is:
> DELETE FROM table WHERE upper(name) = "SOME NAME";
> The select statement immediately following is:
> SELECT name FROM table WHERE upper(name) = "SOME NAME";
> and it is retrieved from the table..
> Any ideas?  Thanks..
>

My first guess when reading this was the same as Earl's.

But, I just looked at some test code I have, that correctly deletes a
record, and I don't have an explicit COMMIT.  So I don't think that's it.

What does your actually code look like?  Are you checking the return codes?

Here is some Rexx code that works for me:

  sql = "DELETE FROM christmas_list WHERE id="recID";"

  stmt = .ooSQLiteStmt~new(dbConn, sql)
  if stmt~initCode <> dbConn~OK then do
    self~reportStmtError(stmt, 'init .ooSQLiteStmt failed.', sql)
    return .false
  end

  ret = stmt~step
  stmt~finalize

  if ret <> stmt~DONE then return .false
  else return .true

So, are you explicitly using an ooSQLStatement object?  Or are you using
the execute() method of the ooSQLiteConn object?

execute() should work fine, but in either case you need to check all the
return codes to determine what might be the problem.

--
Mark Miesfeld
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to