我有一个表,其中有一列如下:
ppbacct_status CHAR(1) default ' ' not null,
然后我关注 pro*c:
EXEC SQL BEGIN DECLARE SECTION;
sql_context ctx = NULL;
char v_p_status_1 = ' ';
EXEC SQL END DECLARE SECTION;
EXEC SQL select ppbacct_status into :v_p_status_1 from ppbaccount
where exchange_type = '1' and branch_no = 1854 and stock_account = 'A001854009';
printf("|%c|, |%d|\n", v_p_status_1, v_p_status_1); // here get: | |, |32|
EXEC SQL update ppbaccount set remark = 'a'||:v_p_status_1||'a' where exchange_type = '1' and branch_no = 1854 and stock_account = 'A001854005'; // 'aa'
上次更新后,我得到备注栏为'aa',为什么不是'aa',空间在哪里?
Oracle 版本:10.2.0.1,用 CentOS 5.5。</p>
PRO*C 标志:
CPP_PROFLAGS=ireclen=132 oreclen=132 \
select_error=yes \
mode=ansi \
userid=$(USERID) \
SQLCHECK=SYNTAX \
def_sqlcode=YES \
THREADS=YES \
CODE=CPP \
CHAR_MAP=CHARF \
CPP_SUFFIX=cpp \
PARSE=PARTIAL \
CLOSE_ON_COMMIT=YES \
MAXOPENCURSORS=60 \
DEFINE=USE_PRO_C \
HOLD_CURSOR=YES \
PREFETCH=200 \
include=$(ORACLE_HOME)/precomp/public \
include=$(ORACLE_HOME)/oci/include \
include=$(FBASE_HOME) \
include=/usr/lib/gcc-lib/i386-redhat-linux/$(GCC_VER)/include