请问字段mm 类型 varchar2 在ASP中写SQL语句出错. sql="select count(*) from aa where mm='"&request.form("cc")&"' " 提示:user requested cancel of current operation 请问是什么原因呢? 不胜感谢. varchar2 在查询中是否也要使用函数定义格式呢?
估计这不是数据库端的问题,是ASP的问题。
不好意思,这个错误确实是ORACLE的错误,我帮你在METALINK上查一下。
Problem Explanation: ==================== ADO gives an interface to execute the stored procedure called command object. ADO has a property called CommandTimeout which is by default set to 30 seconds. If the stored procedure is taking longer than this, the execution of the stored procedure is canceled and user gets the above error. Problem Solution: ================= Set the CommandTimeout property of the command Object to 0 programatically. Note: ====== Setting the CommandTimeout on the Connection Object is not the same as setting it on the Command object. See the following excerpt from the ADO API Reference: The CommandTimeout setting on a Connection object has no effect on the CommandTimeout setting on a Command object on the same Connection; that is, the Command object's CommandTimeout property does not inherit the value of the Connection object's CommandTimeout value. Basically, you can set this on the Command Object but setting this on the Connection object will have no effect. Also, since the CommandTimeout uses OCIBreak, it is subjected to the limitations of that call. Meaning it may not work consistently on windows. This same call will not work with the Oracle Provider for OLE DB, since it does not implement OCIBreak in the provider. This will only work with the Oracle ODBC Driver.
select * from aa where workday = TO_DATE('28052003','DDMMYYYY');
不用使用函数,语句没有错语 sql="select count(*) from aa where mm='"&request("cc")&"'"
效率比较高
不够速度好象较慢。
请问用select * from aa where workday BETWEEN TRUNC(SYSDATE) AND TRUNC(SYSDATE+1)
那么sysdate是什么?是今天吗?
那如果我要写某一天呢?
TO_DATE(20030501,'YYYYMMDD')
在ASP中写SQL语句出错.
sql="select count(*) from aa where mm='"&request.form("cc")&"' "
提示:user requested cancel of current operation
请问是什么原因呢?
不胜感谢.
varchar2 在查询中是否也要使用函数定义格式呢?
====================
ADO gives an interface to execute the stored procedure called command object. ADO has a property called CommandTimeout which is by default set to 30 seconds. If the stored procedure is taking longer than this, the execution of the stored procedure is canceled and user gets the above error. Problem Solution:
=================
Set the CommandTimeout property of the command Object to 0 programatically. Note:
======
Setting the CommandTimeout on the Connection Object is not the same as setting it on the Command object. See the following excerpt from the ADO API Reference: The CommandTimeout setting on a Connection object has no effect on the CommandTimeout setting on a Command object on the same Connection; that is, the Command object's CommandTimeout property does not inherit the value of the Connection object's CommandTimeout value. Basically, you can set this on the Command Object but setting this on the Connection object will have no effect. Also, since the CommandTimeout uses OCIBreak, it is subjected to the limitations of that call. Meaning it may not work consistently on windows. This same call will not work with the Oracle Provider for OLE DB, since it does not implement OCIBreak in the provider. This will only work with the Oracle ODBC Driver.
sql="select count(*) from aa where mm='"&request("cc")&"'"