|
我看到一个系统源码里包含了许多后缀为.pc的文件,里面的内容类似于:
[code:1]
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL include "TblSlmtIns.h";
EXEC SQL include sqlca;
EXEC SQL include sqlda;
EXEC SQL END DECLARE SECTION;
SINT4 lQTblSlmtInsOpr(
SINT2 vnOprType,
tbl_slmt_ins_def* vtpTblSlmtIns) {
EXEC SQL BEGIN DECLARE SECTION;
tbl_slmt_ins_def ltTblSlmtIns;
EXEC SQL END DECLARE SECTION;
memcpy(
<TblSlmtIns,
vtpTblSlmtIns,
sizeof(ltTblSlmtIns));
switch(vnOprType) {
case NTblCur1:
EXEC SQL DECLARE
cur_slmt_ins_1
CURSOR FOR SELECT
l_usage_key,
i_slmt_ins_index,
sa_slmt_rcv_ins_id,
sa_slmt_fwd_ins_id,
sa_slmt_dft_ins_id,
l_rec_updt_usr_id,
tm_rec_updt_time,
tm_rec_crt_time
FROM
tbl_slmt_ins
WHERE
(l_usage_key = :ltTblSlmtIns.l_usage_key) AND
(i_slmt_ins_index = :ltTblSlmtIns.i_slmt_ins_index) AND
(sa_slmt_rcv_ins_id >= :ltTblSlmtIns.sa_slmt_rcv_ins_id)
ORDER BY
l_usage_key,
i_slmt_ins_index,
sa_slmt_rcv_ins_id;
return LUsrErrNull;
case NTblOpen1:
EXEC SQL OPEN
cur_slmt_ins_1;
if(sqlca.sqlcode) {
glSysError = sqlca.sqlcode;
return LUsrErrQTblSlmtInsOpr;
} /* end of if */
return LUsrErrNull;
case NTblFetch1:
EXEC SQL FETCH
cur_slmt_ins_1
INTO
:ltTblSlmtIns.l_usage_key,
:ltTblSlmtIns.i_slmt_ins_index,
:ltTblSlmtIns.sa_slmt_rcv_ins_id,
:ltTblSlmtIns.sa_slmt_fwd_ins_id,
:ltTblSlmtIns.sa_slmt_dft_ins_id,
:ltTblSlmtIns.l_rec_updt_usr_id,
:ltTblSlmtIns.tm_rec_updt_time,
:ltTblSlmtIns.tm_rec_crt_time;
if(sqlca.sqlcode) {
glSysError = sqlca.sqlcode;
return LUsrErrQTblSlmtInsOpr;
} /* end of if */
memcpy(
vtpTblSlmtIns,
<TblSlmtIns,
sizeof(*vtpTblSlmtIns));
return LUsrErrNull;
case NTblClose1:
EXEC SQL CLOSE
cur_slmt_ins_1;
if(sqlca.sqlcode) {
glSysError = sqlca.sqlcode;
return LUsrErrQTblSlmtInsOpr;
} /* end of if */
return LUsrErrNull;
case NTblSelect1:
EXEC SQL SELECT
l_usage_key,
i_slmt_ins_index,
sa_slmt_rcv_ins_id,
sa_slmt_fwd_ins_id,
sa_slmt_dft_ins_id,
l_rec_updt_usr_id,
tm_rec_updt_time,
tm_rec_crt_time
INTO
:ltTblSlmtIns.l_usage_key,
:ltTblSlmtIns.i_slmt_ins_index,
:ltTblSlmtIns.sa_slmt_rcv_ins_id,
:ltTblSlmtIns.sa_slmt_fwd_ins_id,
:ltTblSlmtIns.sa_slmt_dft_ins_id,
:ltTblSlmtIns.l_rec_updt_usr_id,
:ltTblSlmtIns.tm_rec_updt_time,
:ltTblSlmtIns.tm_rec_crt_time
FROM
tbl_slmt_ins
WHERE
(l_usage_key = :ltTblSlmtIns.l_usage_key) AND
(i_slmt_ins_index = :ltTblSlmtIns.i_slmt_ins_index) AND
(sa_slmt_rcv_ins_id = (
SELECT
MIN(sa_slmt_rcv_ins_id)
FROM
tbl_slmt_ins
WHERE
(l_usage_key = :ltTblSlmtIns.l_usage_key) AND
(i_slmt_ins_index = :ltTblSlmtIns.i_slmt_ins_index) AND
(sa_slmt_rcv_ins_id >= :ltTblSlmtIns.sa_slmt_rcv_ins_id)));
if(sqlca.sqlcode) {
glSysError = sqlca.sqlcode;
return LUsrErrQTblSlmtInsOpr;
} /* end of if */
if(memcmp(
<TblSlmtIns.sa_slmt_rcv_ins_id[0],
&vtpTblSlmtIns->sa_slmt_rcv_ins_id[0],
sizeof(vtpTblSlmtIns->sa_slmt_rcv_ins_id)))
memcpy(
<TblSlmtIns.sa_slmt_fwd_ins_id[0],
<TblSlmtIns.sa_slmt_dft_ins_id[0],
sizeof(ltTblSlmtIns.sa_slmt_fwd_ins_id));
memcpy(
vtpTblSlmtIns,
<TblSlmtIns,
sizeof(*vtpTblSlmtIns));
return LUsrErrNull;
default:
glSysError = LSqlErrorUnknownOpr;
return LUsrErrQTblSlmtInsOpr;
} /* end of switch */
} /* end of lQTblSlmtInsOpr */
[/code:1]
请问这是什么文件?什么语法? |
|