Код: Выделить всё
//=============================================================
interface Test_DSQL 'Test_DSQL';
//-------------------------------------------------------------
table struct mt
(
dsaldo : date,
cmc : comp,
cpodr : comp,
cparty : comp
)
;
//--------------------------------------------------------------
create view
as select
*
from
mt
;
//--------------------------------------------------------------
browse brMT;
show at(,1,,10);
table mt;
fields
dsaldo : [10], protect, noDel;
cmc : [17], protect, noDel;
cpodr : [17], protect, noDel;
cparty : [17], protect, noDel;
end;
handleEvent
cmInit:
{
var stmt : longInt;
stmt := sqlAllocStmt;
sqlBindCol(stmt, 1, dsaldo);
sqlBindCol(stmt, 2, cmc);
sqlBindCol(stmt, 3, cpodr);
sqlBindCol(stmt, 4, cparty);
sqlExecStmt(stmt, 'SELECT max(saldomc.dsaldo), saldomc.cmc, saldomc.cpodr, saldomc.cparty FROM saldomc where kol < 60000 group by saldomc.cmc, saldomc.cpodr, saldomc.cparty order by saldomc.cmc, saldomc.cpodr, saldomc.cparty');
sqlFetchInto(stmt, tnmt);
}
//-------------------------------------------------------------
end;
end.