Apr 13, 2016

find and exist 소스코드

static CustTable find(CustAccount   _custAccount,
                      boolean       _forUpdate = false)
{
    CustTable custTable;
    if (_custAccount)
    {
        if (_forUpdate)
        {
            custTable.selectForUpdate(_forUpdate);
        }
        select firstonly custTable
            index hint AccountIdx
            where custTable.AccountNum == _custAccount;
    }
    return custTable;
}


static boolean exist(CustAccount _custAccount)
{
    return _custAccount && (select firstonly RecId from custTable
                                index hint AccountIdx
                                where custTable.AccountNum == _custAccount).RecId != 0;
}

No comments:

Post a Comment