10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Calling ProceduresparameterAssigns the expression in the callproc statement to the parameter in thecalled procedure that you declared with the procedure statement. For moreinformation about declaring procedure parameters, see the LanguageReference <strong>Guide</strong> online help.Because you specify the parameters by name rather than by position, youcan pass them in any order, and you need not pass all the parameters.expressionSpecifies a constant or any legal OpenROAD expression, as long as theresulting data type is compatible with the data type of the local variable inthe procedure. Variables in the expression can be any type, includingreference variables and array variables.The following example from the video_list frame script uses the callprocstatement to call a procedure that removes a row from the video_detail frame:callproc remove_new_detail(new_details_frames =new_details_frames, details_frame =video.details_frame);Any variable in the procedure that you do not specify in the parameter list isset to its default value.Parameters to 4GL procedures can be passed by value and by reference. For adiscussion of passing parameters by value and by reference, see How You CanPass Parameters Between an Active Child and Inactive Parent (see page 101).The value of the referenced variable is not updated until the called procedurereturns. At this point, the variable in the calling frame is updated the sameway it would be if you had used an assignment statement. If a field on theform is associated with the variable, the field does not display the new valueuntil the current event block completes. To cause the value to update beforethe end of the event block, you can use the Flush method immediately afterthe callproc statement. For more information about the Flush method, see theLanguage Reference <strong>Guide</strong> online help.How You Can Call Database ProceduresA database procedure is a data-oriented procedure stored in the database andexecuted within the database server that you can call by name in a script or4GL procedure. Database procedures are often used to increase performanceand help ensure data integrity and consistency.In OpenROAD, you call database procedures the same way you call 4GLprocedures.Writing Scripts and Procedures 85

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!