#include "sql.h"
#include "dbf.h"
#include "sql.c"
#include "dbf.c"
/*+++++++++++++++++++++++++++++++++++++++++++++++++*/
int main()
{
int j;
char mark;
char t_name[40];
ShowBeginning();
while(1)
{
int i;
char order;
store();
for(i=0;sql[i]==' ';i++);
mark=tolower(sql[i]);
switch(mark)
{
case 'c':
if(Sql_CREATE())
printf("++++++++++++++++++++++++++++++++++建表成功!+++++++++++++++++++++++++++++++++++\n");
else
{
printf("++++++++++++++++++++++++++++++++++建表失败!+++++++++++++++++++++++++++++++++++\n");
continue;
}
break;
case 'a':
if(Sql_ALTER())
printf("++++++++++++++++++++++++++++++修改字段属性成功!+++++++++++++++++++++++++++++++\n");
else
{
printf("++++++++++++++++++++++++++++++修改字段属性失败!+++++++++++++++++++++++++++++++\n");
continue;
}
break;
case 'o':
for(i=0;sql[i]!=' ';i++);
for(;sql[i]==' ';i++);
for(j=0;sql[i]!=' '&&sql[i]!=';';i++,j++)
{t_name[j]=sql[i];}
t_name[j]='.';
t_name[j+1]='d';
t_name[j+2]='b';
t_name[j+3]='f';
t_name[j+4]='\0';
case 'h':
help();
break;
default:
printf("输入错误,请重新输入!\n");
}
printf("是否继续操作,请选择(y/n)\n");
while((order=getchar())=='\n');
while(getchar()!='\n');
while(order != 'n' && order != 'y')
{
printf("你输入错误,请重新选择(y/n)\n");
while((order=getchar())=='\n');
while(getchar()!='\n');
}
if(order=='n')break;
}
}
评论0