0

I am using a phalcon application connecting to the oracle db.

When I am trying to call a native model function findFirst('id=23') its throwing Pdoexception and the query string became different, below is the query string.

SELECT Z2.* FROM (SELECT Z1.*, ROWNUM DB_ROWNUM FROM ( SELECT BANKS.ID, BANKS.ID, BANKS.ID, BANKS.ID, BANKS.NAME, BANKS.NAME, BANKS.CODE, BANKS.CODE, BANKS.LOGO_IMAGE, BANKS.LOGO_IMAGE, BANKS.REF_NUMBER_HELP_IMAGE, BANKS.REF_NUMBER_HELP_IMAGE, BANKS.USSD_NUMBER FROM BANKS WHERE BANKS.ID = 23 ) Z1 ) Z2 WHERE Z2.DB_ROWNUM BETWEEN 1 AND 1

In the above query string I am getting the id column 4 time, name column 2 time and so on. due to the wrong query i am getting

**OCIStmtExecute: ORA-00918: column ambiguously defined.**

any suggestion is acceptable.

MANOJ
  • 177
  • 5
  • 14
  • I'm not sure but I think that some of columns from Z2 have the same name like columns from Z1 – Luke Aug 31 '16 at 13:34
  • NO, actually when the query is building its adding the column name 4 times or 2 times. that is the issue.But i am unable to detect why this happenning. – MANOJ Aug 31 '16 at 13:51

0 Answers0