1- /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.27 2001/10/02 14:08:28 meskes Exp $ */
1+ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.28 2001/10/05 17:37:07 meskes Exp $ */
22
33/*
44 * The aim is to get a simpler inteface to the database routines.
@@ -182,7 +182,6 @@ create_statement(int lineno, struct connection * connection, struct statement **
182182/* if variable is NULL, the statement hasn't been prepared */
183183if (var -> pointer == NULL )
184184{
185- ECPGlog ("create_statement: invalid statement name\n" );
186185ECPGraise (lineno ,ECPG_INVALID_STMT ,NULL );
187186free (var );
188187return false;
@@ -405,7 +404,6 @@ ECPGstore_result(const PGresult *results, int act_field,
405404 */
406405if (var -> arrsize == 0 )
407406{
408- ECPGlog ("ECPGexecute line %d: variable is not an array\n" );
409407ECPGraise (stmt -> lineno ,ECPG_NO_ARRAY ,NULL );
410408return false;
411409}
@@ -942,7 +940,7 @@ ECPGexecute(struct statement * stmt)
942940
943941if (ntuples < 1 )
944942{
945- ECPGlog ("ECPGexecute line %d: Incorrect number of matches: %d\n" ,
943+ if ( ntuples ) ECPGlog ("ECPGexecute line %d: Incorrect number of matches: %d\n" ,
946944stmt -> lineno ,ntuples );
947945ECPGraise (stmt -> lineno ,ECPG_NOT_FOUND ,NULL );
948946status = false;
@@ -957,15 +955,14 @@ ECPGexecute(struct statement * stmt)
957955PQclear (* resultpp );
958956* resultpp = results ;
959957clear_result = FALSE;
960- ECPGlog ("ECPGexecute putting result into descriptor '%s'\n" , (const char * )var -> pointer );
958+ ECPGlog ("ECPGexecute putting result(%d tuples) into descriptor '%s'\n" , PQntuples ( results ) , (const char * )var -> pointer );
961959}
962960var = var -> next ;
963961}
964962else for (act_field = 0 ;act_field < nfields && status ;act_field ++ )
965963{
966964if (var == NULL )
967965{
968- ECPGlog ("ECPGexecute line %d: Too few arguments.\n" ,stmt -> lineno );
969966ECPGraise (stmt -> lineno ,ECPG_TOO_FEW_ARGUMENTS ,NULL );
970967return (false);
971968}
@@ -1068,8 +1065,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
10681065if (con == NULL || con -> connection == NULL )
10691066{
10701067free_statement (stmt );
1071- ECPGlog ("ECPGdo: not connected to %s\n" ,con -> name );
1072- ECPGraise (lineno ,ECPG_NOT_CONN ,NULL );
1068+ ECPGraise (lineno ,ECPG_NOT_CONN , (con ) ?con -> name :"<empty>" );
10731069setlocale (LC_NUMERIC ,oldlocale );
10741070free (oldlocale );
10751071return false;