用navicat怎么写sql语句句写,有人会吗,真的急求,在线等!!!!!!!

sql语句执行速度很慢,如何解决?在线等待! -PB- TryCatch
>> Content
sql语句执行速度很慢,如何解决?在线等待!
程序如下:for&k&=&1&to&li_count&&ls_sql&=&"insert&into&oflow&(flno,digest)&values("+:li_flno+",'"+:ls_digest+"')"&&execute&immediate&:ls_sql&using&next速度奇慢。要等待好久,才能从数据库中看到有数据插入,但是程序到实很快就执行完了。该如何解决呢?
------Solutions------
这样写的话不要假冒号&
------Solutions------
嵌入式的SQL语句才要加冒号&insert&oflow&(flno,digest)&values(:li_flno,&ls_digest)using&
------Solutions------
顶。。。为什么不直接嵌入?
------Solutions------
对了&&你循环完了之后有没有&commit&;&呢?在循环里也应该检查执行是否执行成功for&k&=&1&to&li_count&&insert&oflow&(flno,digest)&&&values(:li_flno,&:ls_digest)&&using&&if&SQLCA.SQLCode&&&&0&then&messageBox&("数据库错误",&"XXXX&!~r~n~r~n错误代码:"&+&&string&(sqlca.sqlDbCode)&+&"~r~n详细信息:"&+&&&sqlca.sqlERRText,&stopSign!)&&rollback&using&&&end&ifnextcommit&using&
------Solutions------
我写错了,程序里是没有冒号的。可以执行成功,就是速度慢。嵌入式的会执行速度快一些吗?这个我不是很明白!请指点!
------Solutions------
COmmit是必须的或者sqlca.autocommit&=&true
------Solutions------
在最后有一句commit,这个会影响速度吗?
------Solutions------
执行完应该立即commit&否则它会锁住当然&如果你的代码是事务的一部分&除外
------Solutions------
实在看不出楼主这段代码为何要用动态sql,白白浪费时间而已,而且单从这个代码片段看不出如何对程序进行优化
------Solutions------
为何一定要用动态sql??动态sql速度是会有些慢.&如果li_count大的话,回很明显的.其实可以用别的方法,比如游标什么的.
------Solutions------
建议你还是用数据窗口控件
------Solutions------
commit是肯定要的,游标的效率在数据量大的时候也很低,尽量少用
------Solutions------
whchen(土龙):这种情况如何用数据窗口控件呢?关于SQL语句的like查询问题!!!在线等答案!!!_百度知道
关于SQL语句的like查询问题!!!在线等答案!!!
找?;value1’这个模式的字符串)但是我要查找的value1 就是“%”百分号??:select * from table1 where field1 like ’%value1%’ (所有包含&#39!?!怎么查呢?
提问者采纳
select * from table1 where field1 like '%[%]%'
提问者评价
谢谢就是这个~万分感谢
其他类似问题
为您推荐:
sql语句的相关知识
其他4条回答
select * from table1 where field1 like '%%%'直接like就行了啊
substring(value1,1,2)='%%' 用这个函数就可以了
select * from table1 where field1 like ’%[value1]%’加上[]试试
value1='[%]';select * from table1 where field1 like '%[%]%’
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.

我要回帖

更多关于 navicat怎么写sql语句 的文章

 

随机推荐