今早弄的,matlab中调用不同的sql代码,复制粘贴的要修改换行符号是不是很麻烦?原来可以粘贴到字符串变量内,方便快捷,妈妈再也不用担心我的学习了!
本帖隐藏的内容
- prompt={'Input the sql','Input the tablename'};
- dlg_title='SQL';
- num_lines=1;
- def={'','focusdaily'};
- tempsql=inputdlg(prompt,dlg_title,num_lines,def);
- sql=char(tempsql{1,1});%sql
- tablename=char(tempsql{2,1});%表名
- conn2=database(tablename,'root','888888','com.mysql.jdbc.Driver',['jdbc:mysql://192.168.1.105:3306/',tablename]);
- cursorA = exec(conn2,sql);
- cursorA=fetch(cursorA);
- data=cursorA.data;



雷达卡








[cry][cry]
京公网安备 11010802022788号







