

int main(int argc, char** argv)
{
char vidRep[6]; 
char vdateRep[11]; 
char vheureRep[5];
int vnbPlaces; 
char vidArtiste[6];
int fin=1;
int vnbMax;
short indic;
	
	EXEC SQL WHENEVER SQLERROR DO sql_error("Pb connexion\n");
	printf("\n Appel de la fonction connexion");
	connexion();
	
	EXEC SQL DECLARE rep CURSOR FOR SELECT idRep, nbplaces FROM representation;
	EXEC SQL OPEN rep;

	EXEC SQL FETCH rep INTO :vidRep, :vnbPlaces:indic;
	if (sqlca.sqlcode == +1403) {fin = 0;}
	while  (fin!=0)
        {       
		vidRep[5]='\0';
		printf("\n num representation: %s \n",vidRep);
		if (indic==-1)
			printf("\n nb max?: ");
			scanf ("%d%*c", &vnbMax);
			EXEC SQL update representation set nbPlaces = :vnbMax where idRep=:vidRep;
			EXEC SQL commit;
		EXEC SQL FETCH rep INTO :vidRep, :vnbPlaces:indic;
		if (sqlca.sqlcode == +1403) {fin = 0;}
		}
      printf(" Fini \n");
	EXEC SQL CLOSE rep;

	deconnexion(1);
	return(0);
}


