#include<string>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
#include<fcntl.h>
#include<errno.h>
#include<time.h>
int main()
{
FILE *fs=fopen("/root/uvsync/test.sql","w+");
if(fs)
{
fputs("insert into test (id,name) values('2','hello world2');",fs);
printf("ok");
}
else
{
printf("error");
}
fclose(fs);
char cmd_sql[100];
sprintf(cmd_sql,"sqlplus 用户名/密码 @%s","test.sql");
system(cmd_sql);
}