存档

文章标签 ‘Oracle’

[ASP.NET] System.Exception: System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本

2009年6月2日 stone 没有评论

环境:WIN2003+IIS+Oracle 9i+.NET Framework 3.0+IE 7
在IIS上部署无线**系统的WS模块时,IE中运行时WS的asmx调用页,提示如下错误:

System.Exception: System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本。
在 System.Data.OracleClient.OCI.DetermineClientVersion()
在 System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)
在 System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)
在 System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
在 System.Data.OracleClient.OracleConnection.Open()
在 HISPlus.DbAccess.Connect()
在 HISPlus.OracleAccess.SelectData(String sqlSel, String tableName, DataSet& ds, Boolean blnWithKey)
在 HISPlus.DbAccess.SelectData(String sqlSel, String tableName)
在 DataWebSrv.GetPdaDbTableList(DateTime dtLastUpdate) 位置 c:\MobileWebSrv\App_Code\DataWebSrv.cs:行号 60

解决方法:
使用administrator用户登陆,
在ORACLE_HOME目录(默认为C:\Oracle\ora92),右键"属性" -> "安全"选项卡,点击"添加",在"选择用户和组"中点击"高级",
点击"立即查找",在搜索结果中将ASPNET用户添加进去,并将相应的权限赋给ASPNET用户。
将IIS重启即可(可以在命令行中使用iisreset命令重启IIS)。

分类: Note 标签: ,

ORA-01861: 文字与格式字符串不匹配

2009年2月5日 stone 没有评论

ORA-01861: literal does not match format string
Cause: Literals in the input must be the same length as literals in the format string (with the exception of leading whitespace). If the "FX" modifier has been toggled on, the literal must match exactly, with no extra whitespace.

Action: Correct the format string to match the literal.

在SQL语句中日期类型字段值的设置、比较、显示如果直接使字符串方式('2009-02-04'),或者 使用to_date('2009-02-04')方式,  没有指定日期格式,则会报ORA-01861错误。
解决方法:使用to_date('2009-02-04' , 'yyyy-mm-dd') 替代以上方式。

分类: Note 标签:

SQL字符串连接符

2009年2月5日 stone 没有评论

SQL字符串连接符
在很多情况下我们需将几个字段值连接起来作为一个字符串来输出,这时需用到字符串连接符
在MS SQLSERVER 2K 中的连接符为"+"符号

在Oracle中则为"||",如
select charge_type_code || ' ' || charge_type_name from charge_type_dict;
输入结果为:
CHARGE_TYP
----------
1 自费
2 医疗保险
3 商业保险
4 社会保险
5 工伤
6 记帐
7 合同单位
8 长安医保

分类: Note 标签: ,