/*
* ---Implementations---
*/
-short INGgetCols(INGconn *conn, const char *query, bool transaction)
+short INGgetCols(INGconn *dbconn, const char *query, bool transaction)
{
/* # line 52 "myingres.sc" */
/*
* Switch to the correct default session for this thread.
*/
- sess_id = conn->session_id;
+ sess_id = dbconn->session_id;
/* # line 71 "myingres.sc" */ /* set_sql */
{
IILQssSetSqlio(11,(short *)0,1,30,sizeof(sess_id),&sess_id);
/* # line 371 "myingres.sc" */ /* open */
{
IIsqInit(&sqlca);
- IIcsOpen((char *)"c2",14614,8429);
+ IIcsOpen((char *)"c2",30801,28581);
IIwritio(0,(short *)0,1,32,0,(char *)"s2");
- IIcsQuery((char *)"c2",14614,8429);
+ IIcsQuery((char *)"c2",30801,28581);
if (sqlca.sqlcode < 0)
goto bail_out;
}
/* # line 377 "myingres.sc" */ /* fetch */
{
IIsqInit(&sqlca);
- if (IIcsRetScroll((char *)"c2",14614,8429,-1,-1) != 0) {
+ if (IIcsRetScroll((char *)"c2",30801,28581,-1,-1) != 0) {
IIcsDaGet(0,desc);
IIcsERetrieve();
} /* IIcsRetrieve */
/* # line 400 "myingres.sc" */ /* close */
{
IIsqInit(&sqlca);
- IIcsClose((char *)"c2",14614,8429);
+ IIcsClose((char *)"c2",30801,28581);
}
/* # line 402 "myingres.sc" */ /* host code */
ing_res->status = ING_COMMAND_OK;
{
return res->fields[column_number].type;
}
-int INGexec(INGconn *conn, const char *query, bool transaction)
+int INGexec(INGconn *dbconn, const char *query, bool transaction)
{
int check;
/* # line 485 "myingres.sc" */
/*
* Switch to the correct default session for this thread.
*/
- sess_id = conn->session_id;
+ sess_id = dbconn->session_id;
/* # line 498 "myingres.sc" */ /* set_sql */
{
IILQssSetSqlio(11,(short *)0,1,30,sizeof(sess_id),&sess_id);
free(stmt);
return rowcount;
}
-INGresult *INGquery(INGconn *conn, const char *query, bool transaction)
+INGresult *INGquery(INGconn *dbconn, const char *query, bool transaction)
{
/*
* TODO: error handling
IISQLDA *desc = NULL;
INGresult *res = NULL;
int rows = -1;
- int cols = INGgetCols(conn, query, transaction);
+ int cols = INGgetCols(dbconn, query, transaction);
/* # line 532 "myingres.sc" */
int sess_id;
/*
* Switch to the correct default session for this thread.
*/
- sess_id = conn->session_id;
+ sess_id = dbconn->session_id;
/* # line 540 "myingres.sc" */ /* set_sql */
{
IILQssSetSqlio(11,(short *)0,1,30,sizeof(sess_id),&sess_id);
INGfreeDescriptor(res->sqlda);
INGfreeINGresult(res);
}
-void INGcommit(const INGconn *conn)
+void INGcommit(const INGconn *dbconn)
{
/* # line 587 "myingres.sc" */
free(dbconn);
}
}
-char *INGerrorMessage(const INGconn *conn)
+char *INGerrorMessage(const INGconn *dbconn)
{
/* # line 682 "myingres.sc" */
IILQisInqSqlio((short *)0,1,32,255,errbuf,63);
}
/* # line 687 "myingres.sc" */ /* host code */
- strncpy(conn->msg, errbuf, sizeof(conn->msg));
- return conn->msg;
+ strncpy(dbconn->msg, errbuf, sizeof(dbconn->msg));
+ return dbconn->msg;
}
char *INGcmdTuples(INGresult *res)
{
return res->numrowstring;
}
/* TODO?
-int INGputCopyEnd(INGconn *conn, const char *errormsg);
-int INGputCopyData(INGconn *conn, const char *buffer, int nbytes);
+int INGputCopyEnd(INGconn *dbconn, const char *errormsg);
+int INGputCopyData(INGconn *dbconn, const char *buffer, int nbytes);
*/
/* # line 701 "myingres.sc" */
#endif
/*
* ---Implementations---
*/
-short INGgetCols(INGconn *conn, const char *query, bool transaction)
+short INGgetCols(INGconn *dbconn, const char *query, bool transaction)
{
EXEC SQL BEGIN DECLARE SECTION;
int sess_id;
/*
* Switch to the correct default session for this thread.
*/
- sess_id = conn->session_id;
+ sess_id = dbconn->session_id;
EXEC SQL SET_SQL (SESSION = :sess_id);
EXEC SQL WHENEVER SQLERROR GOTO bail_out;
return res->fields[column_number].type;
}
-int INGexec(INGconn *conn, const char *query, bool transaction)
+int INGexec(INGconn *dbconn, const char *query, bool transaction)
{
int check;
EXEC SQL BEGIN DECLARE SECTION;
/*
* Switch to the correct default session for this thread.
*/
- sess_id = conn->session_id;
+ sess_id = dbconn->session_id;
EXEC SQL SET_SQL (SESSION = :sess_id);
EXEC SQL WHENEVER SQLERROR GOTO bail_out;
return rowcount;
}
-INGresult *INGquery(INGconn *conn, const char *query, bool transaction)
+INGresult *INGquery(INGconn *dbconn, const char *query, bool transaction)
{
/*
* TODO: error handling
IISQLDA *desc = NULL;
INGresult *res = NULL;
int rows = -1;
- int cols = INGgetCols(conn, query, transaction);
+ int cols = INGgetCols(dbconn, query, transaction);
EXEC SQL BEGIN DECLARE SECTION;
int sess_id;
EXEC SQL END DECLARE SECTION;
/*
* Switch to the correct default session for this thread.
*/
- sess_id = conn->session_id;
+ sess_id = dbconn->session_id;
EXEC SQL SET_SQL (SESSION = :sess_id);
desc = INGgetDescriptor(cols, query);
INGfreeINGresult(res);
}
-void INGcommit(const INGconn *conn)
+void INGcommit(const INGconn *dbconn)
{
EXEC SQL BEGIN DECLARE SECTION;
int sess_id;
}
}
-char *INGerrorMessage(const INGconn *conn)
+char *INGerrorMessage(const INGconn *dbconn)
{
EXEC SQL BEGIN DECLARE SECTION;
char errbuf[256];
EXEC SQL END DECLARE SECTION;
EXEC SQL INQUIRE_INGRES (:errbuf = ERRORTEXT);
- strncpy(conn->msg, errbuf, sizeof(conn->msg));
- return conn->msg;
+ strncpy(dbconn->msg, errbuf, sizeof(dbconn->msg));
+ return dbconn->msg;
}
char *INGcmdTuples(INGresult *res)
}
/* TODO?
-int INGputCopyEnd(INGconn *conn, const char *errormsg);
-int INGputCopyData(INGconn *conn, const char *buffer, int nbytes);
+int INGputCopyEnd(INGconn *dbconn, const char *errormsg);
+int INGputCopyData(INGconn *dbconn, const char *buffer, int nbytes);
*/
#endif