c++向oracle数据库中插入数据,执行后数据库里有数据,可c的程序有错求指点
RETCODEretcode;inta;charstr[40];strcpy(str,"insertintoDdegree(num,name,sex,borntime,d...
RETCODE retcode;
int a;
char str[40];
strcpy(str,"insert into Ddegree(num,name,sex,borntime,degree) values('");
char Num[8];
char Name[20];
char Sex[10];
char date[20];
//char Age[2];
char degree[5];
//double Salary;
cout<<"请输入工号,姓名,性别,出生日期,学位(大专,本科,硕士或博士)"<<endl;
cin>>Num>>Name>>Sex>>date>>degree;
strcat(str,Num);
strcat(str,"','");
strcat(str,Name);
strcat(str,"','");
strcat(str,Sex);
strcat(str,"','");
strcat(str,date);
strcat(str,"','");
strcat(str,degree);
strcat(str,"')");
cout<<str<<endl; 展开
int a;
char str[40];
strcpy(str,"insert into Ddegree(num,name,sex,borntime,degree) values('");
char Num[8];
char Name[20];
char Sex[10];
char date[20];
//char Age[2];
char degree[5];
//double Salary;
cout<<"请输入工号,姓名,性别,出生日期,学位(大专,本科,硕士或博士)"<<endl;
cin>>Num>>Name>>Sex>>date>>degree;
strcat(str,Num);
strcat(str,"','");
strcat(str,Name);
strcat(str,"','");
strcat(str,Sex);
strcat(str,"','");
strcat(str,date);
strcat(str,"','");
strcat(str,degree);
strcat(str,"')");
cout<<str<<endl; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询