Hi,
This code is in fieldvalid method of txtTip control with Tip_o.Tip_obj controlsource.
The problem is that only when first time invoked it detects properly if any record with
such value exist. After that duplicate values are not signalized till commit in database. (ORA - .... ).
LOCAL s, v, _tip
_tip = ''
s = 0
_tip = this.value
v=SQLEXEC(thisform.oCDE.cdNesto.nConnID,;
"Begin SELECT COUNT(*) into ?@s from Tip_o Where Tip_o.TIP_OBJ=?@_tip;End;")
IF s > 0
thisform.oCDE.DisplayMessage('Tip exists ! - '+STR(s,2)+' '+_tip )
RETURN .F.
ENDIF
Regards, Gojko
PS
Additional Q.:
Table Tip_o is defined in cmdataenvironment cdNesto as cursor: CursTip_o. Now,
how can I use native EXECUTE method of cursor CursTip_o. I mean as format is
object.EXECUTE(nconnID,cSQL,cResultcursor)
something like: thisform.oCDE.CursTip_o.EXECUTE( ... )
I am here confused about proper hierarchy ...