/*
** example8.c
**
** This example illustrates how to use remote procedure calls
** and how to process return parameter values from stored
** procedures.
**
** The example uses the following stored procedure,
** named "rpctest", which it assumes is located in the
** user's default database. Before running this example,
** you must create "rpctest" in your default database.
**
** create procedure rpctest
** (@param1 int out,
** @param2 int out,
** @param3 int out,
** @param4 int)
** as
** begin
** select "rpctest is running."
** select @param1 = 11
** select @param2 = 22
** select @param3 = 33
** select @param1
**
** return 123
** end
**
*/
printf("Demo of SQL queries in a command batch\n\n");
fflush(stdout);
/* Initialize DB-Library. */
if (dbinit() == FAIL)
exit(ERREXIT);
/* Install the user-supplied error-handling and message-handling
* routines. They are defined at the bottom of this source file.
*/
dberrhandle((EHANDLEFUNC)err_handler);
dbmsghandle((MHANDLEFUNC)msg_handler);
/* Allocate and initialize the LOGINREC structure to be used
* to open a connection to SQL Server.
*/