project BLF > class Persistence (other) > method SqlErrorMessage

Description

SqlErrorMessage


Parameters


ihClassinputhandleBusiness Class
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method other.CheckExistence
method other.ConnectDB
method other.DoLoadDLL
method other.LoadInstance
method other.ReadDataRecursive
method other.ReadDirect
method other.ReadQuery
method other.SaveInstance
method other.WriteData
method other.WriteDirect


program code (program1/other.p)

run SqlGetError in {&TARGETPROCEDURE}
   (output viErrAddr, output viErrCode).
if viErrAddr = 0
then return.

assign vcError = <M-6 getString (input  viErrAddr (iiAddr)) in other>.
if vcError = ""
then return.

run SqlClearError in {&TARGETPROCEDURE} (output viFcReturnSuper).

if ihClass = ?
then if viOSessionId = 0
     then assign vhPdatabaseInst = ?.
     else do:
         <I-2 {tFcOpenInstance &CLASS           = "session" 
                      &ERROR-STATEMENT = "if false then" 
                      &SESSIONID       = "0"}>
         if oiReturnStatus <> 0
         then do:
             assign vlFcStateless = yes.
             <I-3 {tFcOpenInstance
            &CLASS           = "session"
            &SESSIONID       = "0"}>
         end.
         assign vhPdatabaseInst = vhOSessionInst.
     end.
else assign vhPDatabaseInst = ihClass.

if vhPdatabaseInst <> ?
then do:    
    <M-1 run SetMessage
          (input  vcError (icMessage), 
           input  '' (icArguments), 
           input  '' (icFieldName), 
           input  '' (icFieldValue), 
           input  'S':U (icType), 
           input  2 (iiSeverity), 
           input  '' (icRowid), 
           input  'BLF-366':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in database>

    if ihClass = ?
    then do:
        <I-4 {tFcCloseInstance
            &CLASS           = "session"}>
    end.
end.