Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.
SalBoolean DbPLSQLBlock( SalSqlHandle hSql, SalString lsStmt )
The DbPLSQLBlock executes a complete anonymous PL/SQL block in a single call to the server.
Name | Description | SalSqlHandle hSql | Handle that identifies the database connection. | SalString lsStmt | String that contains an anonymous PL/SQL block. If the block consists of a single statement, it is not necessary to specify the BEGIN and END keywords. |
---|
The return value is TRUE if the block is executed successfully, FALSE otherwise. Please read the remarks about the return values!
Using one DbPLSQLBlock instead of multiple calls to DbImmediate/ DbPLSQLBlock provides better performance since the entire block is sent to the server at once, thus avoiding lot's of interaction across the network.
! These two Db calls… Call DbImmediate( 'select &AO.Some_API.Get_Desciption( :sId ) into :sDesc from dual' ) Call DbPLSQLBlock( c_hSql, '&AO.Some_API.Update( :sId, :sNewValue )' ) ! …can be replaced with one single Db call like this: Call DbPLSQLBlock( c_hSql, 'BEGIN :sDesc := &AO.Some_API.Get_Description( :sId ); &AO.Some_API.Update( :sId, :sNewValue ); END;' )DbImmediate("SELECT Count(*) INTO :i_hWndFrame.dlgTerminateEmployee.nTerminateCounter FROM &AO.emp_employed_time WHERE\r\n" + " company_id = :i_hWndFrame.dlgTerminateEmployee.dfsCompanyId AND emp_no = :i_hWndFrame.dlgTerminateEmployee.dfsEmpNo\r\n" + " AND date_of_leaving >= :i_hWndFrame.dlgTerminateEmployee.dfdtDate AND date_of_employment <= :i_hWndFrame.dlgTerminateEmployee.dfdtDate"); // Bug 44262, end if (!(Sal.IsNull(dlgTerminateEmployee.FromHandle(i_hWndFrame).dfsEmployeeStatus))) { if (!(DbPLSQLBlock(cSessionManager.c_hSql, "BEGIN\r\n" + " :i_hWndFrame.dlgTerminateEmployee.nSeqNo := " + cSessionManager.c_sDbPrefix + "Employee_Status_API.Get_Seq_No(:i_hWndFrame.dlgTerminateEmployee.dfsCompanyId ,\r\n" + " :i_hWndFrame.dlgTerminateEmployee.dfsEmployeeStatus);\r\n END;"))) { return false; } }DbPLSQLBlock(cSessionManager.c_hSql, "BEGIN " + cSessionManager.c_sDbPrefix +
"Company_Employee_Property_API.Get_Blocked_Free_Fields(\r\n" + ":i_hWndFrame.frmInfo1.sBlockedFields,\r\n" + ":i_hWndFrame.frmInfo1.i_sCurrentHRCompany);\r\nEND;");
Please read the remarks about the return values!