cat > script.cc <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
#include	<mscc.h>
#include <stdlib.h>
void	error	(int	i);
EXEC SQL INCLUDE SQLCA;
EXEC SQL BEGIN DECLARE SECTION ;
/* short */		char			v_shortint;
/* int */		short	int		*v_int;
/* longint */		long			*v_longint1; 
/* longint */		long	int 		*v_longint2; 
/* real */		float			*v_real; 
/* float */		float			*v_float; 
/* double precision */	double			*v_double;
/* data */		long			*v_date;
/* time */		long			*v_time;
EXEC SQL END DECLARE SECTION ;

int	main (int argc, char** argv)
{
	EXEC SQL INIT;
	EXEC SQL DATABASE IS "TEST_DATABASE";

	v_int = (short *) malloc (sizeof(short));
	v_longint1 = (long *) malloc (sizeof(long));
	v_longint2 = (long int *) malloc (sizeof(long int));
	v_real = (float *) malloc (sizeof(float));
	v_float = (float *) malloc (sizeof(float));
	v_double = (double *) malloc (sizeof(double));
	v_date = (long *) malloc (7 * sizeof(long));
	v_time = (long *) malloc (7 * sizeof(long));

	fflush (stdout);
	EXEC SQL SELECT a_int,a_longint,a_longint,a_real,a_float,a_double,
		a_date,a_time FROM type 
		INTO :v_int,:v_longint1,:v_longint2,
		:v_real,:v_float,:v_double,:v_date,:v_time
		WHERE a_char = "char";
	if(SQLCODE != 0) error(1);
	printf("%d %ld %ld\n",v_int[0],v_longint1[0],v_longint2[0]);
	printf("%f %f %f\n",v_real[0],v_float[0],v_double[0]);
	printf("%ld %ld %ld %ld %ld %ld %ld %ld %ld\n", 
		v_date[0],v_date[1],v_date[2],
		v_time[0],v_time[1],v_time[2],v_time[3],v_time[4],v_time[5]);
	EXEC SQL EXIT ;
	return 0;
}
void	error (int	i)
{
	printf("error number %d\n",i);
	printf("SQLCODE number %ld\n",SQLCODE);
	exit(1);
}
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 script.cc
cat > stdout <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
200 20000 20000
321.000000 54321000.000000 98765432.100000
1992 7 10 1992 8 11 9 32 18
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout
cat > tag <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
internal format (integer,float,date,time)
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 tag
