第一章代码 exec dbms_stats.set_table_stats(ownname=>'SCOTT',tabname=>'EMP',numrows=>100000,no_invalidate=>false);exec dbms_stats.set_index_stats(ownname=>' ...
分类:
数据库 时间:
2017-09-23 20:10:34
阅读次数:
161
--向表中插入一条记录 create or replace procedure pro_insertDept is begin insert into scott.dept values('77','dog','dog'); commit; end pro_insertDept; --执行 begi... ...
分类:
数据库 时间:
2017-09-23 13:37:47
阅读次数:
199
在进行报表开发时,很多时候会遇到行列转换操作,很对开发人员针对于SQL级别行列转换操作一直不甚理解,今天正好抽空对其进行了一些简单的总结。这里主要列举3种可以实现SQL行列转换的方法,包括通用SQL解法以及Oracle支持解法。一、测试数据测试表依旧采用Oracle经典的scott模式下的dept表... ...
分类:
数据库 时间:
2017-09-19 14:46:09
阅读次数:
639
同义词:数据字典 作用:屏蔽对象的名字及其持有者,为用户简化SQL语句。 创建私有同义词: create synonym ee for scott.emp 授权: grant create synonym to happyy2165 grant create synonym to SCOTT GRA ...
分类:
其他好文 时间:
2017-09-19 00:17:43
阅读次数:
167
--私有同义词--私有同义词权限grant create synonym to scott;--创建私有同义词create synonym dp for scott.dept;--将查询dept的权限授予qjt这个用户GRANT SELECT ON dept to QJT --公有同义词--公有同义 ...
分类:
数据库 时间:
2017-09-18 11:04:08
阅读次数:
166
--私有同义词--私有同义词权限grant create synonym to scott;--创建私有同义词create synonym dp for scott.dept;--将查询dept的权限授予qjt这个用户GRANT SELECT ON dept to QJT --公有同义词--公有同义 ...
分类:
其他好文 时间:
2017-09-18 10:46:08
阅读次数:
156
--私有同义词--私有同义词权限grant create synonym to scott;--创建私有同义词create synonym dp for scott.dept;--将查询dept的权限授予qjt这个用户GRANT SELECT ON dept to QJT --公有同义词--公有同义 ...
分类:
其他好文 时间:
2017-09-18 10:42:12
阅读次数:
117
--plsql块结构,计算a,b的和 declare a int:=10; b int:=20; c int; begin c:=a+b; dbms_output.put_line(c); end; --%type数据类型,输出员工名称和职务信息 declare var_ename scott.em... ...
分类:
数据库 时间:
2017-09-18 00:24:47
阅读次数:
310
方案一:直接授权法 1.用happyy2165登录,之后,授权 grant select on HAPPYY2165.STUDENT to scott 2.用scott登录,用如下代码去访问Student表 select * from HAPPYY2165.student 方式二:通过角色去控制 1 ...
分类:
数据库 时间:
2017-09-17 18:49:14
阅读次数:
212
Oracle里面是scott是个什么用户呢? 这个就要追朔到Oracle的创业阶段了, 1977年6月,埃里森,Bob Miner和Ed Oates在硅谷共同创办了一家名为软件开发实验室(Software Development Laboratories,SDL)的计算机公司,这个只有三个人的公司就 ...
分类:
数据库 时间:
2017-09-16 19:08:27
阅读次数:
210