Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

I can not edit or delete records using the Oracle database

I use the 2.0.9 version of Phalcon in Windows 7 with WampServer. I used the scaffolding to generate the controllers, views and models. When findFirst or findFirstById does not return any results. In my logger the query is something like this:

SELECT * FROM (SELECT Z1. *, ROWNUM PHALCON_RN FROM (SELECT USERS.ID, USERS.CPF, USERS.PASSWORD, USERS.MUSTCHANGEPASSWORD, USERS.EMAIL, USERS.NOME, USERS.STATUS, USERS.SDEL, USERS.CREATEBY, USERS.CREATEIN, USERS.UPDATEBY, USERS.UPDATEIN FROM USERS WHERE USERS.ID =: 0 USERS.SDEL AND IS NULL) WHERE ROWNUM Z1 <= 0)

This 'ROWNUM <= 0' should come as 'ROWNUM> 1'? Or am I mistaken?


When I use the SQLDeveloper changing the '<=' with '>', you get the expected result.



1.4k
Accepted
answer
edited Jan '16

To continue the development of software I had to change all findFirts and findFirstByID by simple find. I had to do some hacks to work, but it works correctly.

<?php
$user = Users::find(array(
                  "conditions" => "id = ?1",
                  "bind" => array(1 => $id)
      ));