Listing 7‑1 is a sample of a viewfile containing a source view description, custdb.Listing 7‑1 Sample ViewfileListing 7‑2 is a sample of a field table needed to compile the view in the last section.Listing 7‑2 Sample Field TableListing 7‑3 shows a header file produced by the view compiler. Assume that the viewfile in the earlier section was used as input to viewc.Listing 7‑3 Sample Header File Produced by viewcListing 7‑4 shows a header file produced from a field table file by mkfldhdr. Assume that a field table file containing the definitions of the fields shown in the previous examples was used as input to mkfldhdr.Listing 7‑4 Sample Header File Produced by mkfldhdr(1)Listing 7‑5 Sample COBOL COPY FileFor a sample COBOL program that includes a COBOL COPY file produced by viewc -C, see Programming an Oracle Tuxedo ATMI Application Using COBOL.The following program in Listing 7‑6 is an example of the use of VIEWS to map a structure to a fielded buffer. The environment variables discussed in “Setting Up Your Environment for FML and VIEWS” on page 4‑1 must be properly set for this program to work.Information on compiling FML programs can be found on the compilation(5) reference page in Oracle Tuxedo File Formats, Data Descriptions, MIBs, and System Processes Reference.Listing 7‑6 Sample VIEWS Programbankapp is a sample application distributed with the Oracle Tuxedo system. It includes two files in which a VIEWS structure is used. The structure in the example is one that does not map to an FML buffer, so FML functions are not used to get data into or out of the structure members.$TUXDIR/apps/bankapp/audit.c is a client program that uses command-line options to determine how to set up a service request in a VIEW typed buffer.The code in the server $TUXDIR/apps/bankapp/BAL.ec accepts the service request and shows the fields from a VIEW buffer being used to formulate ESQL statements.
• viewc, viewc32(1) in Oracle Tuxedo Command Reference
• mkfldhdr, mkfldhdr32(1) in Oracle Tuxedo Command Referencebankapp is a sample application distributed with the Oracle Tuxedo system. The serversshow FML functions being used to manipulate data in FML typed buffers that have been passed to the servers from bankclt, the bankapp client.Note that in these servers the ATMI functions tpalloc(3c) and tprealloc(3c)—rather than the FML functions Falloc, Falloc32(3fml) and Frealloc, Frealloc32(3fml)—are used to allocate message buffers.