10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How You Can Use Exec 4GL Statements in 3GL ProceduresHow You Can Use Exec 4GL Statements in 3GL ProceduresA limited number of scalar data items can be passed easily between 4GL and3GL procedures. However, if the amount of scalar data to be passed exceedsthe number of parameters allowed on your system, or if you want to passstructured data such as an array or an OpenROAD object, use the C languageto pass the data to an embedded SQL procedure.To access OpenROAD structured data from 3GL, you use a set of embeddedstatements that have the following syntax:exec 4gl 4gl_statement [terminator]Note: This syntax is similar to that used for embedded SQL statements. All3GL routines using these exec 4gl statements can be used only in OpenROADapplications.For more information about using exec 4gl statements, see the LanguageReference <strong>Guide</strong> online help.You can use an embedded procedure with OpenROAD to perform the followingfunctions:• Getting and setting object and array attributes• Dynamically accessing object and array attributes by a describe operationusing the SQLDA• Indexing into arrays to get or set objects• Inserting rows into, deleting rows from, and removing rows from arrays• Clearing arrays• Accessing global variables and constants• Sending user events to 4GLHow You Can Pass Structured DataStructured data is passed to 3GL as a handle. You reference the handle in theexec 4GL statements whenever you want to reference the object or array. Thehandle is passed as a 4-byte integer. To store a handle passed in from 4GL,use a 32-bit integer data type.After control is returned to 4GL, a later call from 4GL to 3GL cannot use thehandle stored earlier in a static variable because the earlier handle is no longervalid. Therefore, the 3GL routine should not store a handle in a static variable.298 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!