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.

ProceduresStatements in ScriptsScripts can contain any mixture of 4GL statements and SQL statementsacceptable to OpenROAD. These statements enable OpenROAD to perform awide variety of tasks:• Declaration and assignmentThese statements let you define variables and assign values to them.• Data managementThese statements, such as select, insert, delete, and update, let you queryand update the database.• Loop controlThese conditional statements, including for, if, while, continue, andendloop, let you control the processing flow within a script, event block, orprocedure.• Program flow control statementsThese statements let you control the basic flow of the application by callingframes, procedures, operating system, or even another Ingres tool.For detailed descriptions of all the OpenROAD statements, see the LanguageReference <strong>Guide</strong> online help. For more information about SQL statements, seeSQL Syntax Summary (see page 483).ProceduresA procedure is a named piece of code that performs a single task. Unlike theevent-driven code that comprises frame and field script code, proceduresprocess in sequence. Procedures also differ from frames in that they are notassociated with a form. They are used primarily to eliminate duplication amongyour scripts and to make code more readable. Procedures also provide themeans of accessing a 3GL language from an OpenROAD script.You can define procedures in two ways:GloballyProcedures that are defined globally to an application can be called fromany OpenROAD script in that application or, if included in anotherapplication, from a second application as well.LocallyProcedures that are defined locally within a frame, field, or procedurescript can be called only from the script in which they are defined or fromdescendent fields (fields within the scope of the calling script).74 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!