- 论坛徽章:
- 0
|
小弟编程如下,要查询表内数据:
可是明明有符合要求记录,为什么还是显示不出啊!!!
求高人指点啊!!!!!!!!!!!!!!
#include < sqlca.h >; //声明SQL通讯区
#include <stdlib.h>;
#include < string.h >;
#include<stdio.h>;
EXEC SQL INCLUDE sqlca;
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR username[20],password[20],dbname[20],f_no[20];
VARCHAR data[20];
EXEC SQL END DECLARE SECTION;
void connect();
void main()
{
if(sqlca.sqlcode==0)
printf("连接成功\n" ;
else
printf("%.*s\n",sqlca.sqlerrm.sqlerrml,sqlca.sqlerrm.sqlerrmc);
printf("enter data:" ;
scanf("%d",&data);
fflush(stdin);
EXEC SQL SELECT F_CORPORATIONNO INTO :f_no FROM pboradb.T_HF_HOSINGACCFUND_TMP WHERE UPPER(F_BANK_UPDATE)=UPPER(:data);
if (sqlca.sqlcode==0)
printf("position : %s\n",f_no);
else
printf("not exit such a user!\n" ;
}
void connect()
{
strcpy((char *)username.arr,"xxx" ;
username.len = strlen((char *)username.arr);
strcpy((char *)password.arr,"yyy" ;
password.len = strlen((char *)password.arr);
strcpy((char *)dbname.arr,"zzz" ;
dbname.len = strlen((char *)dbname.arr);
EXEC SQL CONNECT :username IDENTIFIED BY :password USING:dbname;
}
表内有:
Name Null? Type
----------------------------------------- -------- ----------------------------
F_CORPORATIONNO NOT NULL CHAR(13)
F_HOSINGACCFUNDNO NOT NULL CHAR(
F_CUSTOMER NOT NULL VARCHAR2(16)
F_CERTIFICATENO NOT NULL VARCHAR2(1
F_CORPORATION NOT NULL VARCHAR2(40)
F_TOTAL_BAL NOT NULL VARCHAR2(10)
F_HFUNDACC_BAL NOT NULL VARCHAR2(10)
F_HALLOWANCEACC_BAL NOT NULL VARCHAR2(10)
F_COPAY_BAL NOT NULL VARCHAR2(
F_POPAY_BAL NOT NULL VARCHAR2(
F_ACC_FLAG NOT NULL CHAR(1)
F_FROZEN_FLAG NOT NULL CHAR(1)
F_PAY_DATE NOT NULL CHAR(
F_HAFMD_UPDATE NOT NULL CHAR(
F_SJSUNCARDNO NOT NULL CHAR(16)
F_BANKOP_FLAG NOT NULL CHAR(1)
F_BANK_UPDATE NOT NULL CHAR(
我确定我输入条件正确,可是为什么还是显示找不出呢!!!!
求求各位拉,很简单的程序啊 |
|