I have some problem with duplicated field (deleted, it are in all table to identify deleted status). I open table with relation, when I delete a record but it show error as below.
MYSQL/1052 Column 'deleted' in field list is ambiguous
I open with this command
- Code: Select all Expand view RUN
- Function OpenDb(cTable, cQuery, cOrderBy, cTable1, cRelation1, cTable2, cRelation2, cTable3, cRelation3 )
local cFileName, cFile, cFullName
local cSql, oErr, oDb
.....
cSql := "SELECT * FROM "+lower(cTable)+ ;
iif(!empty(cTable1)," LEFT JOIN "+lower(cTable1)+" ON "+lower(cRelation1),"")+;
iif(!empty(cTable2)," LEFT JOIN "+lower(cTable2)+" ON "+lower(cRelation2),"")+;
iif(!empty(cTable3)," LEFT JOIN "+lower(cTable3)+" ON "+lower(cRelation3),"")+;
iif(!empty(cQuery)," WHERE "+cQuery+" AND deleted<>'Y'","")+; //
iif(!empty(cOrderBy)," ORDER BY "+cOrderBy,"")
oDb := MEMVAR->oServer:Query(cSql)
return oDb
I use TDolphin to access MySql Db.
When I replace 'Y' in deleted field as
- Code: Select all Expand view RUN
- oDb:deleted := 'Y'
it show an error, how do I fix it? How to specific table with field in relation condition?
Thanks in advance for help and any idea.