How You Can Switch Sessions for a 4GL Procedure
To switch sessions from within a local 4GL procedure, you must set the CurProcedure.DBSession attribute for the ProcExec object. For example, the following statement switches the current procedure to the session represented by the DBSessionObject third_session:
CurProcedure.DBSession = third_session;
Note: In contrast to the CurProcedure.DBSession attribute, setting the CurFrame.DBSession attribute from within a local procedure will not change the local procedure's session. Instead, it changes the calling frame's session after the local procedure returns.