home *** CD-ROM | disk | FTP | other *** search
- /* copyright (c) 1986 by ORACLE Corporation. All rights reserved. */
-
- #include <stdio.h>
-
- /*
- NAME
- testexit - test user exit for iap
- FUNCTION
- Gets and puts a value on the form
- RETURNS
- SUCCESS, always
- NOTES
- Gets the value of emp.ename. If it is OATES, puts "has a nice car"
- OWNER
- Oates
- DATE
- 01/22/87
- MODIFIED
- Name mm/dd/yy - what you did
- */
-
- EXEC SQL BEGIN DECLARE SECTION;
-
- char ename[30];
- EXEC SQL END DECLARE SECTION;
- EXEC SQL INCLUDE SQLCA;
-
- unsigned testexit()
- {
- int i;
- EXEC SQL WHENEVER SQLERROR GOTO whoops;
- EXEC IAF GET EMP.ENAME INTO :ename;
- if (strncmp(ename, "OATES", 5))
- {
- EXEC IAF PUT EMP.COMMENT VALUES ('is a very nice man');
- }
- else
- {
- EXEC IAF PUT EMP.COMMENT VALUES ('has a nice car');
- }
-
- i = 16;
- sqliem( "EXEC IAF success", &i );
- return( IAPSUCC );
- whoops:
- i=14;
- sqliem( "EXEC IAF error", &i );
- return( IAPFAIL );
- }