易截截图软件、单文件、免安装、纯绿色、仅160KB

ADO+ORACLE大侠请进

我现在想实现一个判断ORACLE中一个视图是否存在,如果存在就删除。
在程序中我这样写的:
try
 {
 #pragma region [删掉老的视图]
  csSqlText.Format("SELECT COUNT(*) AS 视图计数 from SYS.ALL_VIEWS WHERE VIEW_NAME='%s';",csViewName);
  if (!dbcontroler.Connect_to((_bstr_t)m_csOracleConnectionText))  return;
  if (!dbcontroler.OpenRecordSet(csSqlText))  return;
  if ( dbcontroler.p_RecordSet->ADOEOF)   return;
  dbcontroler.p_RecordSet->MoveFirst();
  iViewCounter = dbcontroler.p_RecordSet->GetCollect("视图计数");
  if (iViewCounter > 0)
  {
   csSqlText.Format("DROP VIEW %s",csViewName);
   dbcontroler.UpDataDB(csSqlText);
  }
  dbcontroler.p_RecordSet->Close();
  dbcontroler.p_Connection->Close();
 }
 catch(_com_error e)
 {
  CString errorString;
  errorString.Format(_T("打开数据库表发声异常 ,错误信息:%s"),e.ErrorMessage());
  AfxMessageBox(errorString);
  return ;
 }
总是提示视图不存在。
但是,我直接在oracle中执行SELECT COUNT(*) AS 视图计数 from SYS.ALL_VIEWS WHERE VIEW_NAME='去年产量';是可以的。
这时为什么?如何才能在程序里面实现视图的删除呢?


相关文档:

oracle 表空间操作

oracle表空间操作详解
  1
  2
  3作者:   来源:    更新日期:2006-01-04 
  5
  6 
  7建立表空间
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

Oracle undo 回滚段管理


在开始之前,我们先来思考几个问题?
1.  ora-01555错误的是怎么产生的?有什么办法解决?
      该问题,参考我的Blog: Oracle ORA-01555快照过旧
  http://blog.csdn.net/tianlesoftware/archive/2009/10/31/4745898.aspx
2.  回滚段(回滚 ......

ORACLE视图


2008年06月01日 星期日 14:52
Oracle的数据库对象分为五种:表,视图,序列,索引和同义词。 
视图是基于一个表或多个表或视图的逻辑表,本身不包含数据,通过它可以对表里面的数据进行查询和修改。视图基于的表称为基表。 
视图是存储在数据字典里的一条select语句。 通过创建视图可以提取数据的逻辑上的集 ......

oracle 查看主外键约束

select a.constraint_name, a.table_name, b.constraint_name 
from user_constraints a, user_constraints b
where a.constraint_type = 'R' 
and b.constraint_type = 'P' 
and a.r_constraint_name = b.constraint_name
P 代表主键
R 代表外键
通过关联,能查询到你所想要的一切。
select co ......

oracle的9个name

Oracle的9个_name
2008-07-17 23:47
1、db_name 数据库名
  SQL> connect xys/manager as sysdba
  已连接。
  SQL> show user
  USER 为 "SYS"
  SQL> show parameter db_name
  NAME TYPE VALUE
  ---- -------- ------------
  db_name string test1
  db_name是数据库的名字,or ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号