project BLF > class Persistence (other) > method CheckExistence

Description

Check for existence of data in the database.

PreCondition

This method is used in query existence calls and should not be used anywhere else.


Parameters


icQueryNameinputcharacter
icPrepareinputcharacterFor each statement for reading the data, excluding the no-lock option (this is implied automatically), excluding break by (not allowed, only normal by is allowed).
icTablesinputcharacterComma seperated list of all database tables in the for each statement.
olEofoutputlogicalyes = no record found
no = exactly one record found
? = more than one record found
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/other.p)

&if defined(DEBUGSQL) > 0 &then
run SqlDebugWrite in {&TARGETPROCEDURE} ("* ":U + program-name(1), 1).
&endif

run SqlCheckExistence in {&TARGETPROCEDURE}
   (icPrepare, output viRows, output oiReturnStatus).

assign olEof = (viRows = 0).

if oiReturnStatus <> 0
then do:
    <M-2 run SqlErrorMessage
       (input  ? (ihClass), 
        output viFcReturnSuper (oiReturnStatus)) in other>
end.