📄 dbinterface.c
字号:
}
# line 176 "dbInterface.cpp"
# line 176 "dbInterface.cpp"
_sql->retcode = _sqlepilog(_sql);
# line 176 "dbInterface.cpp"
}
# line 176 "dbInterface.cpp"
# line 176 "dbInterface.cpp"
}
# line 176 "dbInterface.cpp"
# line 176 "dbInterface.cpp"
}
# line 176 "dbInterface.cpp"
/*
** Generated code ends here.
*/
# line 176 "dbInterface.cpp"
if(sqlca.sqlcode < 0) return sqlca.sqlcode;
if(sqlca.sqlcode == 0)
{
memcpy(pNums->MSISDN_AlarmList,Strategy.MSISDN_AlarmList,sizeof((*pNums).MSISDN_AlarmList));
pNums->AlarmMode=Strategy.AlarmMode;
pNums->DelayCount=Strategy.DelayCount;
pNums->DelayTime=Strategy.DelayTime;
pNums->InfoType=Strategy.InfoType;
return 1;
}
else if(sqlca.sqlcode == 100)
{
/*exec sql close SMSendStrategy;*/
return 0;
}
return sqlca.sqlcode;
}
/*exec sql declare SMSendRecord cursor for select AlarmCode,(convert(char(10),SendTime,102))+' '+(convert(char(9),SendTime,108)),InfoType,Info from SapDB.dbo.TBL_SMSendRecord;*/
/*
** SQL STATEMENT: 17
** exec sql declare SMSendRecord cursor for select AlarmCode,(convert(char(10),Se
** ndTime,102))+' '+(convert(char(9),SendTime,108)),InfoType,Info from SapDB.db
** o.TBL_SMSendRecord a where not exists(select 1 from SapDB.dbo.TBL_SMSendReco
** rd where InfoType=a.InfoType and SendTime>a.SendTime);
*/
# line 196 "dbInterface.cpp"
int ReadSMSendRecord(SMSendRecord* pNums, int isFromBegin, int id)
{
/*
** SQL STATEMENT: 17
** exec sql begin declare section;
*/
# line 199 "dbInterface.cpp"
struct _SMSendRecord
{
CS_INT AlarmCode;
CS_CHAR SendTime[20];
CS_INT InfoType;
CS_CHAR Info[256];
} Strategy;
/*
** SQL STATEMENT: 18
** exec sql end declare section;
*/
# line 207 "dbInterface.cpp"
/*
** Generated code ends here.
*/
# line 207 "dbInterface.cpp"
if(0 != isFromBegin)
{
/*
** SQL STATEMENT: 19
** exec sql close SMSendRecord;
*/
# line 210 "dbInterface.cpp"
# line 210 "dbInterface.cpp"
{
# line 210 "dbInterface.cpp"
_SQL_CT_HANDLES * _sql;
# line 210 "dbInterface.cpp"
_sqlinitctx(&_sql, CS_VERSION_150, CS_TRUE, &sqlca, (long
# line 210 "dbInterface.cpp"
*)NULL, (CS_CHAR *)NULL);
# line 210 "dbInterface.cpp"
if (_sql != (_SQL_CT_HANDLES *) NULL)
# line 210 "dbInterface.cpp"
{
# line 210 "dbInterface.cpp"
_sql->stmtData.persistent = CS_FALSE;
# line 210 "dbInterface.cpp"
_sql->stmttype = SQL_CLOSE_STMT;
# line 210 "dbInterface.cpp"
_sql->connName.lnlen = CS_UNUSED;
# line 210 "dbInterface.cpp"
_sql->curName.fnlen = 12;
# line 210 "dbInterface.cpp"
strcpy(_sql->curName.first_name, "SMSendRecord");
# line 210 "dbInterface.cpp"
if ((_sql->retcode = _sqlprolog(_sql)) == CS_SUCCEED)
# line 210 "dbInterface.cpp"
{
# line 210 "dbInterface.cpp"
_sql->retcode = _sqlepilog(_sql);
# line 210 "dbInterface.cpp"
}
# line 210 "dbInterface.cpp"
# line 210 "dbInterface.cpp"
}
# line 210 "dbInterface.cpp"
# line 210 "dbInterface.cpp"
}
# line 210 "dbInterface.cpp"
/*
** Generated code ends here.
*/
# line 210 "dbInterface.cpp"
/*
** SQL STATEMENT: 20
** exec sql open SMSendRecord;
*/
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
_SQL_CT_HANDLES * _sql;
# line 211 "dbInterface.cpp"
_sqlinitctx(&_sql, CS_VERSION_150, CS_TRUE, &sqlca, (long
# line 211 "dbInterface.cpp"
*)NULL, (CS_CHAR *)NULL);
# line 211 "dbInterface.cpp"
if (_sql != (_SQL_CT_HANDLES *) NULL)
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
_sql->stmtData.persistent = CS_FALSE;
# line 211 "dbInterface.cpp"
_sql->moreData.curData.norebind = CS_FALSE;
# line 211 "dbInterface.cpp"
_sql->stmttype = SQL_OPEN_STMT;
# line 211 "dbInterface.cpp"
_sql->connName.lnlen = CS_UNUSED;
# line 211 "dbInterface.cpp"
_sql->curName.fnlen = 12;
# line 211 "dbInterface.cpp"
strcpy(_sql->curName.first_name, "SMSendRecord");
# line 211 "dbInterface.cpp"
if ((_sql->retcode = _sqlprolog(_sql)) == CS_SUCCEED)
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
if (_sql->doDecl == CS_TRUE)
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
_sql->retcode = ct_cursor(_sql->conn.command,
# line 211 "dbInterface.cpp"
CS_CURSOR_DECLARE, "SMSendRecord", 12, "select A"
"larmCode,(convert(char(10),SendTime,102))+' '+(convert(char(9),SendTime,108)),"
"InfoType,Info from SapDB.dbo.TBL_SMSendRecord a where not exists(select 1 from"
" SapDB.dbo.TBL_SMSendRecord where InfoType=a.InfoType and SendTime>a.SendTime)"
"", 242, CS_UNUSED);
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
if (_sql->retcode == CS_SUCCEED)
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
if (_sql->stmtData.persistent == CS_TRUE)
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
_sql->retcode = ct_cursor(_sql->conn.command,
# line 211 "dbInterface.cpp"
CS_CURSOR_OPEN, NULL, CS_UNUSED, NULL,
# line 211 "dbInterface.cpp"
CS_UNUSED, CS_RESTORE_OPEN);
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
else {
# line 211 "dbInterface.cpp"
_sql->retcode = ct_cursor(_sql->conn.command,
# line 211 "dbInterface.cpp"
CS_CURSOR_OPEN, NULL, CS_UNUSED, NULL,
# line 211 "dbInterface.cpp"
CS_UNUSED, CS_UNUSED);
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
if (_sql->retcode == CS_SUCCEED)
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
_sql->retcode = ct_send(_sql->conn.command);
# line 211 "dbInterface.cpp"
_sql->hastate = (_sql->retcode ==
# line 211 "dbInterface.cpp"
CS_RET_HAFAILOVER);
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
_sql->resloop = CS_TRUE;
# line 211 "dbInterface.cpp"
while ((!_sql->hastate) && (_sql->resloop == CS_TRUE)
# line 211 "dbInterface.cpp"
&& ((_sql->retcode = ct_results(_sql->conn.command,
# line 211 "dbInterface.cpp"
&_sql->restype)) == CS_SUCCEED))
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
switch ( _sql->restype )
# line 211 "dbInterface.cpp"
{
# line 211 "dbInterface.cpp"
case CS_COMPUTE_RESULT:
# line 211 "dbInterface.cpp"
_sqlsetintrerr(_sql, (CS_INT)
# line 211 "dbInterface.cpp"
_SQL_INTRERR_25003);
# line 211 "dbInterface.cpp"
_sql->retcode = ct_cancel(NULL,
# line 211 "dbInterface.cpp"
_sql->conn.command, CS_CANCEL_CURRENT);
# line 211 "dbInterface.cpp"
break;
# line 211 "dbInterface.cpp"
case CS_CURSOR_RESULT:
# line 211 "dbInterface.cpp"
_sql->resloop = CS_FALSE;
# line 211 "dbInterface.cpp"
break;
# line 211 "dbInterface.cpp"
case CS_PARAM_RESULT:
# line 211 "dbInterface.cpp"
_sqlsetintrerr(_sql, (CS_INT)
# line 211 "dbInterface.cpp"
_SQL_INTRERR_25005);
# line 211 "dbInterface.cpp"
_sql->retcode = ct_cancel(NULL,
# line 211 "dbInterface.cpp"
_sql->conn.command, CS_CANCEL_CURRENT);
# line 211 "dbInterface.cpp"
break;
# line 211 "dbInterface.cpp"
case CS_ROW_RESULT:
# line 211 "dbInterface.cpp"
_sqlsetintrerr(_sql, (CS_INT)
# line 211 "dbInterface.cpp"
_SQL_INTRERR_25006);
# line 211 "dbInterface.cpp"
_sql->retcode = ct_cancel(NULL,
# line 211 "dbInterface.cpp"
_sql->conn.command, CS_CANCEL_CURRENT);
# line 211 "dbInterface.cpp"
break;
# line 211 "dbInterface.cpp"
case CS_STATUS_RESULT:
# line 211 "dbInterface.cpp"
_sqlsetintrerr(_sql, (CS_INT)
# line 211 "dbInterface.cpp"
_SQL_INTRERR_25009);
# line 211 "dbInterface.cpp"
_sql->retcode = ct_cancel(NULL,
# line 211 "dbInterface.cpp"
_sql->conn.command, CS_CANCEL_CURRENT);
# line 211 "dbInterface.cpp"
break;
# line 211 "dbInterface.cpp"
case CS_DESCRIBE_RESULT:
# line 211 "dbInterface.cpp"
_sqlsetintrerr(_sql, (CS_INT)
# line 211 "dbInterface.cpp"
_SQL_INTRERR_25010);
# line 211 "dbInterface.cpp"
break;
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
_sql->retcode = _sqlepilog(_sql);
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
# line 211 "dbInterface.cpp"
}
# line 211 "dbInterface.cpp"
/*
** Generated code ends here.
*/
# line 211 "dbInterface.cpp"
if(sqlca.sqlcode < 0) return sqlca.sqlcode;
}
memset(&Strategy, 0, sizeof(Strategy));
/*
** SQL STATEMENT: 21
** exec sql fetch SMSendRecord into :Strategy.AlarmCode, :Strategy.Sen
** dTime,:Strategy.InfoType,:Strategy.Info;
*/
# line 216 "dbInterface.cpp"
# line 216 "dbInterface.cpp"
{
# line 216 "dbInterface.cpp"
_SQL_CT_HANDLES * _sql;
# line 216 "dbInterface.cpp"
_sqlinitctx(&_sql, CS_VERSION_150, CS_TRUE, &sqlca, (long
# line 216 "dbInterface.cpp"
*)NULL, (CS_CHAR *)NULL);
# line 216 "dbInterface.cpp"
if (_sql != (_SQL_CT_HANDLES *) NULL)
# line 216 "dbInterface.cpp"
{
# line 216 "dbInterface.cpp"
_sql->stmtData.persistent = CS_FALSE;
# line 216 "dbInterface.cpp"
_sql->stmttype = SQL_FETCH_STMT;
# line 216 "dbInterface.cpp"
_sql->connName.lnlen = CS_UNUSED;
# line 216 "dbInterface.cpp"
_sql->curName.fnlen = 12;
# line 216 "dbInterface.cpp"
strcpy(_sql->curName.first_name, "SMSendRecord");
# line 216 "dbInterface.cpp"
if ((_sql->retcode = _sqlpr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -