home *** CD-ROM | disk | FTP | other *** search
- /*----------------------------------------------------------------*/
- /* */
- /* Example of sqloms() : Set Output Message Size */
- /* */
- /*----------------------------------------------------------------*/
-
- #include "sql.h"
- #include "stdio.h"
-
- /* error defines */
- #define APIERROR 1
-
- #define apierr(a) error(a,__LINE__, APIERROR)
-
- SQLTCUR cur = 0; /* SQLBASE cursor number */
- SQLTRCD rcd = 0; /* SQLBASE return code */
-
- main()
- {
-
- SQLTDAL insize=500;
- SQLTDAL outsize=500;
-
- static char dbnam[] = "demox"; /* database name */
-
- /* CONNECT TO THE DATABASE */
-
- cur = 0;
- if (rcd = sqlcnc(&cur, dbnam, 0)) /* perform connect operation */
- apierr("SQLCNC");
-
- if (rcd = sqlims(cur,insize))
- apierr("SQLIMS");
- else
- printf("Input Message Size set to = %d \n", insize);
-
- if (rcd = sqloms(cur,outsize))
- apierr("SQLOMS");
- else
- printf("Output Message Size set to = %d \n", outsize);
-
- /* DISCONNECT FROM THE DATABASE */
-
- if (rcd = sqldis(cur)) /* failure on disconnect? */
- apierr("SQLDIS");
- }
-
- /*
- ERROR - prints an error message for the utility
- */
- error(what, line, type)
- char* what; /* description of what happened */
- int line; /* line number where error occured */
- int type; /* type of error */
- {
- char msg[200]; /* error message buffer */
-
- sqlerr(rcd, msg); /* get the error message */
- printf("\nError: %s at line %d: %s, Error # %d\n", what, line, msg,rcd);
- }
-
-