Form S_189FF

LANSA

Form S_189FF

*===================================================================;
*;
* Component : S_189FF;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : SELECT_SQL - Auto join - Joining a file to itself; ;
*;
* Disclaimer : The following material is supplied as sample material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM LEFT(301) TOP(129) WIDTH(440);
DEFINE_COM CLASS(#PRIM_LTVW) NAME(#LTVW_1) DISPLAYPOSITION(1) HEIGHT(233) LEFT(6) PARENT(#COM_OWNER) TABPOSITION(1) TOP(72) WIDTH(419);
DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_1) DISPLAYPOSITION(1) PARENT(#LTVW_1) SOURCE(#EMPNO) WIDTH(28);
DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_2) DISPLAYPOSITION(2) PARENT(#LTVW_1) SOURCE(#SURNAME) WIDTH(37);
DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_3) DISPLAYPOSITION(3) PARENT(#LTVW_1) SOURCE(#SALARY) WIDTH(20) WIDTHTYPE(Remainder);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) CAPTION('In this example, a selection is required which will display all employees who have a higher salary than employee number A1234. Attention: the table PSLMST will be joined with....ITSELF. This is an example of ''Auto-Join''.') DISPLAYPOSITION(2) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(8) WIDTH(417);
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
clr_list #ltvw_1;
SELECT_SQL FIELDS((#EMPNO P2.EMPNO) (#SURNAME P2.SURNAME) (#SALARY P2.SALARY)) FROM_FILES((PSLMST P1)(PSLMST P2)) WHERE('P1.EMPNO=''A1234'' AND P2.SALARY > P1.SALARY');
add_entry #ltvw_1;
endselect;
ENDROUTINE;
;
END_COM;