/****************************************************************************** ** ** Source File Name = setact.c ** ** Licensed Materials - Property of IBM ** ** (C) COPYRIGHT International Business Machines Corp. 1995, 2000 ** All Rights Reserved. ** ** US Government Users Restricted Rights - Use, duplication or ** disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ** ** ** PURPOSE : ** an example showing how the SET ACCOUNTING STRING WORKS. ** ** APIs USED : ** SET ACCOUNTING STRING sqlesact ** ** STRUCTURES USED : ** sqlca ** ** OTHER FUNCTIONS USED : ** 'C' COMPILER LIBRARY : ** stdio.h - printf ** ** external : ** check_error : Checks for SQLCODE error, and prints out any ** [in UTIL.C] related information available. ** This procedure is located in the UTIL.C file. ** ** EXTERNAL DEPENDENCIES : ** - Ensure existence of database for precompile purposes. ** - Compile and link with the IBM Cset++ compiler (AIX and OS/2) ** or the Microsoft Visual C++ compiler (Windows) ** or the compiler supported on your platform. ** ** For more information about these samples see the README file. ** ** For more information on programming in C, see the: ** - "Programming in C and C++" section of the Application Development Guide ** For more information on Building C Applications, see the: ** - "Building C Applications" section of the Application Building Guide. ** ** For more information on the SQL language see the SQL Reference. ** *******************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sqlenv.h> #include "utilapi.h" int main (void) { struct sqlca sqlca; char pAccountingString[SQL_ACCOUNT_STR_SZ+1]; printf ("this is sample program 'setact.c'\n"); /***********************\ * SET ACCOUNTING STRING * \***********************/ sqlesact (pAccountingString, &sqlca); API_SQL_CHECK("SET ACCOUNTING STRING"); printf ("the accounting string has been set\n"); return 0; }